Comments (7)
Fixed in eb8b6a0. As a small bonus, you now can also call the constructor with start_event_thread=False
and call the resulting object's ._loop
function yourself. That acts much like gtk.main
. If for some reason you don't like threading at all, there is an out-of-date branch on this repo that contains python3 asyncio-based handling of events (which I ripped out because it was unportable and really awkward to use at no benefit).
from python-mpv.
Thanks. While I'd consider renaming ._loop
since it's no longer being presented as a private method, what you've done so far definitely resolves this.
Once I have time to work this into some of my projects as a replacement for an awkward, organically overgrown "call mpv in a subprocess once per file" system, I'll probably offer up a few improvements to the docs to cover what I learn from poking at it more.
from python-mpv.
I can no longer see the asyncio
branch
from python-mpv.
True. I wonder where that went. I must have deleted it during some rebasing action. If you really need it, I can pull it out of an old backup.
from python-mpv.
Looks like the event thread plays nice with my script which leverages asyncio
, so I won't be needing it - I was mostly curious what it looked like.
Anyway, the README file still refers to that branch, so you might want to correct that.
Thanks
from python-mpv.
Done.
The basic layout was that libmpv
has some function that produces a sort of event fd that gets a single byte written to or something on every event received, and you could pass that into asyncio's event loop to wake up the event handler on every event.
from python-mpv.
Thank for the report 😸
from python-mpv.
Related Issues (20)
- python-mpv not finding libmpv DLL on MSYS2 HOT 7
- no-border not working as intended HOT 1
- tests/test_mpv.py::TestLifecycle::test_wait_for_event_shutdown hangs HOT 1
- Audio controls
- I do not literally know which DLLs does it need to consume HOT 2
- How to directly play audio bytes? HOT 2
- "Cannot find libmpv in the usual places" on Arch Linux, Hypnotix HOT 2
- How to replace mpv.MpvEventID.METADATA_UPDATE ? HOT 2
- Loadfile command broken by API change in mpv v0.38.0 HOT 5
- The PyPI package is not up to date HOT 3
- playlist_next() and playlist_prev() beyond end of playlist causes SystemError HOT 1
- [QUESTION] How do I add custom scripts? HOT 2
- QOpenGLWidget is displayed in its own window since ibmpv.so.2.3.0 HOT 3
- SyntaxError on Mac os with python3 on v1.0.6 HOT 2
- Unable to set Gapless Playback option HOT 3
- Is it possible to read music files from an USB key or HD ? HOT 1
- trying to capture mouse clicks when running mpv HOT 2
- wait_until_playing and wait_for_property throws exception HOT 3
- wait_until_playing() seems to be triggered too early HOT 2
- How to set User-Agent? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-mpv.