mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-06-03 16:26:52 +08:00
feat(lib): add auto_next
option (#304)
* feat(lib): add `auto_next` option As suggested in #302, you can now automatically skip a slide. It works both with `present` and `convert --to=html`! Closes #302 * chore(ci): add trigger on push on main
This commit is contained in:
@ -137,6 +137,17 @@ class Player(QMainWindow): # type: ignore[misc]
|
||||
|
||||
self.media_player.mediaStatusChanged.connect(media_status_changed)
|
||||
|
||||
else:
|
||||
|
||||
def media_status_changed(status: QMediaPlayer.MediaStatus) -> None:
|
||||
if (
|
||||
status == QMediaPlayer.EndOfMedia
|
||||
and self.current_slide_config.auto_next
|
||||
):
|
||||
self.load_next_slide()
|
||||
|
||||
self.media_player.mediaStatusChanged.connect(media_status_changed)
|
||||
|
||||
if self.current_slide_config.loop:
|
||||
self.media_player.setLoops(-1)
|
||||
|
||||
|
Reference in New Issue
Block a user