[M120][WRTjs][VD] Fix app is paused issue when VSS app is launched 18/305418/5
authorzhaosy <shiyusy.zhao@samsung.com>
Tue, 26 Dec 2023 10:45:56 +0000 (18:45 +0800)
committerDongHyun Song <dh81.song@samsung.com>
Mon, 5 Feb 2024 04:49:07 +0000 (04:49 +0000)
1.InitializeVSS early for hosted app to make sure aul app com connection is created.
2.In custom case, hide VSS is too later, it caused app window is showing before VSS
  video is stopped, then VSS recieve visibility change event and send INTERRUPT event
  to app, so app is paused.
  So hide VSS in HideSplashScreen(Followed M94 logic).

Reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/303450/

Change-Id: I096dff53987b2b5cdda73d6dfe2c29266f6ac9f7
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
(cherry picked from commit 3156f9570c64ed582530c98569c6948d7084d83d)

wrt/src/browser/basic_splash_screen.h
wrt/src/browser/splash_screen.cc
wrt/src/browser/splash_screen.h
wrt/src/browser/tv/native_web_runtime_delegate_tv.cc
wrt/src/browser/tv/video_splash_screen.cc [changed mode: 0755->0644]
wrt/src/browser/tv/video_splash_screen.h [changed mode: 0755->0644]

index bc19aeb..0b2e733 100644 (file)
@@ -32,6 +32,7 @@ class BasicSplashScreen : public SplashScreen {
  protected:
   BasicSplashScreen(std::unique_ptr<SplashScreenDelegate> delegate);
 
+  void BeforeHide() override {}
   wgt::parse::ReadyWhen GetReadyWhen() override;
 
   using SplashScreenData = const wgt::parse::LaunchScreenData;
index 6204a85..15c5cef 100644 (file)
@@ -84,6 +84,7 @@ bool SplashScreen::HideSplashScreen(HideReason reason) {
   }
   hidden_reason = reason;
 
+  splash_screen->BeforeHide();
   LOG(INFO) << "Will HideSplashScreen reason by " << reason;
   return true;
 }
index 7b5308b..ff453e7 100644 (file)
@@ -43,6 +43,7 @@ class SplashScreen : public electron::NativeWindowObserver {
   SplashScreen();
 
   virtual void Init() = 0;
+  virtual void BeforeHide() = 0;
   virtual void Hide() = 0;
   virtual wgt::parse::ReadyWhen GetReadyWhen() = 0;
 
index 00cc1e0..fc12c6d 100644 (file)
@@ -291,8 +291,8 @@ void NativeWebRuntimeDelegateTV::EarlyLoadUrlIfHostedApp() {
 }
 
 void NativeWebRuntimeDelegateTV::DidInitialized() {
-  EarlyLoadUrlIfHostedApp();
   VideoSplashScreen::InitializeVSS();
+  EarlyLoadUrlIfHostedApp();
   SetD2dServiceMessageListener();
   SubscribePowerState();
 
old mode 100755 (executable)
new mode 100644 (file)
index 9e2caa5..2e3f89a
@@ -110,8 +110,10 @@ void VideoSplashScreen::InitializeVSS() {
   if (aul_app_com_connection_)
     return;
 
-  if (!aul_extension_splash_screen_tv_event("ISVIDEO"))
+  if (!aul_extension_splash_screen_tv_event("ISVIDEO")) {
+    LOG(ERROR) << "Failed to send ISVIDEO to VSS";
     return;
+  }
 
   std::string com_endpoint = kSplashScreenAulAppCom + app_data.app_id();
   if (aul_app_com_create(com_endpoint.c_str(), nullptr, OnSplashScreenMessage,
@@ -122,11 +124,19 @@ void VideoSplashScreen::InitializeVSS() {
   }
 }
 
+void VideoSplashScreen::BeforeHide() {
+  Hide();
+}
+
 void VideoSplashScreen::Hide() {
+  if (was_hidden_)
+    return;
+
   if (VideoSplashScreen::IsVSSPlaying()) {
     auto hidden_reason = SplashScreen::GetHiddenReason();
     const char* hide_reason = HideReasonToString(hidden_reason);
     HideVSSPlayer(hide_reason);
+    was_hidden_ = true;
   }
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 9f08fac..661419f
@@ -23,8 +23,11 @@ class VideoSplashScreen : public SplashScreen {
 
  private:
   void Init() override {}
+  void BeforeHide() override;
   void Hide() override;
   wgt::parse::ReadyWhen GetReadyWhen() override;
+
+  bool was_hidden_ = false;
 };
 
 }  // namespace wrt