summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp2
-rw-r--r--Userland/Libraries/LibVideo/PlaybackManager.cpp6
-rw-r--r--Userland/Libraries/LibVideo/PlaybackManager.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp
index 8541e631ec..57e7ffe51d 100644
--- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp
+++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp
@@ -129,7 +129,6 @@ void VideoPlayerWidget::resume_playback()
if (!m_playback_manager || m_seek_slider->knob_dragging())
return;
m_playback_manager->resume_playback();
- update_play_pause_icon();
}
void VideoPlayerWidget::pause_playback()
@@ -137,7 +136,6 @@ void VideoPlayerWidget::pause_playback()
if (!m_playback_manager || m_seek_slider->knob_dragging())
return;
m_playback_manager->pause_playback();
- update_play_pause_icon();
}
void VideoPlayerWidget::toggle_pause()
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp
index a2c6dc19b4..92c293c932 100644
--- a/Userland/Libraries/LibVideo/PlaybackManager.cpp
+++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp
@@ -121,6 +121,11 @@ bool PlaybackManager::dispatch_frame_queue_item(FrameQueueItem&& item)
return false;
}
+void PlaybackManager::dispatch_state_change()
+{
+ m_main_loop.post_event(m_event_handler, TRY_OR_FATAL_ERROR(try_make<PlaybackStateChangeEvent>()));
+}
+
void PlaybackManager::timer_callback()
{
TRY_OR_FATAL_ERROR(m_playback_handler->on_timer_callback());
@@ -265,6 +270,7 @@ ErrorOr<void> PlaybackManager::PlaybackStateHandler::replace_handler_and_delete_
m_has_exited = true;
dbgln("Changing state from {} to {}", temp_handler->name(), m_manager.m_playback_handler->name());
#endif
+ m_manager.dispatch_state_change();
TRY(m_manager.m_playback_handler->on_enter());
return {};
}
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.h b/Userland/Libraries/LibVideo/PlaybackManager.h
index f71cfbb726..311dafa380 100644
--- a/Userland/Libraries/LibVideo/PlaybackManager.h
+++ b/Userland/Libraries/LibVideo/PlaybackManager.h
@@ -132,6 +132,7 @@ private:
void dispatch_new_frame(RefPtr<Gfx::Bitmap> frame);
// Returns whether we changed playback states. If so, any PlaybackStateHandler processing must cease.
[[nodiscard]] bool dispatch_frame_queue_item(FrameQueueItem&&);
+ void dispatch_state_change();
void dispatch_fatal_error(Error);
Core::Object& m_event_handler;