From 08a2602fe2e254067b3a70e2a7d57703ead2cbd7 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 26 Sep 2020 22:15:36 +0200 Subject: [PATCH] Added function to unpause video. --- es-core/src/GuiComponent.cpp | 6 ++++++ es-core/src/GuiComponent.h | 1 + es-core/src/components/VideoComponent.cpp | 7 +++++++ es-core/src/components/VideoComponent.h | 1 + 4 files changed, 15 insertions(+) diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index d0d8e39e8..7264c76e9 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -522,6 +522,12 @@ void GuiComponent::onPauseVideo() getChild(i)->onPauseVideo(); } +void GuiComponent::onUnpauseVideo() +{ + for (unsigned int i = 0; i < getChildCount(); i++) + getChild(i)->onUnpauseVideo(); +} + void GuiComponent::onScreenSaverActivate() { for (unsigned int i = 0; i < getChildCount(); i++) diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index 3382f3125..8687ff4e5 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -167,6 +167,7 @@ public: virtual void onShow(); virtual void onHide(); virtual void onPauseVideo(); + virtual void onUnpauseVideo(); virtual void setRenderView(bool status) { mRenderView = status; } virtual bool getRenderView() { return mRenderView; }; diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index 8e89958d1..abde15809 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -358,6 +358,13 @@ void VideoComponent::onPauseVideo() manageState(); } +void VideoComponent::onUnpauseVideo() +{ + mBlockPlayer = false; + mPause = false; + manageState(); +} + void VideoComponent::onScreenSaverActivate() { mBlockPlayer = true; diff --git a/es-core/src/components/VideoComponent.h b/es-core/src/components/VideoComponent.h index bcff577ac..5deb1411a 100644 --- a/es-core/src/components/VideoComponent.h +++ b/es-core/src/components/VideoComponent.h @@ -48,6 +48,7 @@ public: virtual void onShow() override; virtual void onHide() override; virtual void onPauseVideo() override; + virtual void onUnpauseVideo() override; virtual void onScreenSaverActivate() override; virtual void onScreenSaverDeactivate() override; virtual void onGameLaunchedActivate() override;