jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
543 stars 68 forks source link

How to realizate queue? #153

Closed kg04ls closed 3 years ago

kg04ls commented 3 years ago

I want music queue, not playlist. How to do what after music played, it deleted from playlist?

jaseg commented 3 years ago

You could put your queued files in a playlist, then use an event callback to wait for END_FILE events and on END_FILE delete the first entry (index 0) in the playlist using playlist_remove. You could also ignore mpv's playlist handling entirely and have your own queue that you schedule e.g. by using wait_for_playback in a loop on a separate thread.

jaseg commented 3 years ago

I'm closing this issue because it seems it is resolved.