mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Add some helper functions to AVPlayer (#1864)
This commit is contained in:
parent
b6fb64fde1
commit
f22d8015a6
1 changed files with 8 additions and 0 deletions
|
@ -149,6 +149,14 @@ class AVPlayer:
|
|||
self._enqueued = tags[:]
|
||||
self._play_next_if_idle()
|
||||
|
||||
def append_tags(self, tags: list[AVTag]) -> None:
|
||||
"""Append provided tags to the queue, then start playing them if the current player is idle."""
|
||||
self._enqueued.extend(tags)
|
||||
self._play_next_if_idle()
|
||||
|
||||
def queue_is_empty(self) -> bool:
|
||||
return bool(self._enqueued)
|
||||
|
||||
def stop_and_clear_queue(self) -> None:
|
||||
self._enqueued = []
|
||||
self._stop_if_playing()
|
||||
|
|
Loading…
Reference in a new issue