[M120 Migration] Implement ewk_view_is_video_playing api 35/307835/4
authoryangzhiwen <zw714.yang@samsung.com>
Wed, 13 Mar 2024 12:22:15 +0000 (20:22 +0800)
committeryangzhiwen <zw714.yang@samsung.com>
Fri, 15 Mar 2024 01:33:18 +0000 (09:33 +0800)
The api used to set video to auto fullscreen on timeout
during idle situation(Timeout of 120sec or 2 hours).

If video is found to be in playing state, then video
is turned into fullscreen.

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

Change-Id: I644ec19401648a3efeba23b6802cca2cd16d31a8
Signed-off-by: yangzhiwen <zw714.yang@samsung.com>
28 files changed:
content/browser/renderer_host/render_widget_host_impl.cc
content/browser/renderer_host/render_widget_host_impl.h
content/browser/renderer_host/render_widget_host_view_aura.cc
content/browser/renderer_host/render_widget_host_view_aura.h
content/browser/renderer_host/render_widget_host_view_base.h
content/public/browser/web_contents_delegate.h
third_party/blink/public/mojom/widget/platform_widget.mojom
third_party/blink/public/web/web_view.h
third_party/blink/renderer/core/dom/document.cc
third_party/blink/renderer/core/dom/document.h
third_party/blink/renderer/core/execution_context/execution_context.cc
third_party/blink/renderer/core/execution_context/execution_context.h
third_party/blink/renderer/core/execution_context/execution_context_lifecycle_state_observer.h
third_party/blink/renderer/core/exported/web_view_impl.cc
third_party/blink/renderer/core/exported/web_view_impl.h
third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
third_party/blink/renderer/core/frame/web_frame_widget_impl.h
third_party/blink/renderer/core/html/media/html_media_element.h
third_party/blink/renderer/platform/widget/widget_base.cc
third_party/blink/renderer/platform/widget/widget_base.h
third_party/blink/renderer/platform/widget/widget_base_client.h
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/public/ewk_view.cc
tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc
tizen_src/ewk/efl_integration/web_contents_delegate_efl.h

