summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibVideo/PlaybackManager.cpp4
-rw-r--r--Userland/Libraries/LibVideo/PlaybackManager.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp
index 4db877e1f2..bda97295b7 100644
--- a/Userland/Libraries/LibVideo/PlaybackManager.cpp
+++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp
@@ -129,6 +129,10 @@ void PlaybackManager::dispatch_decoder_error(DecoderError error)
case DecoderErrorCategory::EndOfStream:
dbgln_if(PLAYBACK_MANAGER_DEBUG, "{}", error.string_literal());
TRY_OR_FATAL_ERROR(m_playback_handler->stop());
+
+ if (on_end_of_stream)
+ on_end_of_stream();
+
break;
default:
dbgln("Playback error encountered: {}", error.string_literal());
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.h b/Userland/Libraries/LibVideo/PlaybackManager.h
index 813101ba6f..7c5779ded3 100644
--- a/Userland/Libraries/LibVideo/PlaybackManager.h
+++ b/Userland/Libraries/LibVideo/PlaybackManager.h
@@ -123,6 +123,7 @@ public:
Function<void(RefPtr<Gfx::Bitmap>)> on_video_frame;
Function<void()> on_playback_state_change;
+ Function<void()> on_end_of_stream;
Function<void(DecoderError)> on_decoder_error;
Function<void(Error)> on_fatal_playback_error;