Please consider migrating to libmpv
or to mpv
's JSON IPC interface. MPlayer itself is no longer maintained.
>>> p = mplayer.Player()
>>> p.loadfile('/path/to/file.mkv')
>>> p.time_pos = 40
>>> print p.length
Initially known as PyMPlayer (http://pypi.python.org/pypi/PyMPlayer/ renamed to avoid confusion with other projects), mplayer.py provides several Pythonic interfaces to MPlayer. These are implemented as the following classes (see Introspection for more info):
- Player provides a clean, Pythonic interface to MPlayer.
- AsyncPlayer is a Player subclass with asyncore integration (POSIX only).
- GPlayer is a Player subclass with GTK/GObject integration.
- QtPlayer is a Player subclass with Qt integration (same usage as AsyncPlayer)
- GtkPlayerView provides a basic (as of now) PyGTK widget that embeds MPlayer.
- QPlayerView provides a PyQt4 widget similar to GtkPlayerView in functionality.
Show your appreciation by saying thanks or by donating a small amount.
You can download it here: http://pypi.python.org/pypi/mplayer.py/0.7.2
- Don't pause upon initially loading file (Fixes #32)
You can download it here: http://pypi.python.org/pypi/mplayer.py/0.7.1
- Various MPlayer2 fixes
- Fix subprocess.mswindows error in python3.5+
- Add a gevent-friendly Player subclass.
You can download it here: http://pypi.python.org/pypi/mplayer.py/0.7.0
- Expose ALL commands except
get_*
and*_property
commands and those which have the same name as their corresponding property. - Better
QPlayerView
andGtkPlayerView
widgets; thePlayer
objects are now directly accessible via theplayer
property. - Getting output from MPlayer is now thread-safe (a
Queue
is now used) - Data can now be obtained asynchronously from
Player
objects (via subscribers/callbacks) - Improved generation of properties (using
functools.partial
objects) - Added type checking to generated methods and properties
- Added value checking to generated properties
- Abstracted MPlayer type handling away from the core (see
mtypes
module) - Python 2.x unicode and str fixes
Don't forget to read the CHANGES file.
The code of mplayer.py (formerly PyMPlayer/python-mplayer) is now hosted at GitHub.
NOTE: Issues and wiki are still hosted here at Google Code.
Since python-mplayer is a very verbose and long name, let's just call it mplayer.py :)
You can download it here: http://pypi.python.org/pypi/PyMPlayer/
- Support for MPlayer property access (
get_property
,set_property
,step_property
) with automatic type conversion via standard Python properties (new-style classes) - Drop methods which have the same functionality as their corresponding properties (for cleaner API)
- No more exposed
command()
andquery()
methods; use the higher-level methods and properties instead - Improved code generation; generated methods execute faster than in 0.5.0
- Introspection now happens on module load, not on instantiation
- MPlayer is now spawned automatically (See
autospawn
parameter) - Setting of command prefix globally (i.e. per class) and per method execution is supported
- Full support for Windows (for
get_
commands)
Don't forget to read the CHANGES file.