index a1d7a8ee64e44dfdcde79bfccaaaf221515fa1b0..89be0f9057169af764a8c653c2e3b4fb4ffb29f7 100644 (file)
@@ -612,6 +612,25 @@ void RenderWidgetHostImpl::UnPauseScheduledTasks() {
 #endif
 
 #if BUILDFLAG(IS_TIZEN_TV)
+void RenderWidgetHostImpl::RequestVideoPlaying(int callback_id) {
+  if (!blink_widget_){
+    LOG(ERROR) << "blink_widget_ is null";
+    return;
+  }
+  blink_widget_->IsVideoPlaying(
+      base::BindOnce(&RenderWidgetHostImpl::OnGetVideoPlayingStatus,
+                     weak_factory_.GetWeakPtr(), callback_id));
+}
+
+void RenderWidgetHostImpl::OnGetVideoPlayingStatus(int callback_id,
+                                                   bool is_playing) {
+  if (!view_){
+    LOG(ERROR) << "view_ is null";
+    return;
+  }
+  view_->VideoPlayingStatusReceived(is_playing, callback_id);
+}
+
 void RenderWidgetHostImpl::SetParentalRatingResult(const std::string& url,
                                                    bool is_pass) {
   if (!blink_widget_){
index c1e2ec6b1fecd1fb2444cd05e6496e0905e3e1ae..733f39551626f047f7cd44665f05e4e426247468 100644 (file)
@@ -380,6 +380,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
   void SetView(RenderWidgetHostViewBase* view);
 
 #if BUILDFLAG(IS_TIZEN_TV)
+  void RequestVideoPlaying(int callback_id);
+  void OnGetVideoPlayingStatus(int callback_id, bool is_playing);
   void SetTranslatedURL(const std::string& url);
   void SetParentalRatingResult(const std::string& url, bool is_pass);
 #endif
index 2a443c9965c2f0829b7de28687b2ff21f220889b..c6efa4f270e47177897bc5f10da91654021ceeef 100644 (file)
@@ -425,6 +425,16 @@ void RenderWidgetHostViewAura::InitAsPopup(
 #endif
 }
 
+#if BUILDFLAG(IS_TIZEN_TV)
+void RenderWidgetHostViewAura::VideoPlayingStatusReceived(bool is_playing,
+                                                          int callback_id) {
+  if (aura_efl_helper())
+    aura_efl_helper()->VideoPlayingStatusReceived(is_playing, callback_id);
+  else
+    LOG(ERROR) << "aura_efl_helper() is false";
+}
+#endif
+
 void RenderWidgetHostViewAura::Hide() {
   window_->Hide();
   visibility_ = Visibility::HIDDEN;
index 97c1d6a8c7e935daa97b1e3beccd68b7ff71c791..d18e39a10319602ef03451a85bb3d49cdb0f1ee5 100644 (file)
@@ -188,6 +188,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   bool GetIsMouseLockedUnadjustedMovementForTesting() override;
   bool LockKeyboard(absl::optional<base::flat_set<ui::DomCode>> codes) override;
   void UnlockKeyboard() override;
+#if BUILDFLAG(IS_TIZEN_TV)
+  // notify web browser video playing status
+  void VideoPlayingStatusReceived(bool is_playing, int callback_id) override;
+#endif
   bool IsKeyboardLocked() override;
   base::flat_map<std::string, std::string> GetKeyboardLayoutMap() override;
   void InvalidateLocalSurfaceIdAndAllocationGroup() override;
index 112417bf190999fd056e567dc00d1c40d1720d10..a47162feaa4fbb2d4c77c459f7315ed259065415 100644 (file)
@@ -507,6 +507,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
 #if BUILDFLAG(IS_TIZEN_TV)
   //Browser edge scroll
   virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {}
+  // notify web browser video playing status
+  virtual void VideoPlayingStatusReceived(bool is_playing, int callback_id) {}
 #endif
 
   // Calls UpdateTooltip if the view is under the cursor.
index d3be49bd57c6fa67aa6676c2ec30644f507c0aa7..1ad242e30c4edfa263bb395b30cb96101cfb739d 100644 (file)
@@ -735,6 +735,7 @@ class CONTENT_EXPORT WebContentsDelegate {
   virtual void ExitPictureInPicture() {}
 
 #if BUILDFLAG(IS_TIZEN_TV)
+  virtual void VideoPlayingStatusReceived(bool is_playing, int callback_id) {}
   virtual void NotifyPlaybackState(int state,
                                    int player_id,
                                    const std::string& url,
index 78dabfb2cb73b606e8b0cd708c758df37804ab7e..ed5760559eacc34cc06c97a7d3d31e836777ccf5 100644 (file)
@@ -139,6 +139,9 @@ interface Widget {
   [EnableIf=is_efl]
   ResetLastInteractedElements();
 
+  [EnableIf=is_tizen_tv]
+  IsVideoPlaying() => (bool is_video_playing);
+
   [EnableIf=is_tizen_tv]
   SetTranslatedURL(string url);
 
index de07ce2effd18dce9be7f3cfddfb45b6d06db9b8..be84a15f74df225e0e4a425a40ea73c8c4f7dce1 100644 (file)
@@ -545,6 +545,8 @@ class BLINK_EXPORT WebView {
 
 #if BUILDFLAG(IS_TIZEN_TV)
   virtual void SetFloatVideoWindowState(bool enable) = 0;
+  // Return if there is any active video in the view
+  virtual bool IsVideoPlaying() const = 0;
   virtual void SetParentalRatingResult(const WebString&, bool) = 0;
 #endif
 
index 0bd12e64b543ee046d57e8c15868727622407be7..f1a0a8a2c17a6b9d1c6c21bc44abe6840f743ce2 100644 (file)
@@ -1098,6 +1098,16 @@ bool Document::IsInMainFrame() const {
   return GetFrame() && GetFrame()->IsMainFrame();
 }
 
+#if BUILDFLAG(IS_TIZEN_TV)
+bool Document::IsVideoPlaying() const {
+  if (GetExecutionContext())
+    return GetExecutionContext()->CheckVideoPlaying();
+
+  LOG(INFO) << "GetExecutionContext() is null";
+  return false;
+}
+#endif
+
 bool Document::IsInOutermostMainFrame() const {
   return GetFrame() && GetFrame()->IsOutermostMainFrame();
 }
@@ -7303,7 +7313,10 @@ Document& Document::TopDocument() const {
 }
 
 ExecutionContext* Document::GetExecutionContext() const {
-  return execution_context_.Get();
+  if (execution_context_)
+    return execution_context_.Get();
+  else
+    return nullptr;
 }
 
 Agent& Document::GetAgent() const {
index ee3af84b9afefbdb8aa59ad72a3790fcf42a0fd1..c64ad1f15b4d4e9f2f5259add021bc3b9f78c2fb 100644 (file)
@@ -1689,6 +1689,10 @@ class CORE_EXPORT Document : public ContainerNode,
   // See `Frame::IsMainFrame`.
   bool IsInMainFrame() const;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  bool IsVideoPlaying() const;
+#endif
+
   // Returns true if this document has a frame and is an outermost main frame.
   // See `Frame::IsOutermostMainFrame`.
   bool IsInOutermostMainFrame() const;
index fc386a1f4e8e19fecfec4e842f839bbaebe75e8c..c0382ee99b587054a6fbc3423b858f52491eeb0c 100644 (file)
@@ -303,6 +303,31 @@ void ExecutionContext::SetParentalRatingResult(const String& url,
           state_observer->SetParentalRatingResult(is_pass);
       });
 }
+
+bool ExecutionContext::CheckVideoPlaying() const {
+  bool result = false;
+  ContextLifecycleNotifier::observers().ForEachObserver(
+      [&](ContextLifecycleObserver* observer) {
+        if (!observer->IsExecutionContextLifecycleObserver())
+          return;
+        if (static_cast<ExecutionContextLifecycleObserver*>(observer)
+                ->ObserverType() !=
+            ExecutionContextLifecycleObserver::kStateObjectType)
+          return;
+        ExecutionContextLifecycleStateObserver* state_observer =
+            static_cast<ExecutionContextLifecycleStateObserver*>(observer);
+        if (state_observer->HasVideo()) {
+#if DCHECK_IS_ON()
+          DCHECK_EQ(state_observer->GetExecutionContext(), Context());
+          DCHECK(state_observer->UpdateStateIfNeededCalled());
+#endif
+          if (state_observer->IsPlaying())
+            result = true;
+        }
+      });
+
+  return result;
+}
 #endif
 
 void ExecutionContext::AddConsoleMessageImpl(
index 131cc60aed560136a6bde4bdf6e4cd3513490ca7..bfac902c15761203519fedcd84ef4980885fc279 100644 (file)
@@ -477,6 +477,7 @@ class CORE_EXPORT ExecutionContext : public Supplementable<ExecutionContext>,
   virtual bool HasStorageAccess() const { return false; }
 
 #if BUILDFLAG(IS_TIZEN_TV)
+  bool CheckVideoPlaying() const;
   void SetTranslatedURL(const String&);
   void SetParentalRatingResult(const String& url, bool is_pass);
 #endif
index 0a5c90d9341245622b39014912affe98915c5a8f..45b9b8639aaf8b61592428ac3951440d519ab87c 100644 (file)
@@ -70,16 +70,16 @@ class CORE_EXPORT ExecutionContextLifecycleStateObserver
   virtual void ContextLifecycleStateChanged(
       mojom::blink::FrameLifecycleState state) {}
 
+  virtual bool HasVideo() const { return false; }
 #if BUILDFLAG(IS_TIZEN_TV)
+  virtual bool IsPlaying() const { return false; }
   virtual bool IsHTMLMediaElement() const { return false; }
   virtual String GetUrl() const { return ""; }
   virtual void SetParentalRatingResult(bool) {}
+  virtual void SetTranslatedURL(const String&) {}
 #endif
 
   void SetExecutionContext(ExecutionContext*) override;
-#if BUILDFLAG(IS_TIZEN_TV)
-  virtual void SetTranslatedURL(const String&) {}
-#endif
 
  protected:
   ~ExecutionContextLifecycleStateObserver() override;
index c71372a197b9b1354d9b359ab0b27b04c51831c3..7c8d517668faae7bb6e46add7527d8e34177f302 100644 (file)
@@ -4632,6 +4632,22 @@ void WebViewImpl::SetParentalRatingResult(const WebString& url, bool is_pass) {
     document->SetParentalRatingResult(url, is_pass);
   }
 }
+
+bool WebViewImpl::IsVideoPlaying() const {
+  if (!MainFrameImpl()){
+    LOG(ERROR) << "no main frame.";
+    return false;
+  }
+
+  for (const Frame* frame = MainFrameImpl()->GetFrame(); frame;
+       frame = frame->Tree().TraverseNext()) {
+    Document* document = To<LocalFrame>(frame)->GetDocument();
+    DCHECK(document);
+    if (document->IsVideoPlaying())
+      return true;
+  }
+  return false;
+}
 #endif
 
 }  // namespace blink
index 9de841d242af249bd6481c1d5dd1da3ec2334044..6e6051c8880c693106b9daea4cce9f7d799e1a59 100644 (file)
@@ -568,6 +568,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
   gfx::Size MainFrameSize();
 
 #if BUILDFLAG(IS_TIZEN_TV)
+  bool IsVideoPlaying() const override;
   void SetParentalRatingResult(const WebString&, bool) override;
 #endif
 
index ad83c182f69dab2a742941390c6454c1d2ff5aac..73a1f43815d2d188ae2d38ebeeacae4471540e8b 100644 (file)
@@ -1452,6 +1452,15 @@ void WebFrameWidgetImpl::SetParentalRatingResult(const WTF::String& url,
   webview->SetParentalRatingResult(blink::WebString::FromUTF8(url.Ascii()),
                                    is_pass);
 }
+
+bool WebFrameWidgetImpl::IsVideoPlaying() {
+  WebViewImpl* webview = View();
+  if (!webview){
+    LOG(ERROR) << "no webview.";
+    return false;
+  }
+  return webview->IsVideoPlaying();
+}
 #endif
 
 void WebFrameWidgetImpl::SetNeedsRecalculateRasterScales() {
index 724933119a8648ad80c5530631f4e768bace1659..ff61471d38885abf7c6f88d4370ee8dc5e94ced6 100644 (file)
@@ -868,6 +868,8 @@ class CORE_EXPORT WebFrameWidgetImpl
 #if BUILDFLAG(IS_TIZEN_TV)
   //Browser edge scroll
   void EdgeScrollBy(const gfx::Point& offset, const gfx::Point& mouse_position) override;
+  // notify web browser video playing status
+  bool IsVideoPlaying() override;
   void SetTranslatedURL(const WTF::String& url) override;
   void SetParentalRatingResult(const WTF::String& url, bool is_pass) override;
 #endif
index da0d0abb52cb1da5ad1b3b3166b6e58633658b39..d61c5162a3cbb9206b88ecd37d8bfa364b2e0d47 100644 (file)
@@ -154,11 +154,15 @@ class CORE_EXPORT HTMLMediaElement
   // Returns true if the loaded media has a video track.
   // Note that even an audio element can have video track in cases such as
   // <audio src="video.webm">, in which case this function will return true.
-  bool HasVideo() const;
+  bool HasVideo() const override;
 
   // Returns true if loaded media has an audio track.
   bool HasAudio() const;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  bool IsPlaying() const override { return playing_; }
+#endif
+
   // Whether the media element has encrypted audio or video streams.
   bool IsEncrypted() const;
 
index 92cf4f277718e8869d6223b4f9923703c2206b28..0c15209e4d36f3aa5dd4834fc8a628288d0f97de 100644 (file)
@@ -588,6 +588,10 @@ void WidgetBase::SetTranslatedURL(const WTF::String& url) {
 void WidgetBase::SetParentalRatingResult(const WTF::String& url, bool is_pass) {
   client_->SetParentalRatingResult(url, is_pass);
 }
+
+void WidgetBase::IsVideoPlaying(IsVideoPlayingCallback callback) {
+  std::move(callback).Run(client_->IsVideoPlaying());
+}
 #endif // IS_TIZEN_TV
 
 void WidgetBase::WasHidden() {
index a416c0cd1f28808fabb54e2b86613387cb3d7a89..286da27b5e7bd01bcd024319a0799f4238c4248c 100644 (file)
@@ -173,6 +173,7 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget,
 
 #if BUILDFLAG(IS_TIZEN_TV)
   void SetTranslatedURL(const WTF::String& url) override;
+  void IsVideoPlaying(IsVideoPlayingCallback callback) override;
   void SetParentalRatingResult(const WTF::String& url, bool is_pass) override;
 #endif
 
index 0aa127eafe24960f478cf636d157a369e4594c3a..14864064c1ad903fd0ff89133f7c1a1e77c7f395 100644 (file)
@@ -205,6 +205,7 @@ class WidgetBaseClient {
 #endif
 
 #if BUILDFLAG(IS_TIZEN_TV)
+  virtual bool IsVideoPlaying() {}
   virtual void SetTranslatedURL(const WTF::String& url) {}
   virtual void SetParentalRatingResult(const WTF::String& url, bool is_pass) {}
 #endif
index d530c7c8cec005cc53202eb4c5b7e30c769c718a..7c0b7d17d53c77a3234a7b817c647856f411a2cf 100644 (file)
@@ -452,6 +452,22 @@ void RWHVAuraCommonHelperEfl::SetParentalRatingResult(const std::string& url,
     LOG(ERROR) << "rwhv_aura_ is null";
 }
 
+void RWHVAuraCommonHelperEfl::VideoPlayingStatusReceived(bool is_playing,
+                                                         int callback_id) {
+  if (web_contents_ && web_contents_->GetDelegate())
+    web_contents_->GetDelegate()->VideoPlayingStatusReceived(is_playing,
+                                                             callback_id);
+  else
+    LOG(ERROR) << "web_contents_ or web_contents_->GetDelegate() is null";
+}
+
+void RWHVAuraCommonHelperEfl::RequestVideoPlaying(int callback_id) {
+  if (rwhv_aura_)
+    rwhv_aura_->host()->RequestVideoPlaying(callback_id);
+  else
+    LOG(ERROR) << "rwhv_aura_ is null";
+}
+
 void RWHVAuraCommonHelperEfl::SetPopupMenuVisible(const bool visible) {
   NOTIMPLEMENTED();
 }
index ba6dd9b964f6f3faa8727897d964a52b46a287cf..b578d75a83f7d46fadf6546c27bee5cf11b84564 100644 (file)
@@ -143,6 +143,9 @@ class CONTENT_EXPORT RWHVAuraCommonHelperEfl {
   void SetMouseEventsEnabled(bool enabled);
   void SetTranslatedURL(const std::string& url);
   void SetParentalRatingResult(const std::string& url, bool is_pass);
+  // notify web browser video playing status
+  void RequestVideoPlaying(int callback_id);
+  void VideoPlayingStatusReceived(bool is_playing, int callback_id);
 #endif
 
   void OnGestureEvent(ui::GestureEvent* event);
index 103ed0903c4c1e0bda412154e3e34b5345b9c487..dbff94fb27a61d39c67b2e9f36019029135c072f 100644 (file)
@@ -495,6 +495,9 @@ EWebView::~EWebView() {
   select_picker_.reset();
   context_menu_.reset();
   mhtml_callback_map_.Clear();
+#if BUILDFLAG(IS_TIZEN_TV)
+  is_video_playing_callback_map_.Clear();
+#endif
 
   compositor_observer_.reset();
 
@@ -3197,6 +3200,32 @@ void EWebView::SetTranslatedURL(const char* url) {
   rwhva()->aura_efl_helper()->SetTranslatedURL(std::string(url));
   LOG(INFO) << "translate_url:" << url;
 }
+
+bool EWebView::IsVideoPlaying(Ewk_Is_Video_Playing_Callback callback,
+                              void* user_data) {
+  IsVideoPlayingCallback* cb = new IsVideoPlayingCallback(callback, user_data);
+  int callback_id = is_video_playing_callback_map_.Add(cb);
+
+  if (!rwhva() || !rwhva()->aura_efl_helper()) {
+    LOG(ERROR) << "rwhva() or rwhva()->aura_efl_helper() is false";
+    return false;
+  }
+  rwhva()->aura_efl_helper()->RequestVideoPlaying(callback_id);
+  return true;
+}
+
+void EWebView::InvokeIsVideoPlayingCallback(bool is_playing, int callback_id) {
+  IsVideoPlayingCallback* callback =
+      is_video_playing_callback_map_.Lookup(callback_id);
+  if (!callback) {
+    LOG(INFO) << "callback is null";
+    return;
+  }
+
+  LOG(INFO) << __func__ << " ; is_playing : " << is_playing;
+  callback->Run(ewk_view(), is_playing);
+  is_video_playing_callback_map_.Remove(callback_id);
+}
 #endif
 
 void EWebView::RequestManifest(Ewk_View_Request_Manifest_Callback callback,
index 4e52d21096594938db947b765728b8f708bb46eb..bd41e7941150559bbf573e737bd746df6dc5deed 100644 (file)
@@ -316,6 +316,23 @@ class GetMediaDeviceCallback {
 };
 #endif
 
+#if BUILDFLAG(IS_TIZEN_TV)
+class IsVideoPlayingCallback {
+ public:
+  IsVideoPlayingCallback(Ewk_Is_Video_Playing_Callback func, void* user_data)
+      : func_(func), user_data_(user_data) {}
+  void Run(Evas_Object* obj, bool isplaying) {
+    if (func_) {
+      (func_)(obj, isplaying ? EINA_TRUE : EINA_FALSE, user_data_);
+    }
+  }
+
+ private:
+  Ewk_Is_Video_Playing_Callback func_;
+  void* user_data_;
+};
+#endif
+
 class WebViewAsyncRequestHitTestDataCallback;
 class JavaScriptDialogManagerEfl;
 class PermissionPopupManager;
@@ -738,6 +755,9 @@ class EWebView {
   bool EdgeScrollBy(int delta_x, int delta_y);
   void GetMousePosition(gfx::Point&);
   void InvokeEdgeScrollByCallback(const gfx::Point&, bool);
+  // notify web browser video playing status
+  bool IsVideoPlaying(Ewk_Is_Video_Playing_Callback callback, void* user_data);
+  void InvokeIsVideoPlayingCallback(bool is_playing, int callback_id);
 #endif
 
   void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
@@ -901,6 +921,10 @@ class EWebView {
       MHTMLCallbackDetails;
   base::IDMap<MHTMLCallbackDetails*> mhtml_callback_map_;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  base::IDMap<IsVideoPlayingCallback*> is_video_playing_callback_map_;
+#endif
+
   typedef WebViewCallback<Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback,
                           bool>
       MainFrameScrollbarVisibleGetCallback;
index 4302dd4c2f94fdf2435f359c10bd674f059e5278..cac6d2a681a13cde9428a379f47e0feb003f3106 100644 (file)
@@ -1715,8 +1715,15 @@ Eina_Bool ewk_view_key_system_whitelist_set(Evas_Object* ewkView, const char** l
 
 Eina_Bool ewk_view_is_video_playing(Evas_Object* o, Ewk_Is_Video_Playing_Callback callback, void* user_data)
 {
-  LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+  EWK_VIEW_IMPL_GET_OR_RETURN(o, impl, EINA_FALSE);
+  EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE);
+  LOG(INFO) << __func__;
+  return impl->IsVideoPlaying(callback, user_data) ? EINA_TRUE : EINA_FALSE;
+#else
+  LOG_EWK_API_MOCKUP("Only for Tizen TV.");
   return EINA_FALSE;
+#endif
 }
 
 Eina_Bool ewk_view_stop_video(Evas_Object* o, Ewk_Stop_Video_Callback callback, void* user_data)
index 9178c523d81fb7f076fea5512a3154fb0e407db5..54d16b74d95c366929dcb81d8b9c2a4f4e0a4828 100644 (file)
@@ -827,5 +827,21 @@ void WebContentsDelegateEfl::NotifyPlaybackState(int state,
       *drm_info = data.at(2);
   }
 }
+
+void WebContentsDelegateEfl::OnIsVideoPlayingGet(bool is_playing,
+                                                 int callback_id) {
+  if (web_view_)
+    web_view_->InvokeIsVideoPlayingCallback(is_playing, callback_id);
+  else
+    LOG(INFO) << "web_view_ is null";
+}
+
+void WebContentsDelegateEfl::VideoPlayingStatusReceived(bool is_playing,
+                                                        int callback_id) {
+  if (web_view_)
+    web_view_->InvokeIsVideoPlayingCallback(is_playing, callback_id);
+  else
+    LOG(INFO) << "web_view_ is null";
+}
 #endif
 }  // namespace content
index eda550600d9a8269e7d229b181f79bf57d692dfc..4e57012c67ed76588b42475a628b860122fd3ab9 100644 (file)
@@ -164,6 +164,7 @@ class WebContentsDelegateEfl : public WebContentsDelegate {
   using EnumerationCallback =
       base::OnceCallback<void(const MediaDeviceEnumeration&)>;
   void GetMediaDeviceList(EnumerationCallback cb);
+  void VideoPlayingStatusReceived(bool is_playing, int callback_id) override;
 #endif
 
 #if defined(TIZEN_AUTOFILL)
@@ -179,6 +180,9 @@ class WebContentsDelegateEfl : public WebContentsDelegate {
                         void* user_data,
                         const GURL& manifest_url,
                         blink::mojom::ManifestPtr manifest);
+#if BUILDFLAG(IS_TIZEN_TV)
+  void OnIsVideoPlayingGet(bool is_playing, int callback_id);
+#endif
   void OnDidChangeFocusedNodeBounds(const gfx::RectF& focused_node_bounds);
   EWebView* web_view_;
   bool is_fullscreen_ = false;