feat(ffmpeg): add playback complete event trigger (#7119)

This commit is contained in:
Eric Maryea
2024-10-25 03:35:34 -04:00
committed by GitHub
parent a8d2cc05f1
commit 014f328dc9
2 changed files with 10 additions and 0 deletions

View File

@@ -40,6 +40,13 @@ See the examples below.
.. _ffmpeg_example: .. _ffmpeg_example:
Events
------
- :cpp:enumerator:`LV_EVENT_READY` Sent when playback is complete and auto-restart is not enabled.
Learn more about :ref:`events`.
Example Example
------- -------

View File

@@ -817,6 +817,9 @@ static void lv_ffmpeg_player_frame_update_cb(lv_timer_t * timer)
if(has_next < 0) { if(has_next < 0) {
lv_ffmpeg_player_set_cmd(obj, player->auto_restart ? LV_FFMPEG_PLAYER_CMD_START : LV_FFMPEG_PLAYER_CMD_STOP); lv_ffmpeg_player_set_cmd(obj, player->auto_restart ? LV_FFMPEG_PLAYER_CMD_START : LV_FFMPEG_PLAYER_CMD_STOP);
if(!player->auto_restart) {
lv_obj_send_event((lv_obj_t *)player, LV_EVENT_READY, NULL);
}
return; return;
} }