bilibilivoice.mpv - mpv播放器使用¶
-
class
bilibilivoice.mpv.
MPV
(*args, **kwargs)[源代码]¶ Bases:
bilibilivoice.mpv.MPVBase
Class for communication with the mpv media player via unix socket based JSON IPC. It adds a few usable methods and a callback API.
To automatically register methods as event callbacks, subclass this class and define specially named methods as follows:
- def on_file_loaded(self):
- # This is called for every 'file-loaded' event. ...
- def on_property_time_pos(self, position):
- # This is called whenever the 'time-pos' property is updated. ...
Please note that callbacks are executed inside a separate thread. The MPV class itself is completely thread-safe. Requests from different threads to the same MPV instance are synchronized.
-
register_property_callback
(name, callback)[源代码]¶ Register a function callback for the property-change event on property name.
-
class
bilibilivoice.mpv.
MPVBase
(window_id=None, debug=False)[源代码]¶ Bases:
object
Base class for communication with the mpv media player via unix socket based JSON IPC.
用于控制mpv的类,因为尝试通过管道控制mpv,但是好像mpv不支持管道...所有就 只能通过json来中间控制了
-
default_argv
= ['--idle', '--no-input-default-bindings', '--no-terminal', '--no-video']¶
-
executable
= None¶
-
-
exception
bilibilivoice.mpv.
MPVCommandError
[源代码]¶ Bases:
bilibilivoice.mpv.MPVError
-
exception
bilibilivoice.mpv.
MPVCommunicationError
[源代码]¶ Bases:
bilibilivoice.mpv.MPVError
-
exception
bilibilivoice.mpv.
MPVProcessError
[源代码]¶ Bases:
bilibilivoice.mpv.MPVError
-
exception
bilibilivoice.mpv.
MPVTimeoutError
[源代码]¶ Bases:
bilibilivoice.mpv.MPVError