- build MPV's internal playlist from .playlist
- bind starting of files to ._signal_update and setting ._idx to MPV's
own playlist position index
+ - bind ending last file to re-starting at playlist start
- start playing
"""
self._mpv = MPV(input_default_bindings=True,
self._idx = self._mpv.playlist_pos
self._signal_update()
+ @self._mpv.event_callback('end-file')
+ def on_end_file(event) -> None:
+ if (b'eof' == event.as_dict()['reason']
+ and self._idx + 1 == len(self.playlist)):
+ self._idx = 0
+ self._play_at_index()
+
@self._mpv.event_callback('shutdown')
def on_shutdown(_) -> None:
self._kill_queue.put(True)