feat(ffmpeg): add playback complete event trigger (#7119)
This commit is contained in:
@@ -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
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user