python-mpv | Python interface to the awesome mpv media player | Media library
kandi X-RAY | python-mpv Summary
kandi X-RAY | python-mpv Summary
Python interface to the awesome mpv media player
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Register a stream protocol .
- Make a node list from a list .
- Cast a node value to a given format
- Decorator to handle backend methods .
- Set the attribute of the context .
- Convert a value into a property type .
- Read data from the stream .
- An event generator .
- Lazy decoder .
- Raise a RuntimeError if the function returns NULL .
python-mpv Key Features
python-mpv Examples and Code Snippets
Community Discussions
Trending Discussions on python-mpv
QUESTION
I use the library https://github.com/jaseg/python-mpv to control the mpv player, but when using it together with pyside6, keybindings do not work (player doesn't accept input totally). What am I doing wrong? or is it impossible to use them when embedding in pyside6? (If I run the player with the same arguments without embedding, everything works fine)
...ANSWER
Answered 2022-Feb-23 at 18:13If the keyboard is not handled (which, in my tests, only happened when the mouse is not hovering the video), the key events are propagated to the Qt window. This means that we can handle those events in the keyPressEvent()
override and then create a proper mpv command, which is already mapped to the keypress()
function. Obviously, a reference to the player must exist, so you need to make it an instance attribute.
For standard literal keys, it's usually enough to use the event's text()
, but for other keys such as arrows you need to map the event with mpv's key names. Using a dictionary is certainly simpler:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install python-mpv
You can use python-mpv like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page