mpv.net | mpv.net is a modern media player | Video Utils library
kandi X-RAY | mpv.net Summary
kandi X-RAY | mpv.net Summary
mpv.net is a modern media player for Windows based on the popular [mpv] player.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mpv.net
mpv.net Key Features
mpv.net Examples and Code Snippets
Community Discussions
Trending Discussions on mpv.net
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 mpv.net
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