[M120 Migration] Don't report metadata when HBBTV capi 92/311792/4
authoryangzw <zw714.yang@samsung.com>
Tue, 28 May 2024 03:20:53 +0000 (11:20 +0800)
committerBot Blink <blinkbot@samsung.com>
Fri, 31 May 2024 03:09:01 +0000 (03:09 +0000)
when pipeline_impl call OnMetadata, HBBTV capi don't get the meta data,
so don't report metadata event when case is HBBTV capi.

ref:
12031324

Change-Id: I1d11be8ca4be9175f14770d173fce7f73b4a0a38
Signed-off-by: yangzw <zw714.yang@samsung.com>
third_party/blink/renderer/platform/media/web_media_player_impl.cc
third_party/blink/renderer/platform/media/web_media_player_impl.h

index 9fbde4a494de62121dc6de26f4af0a09e3c91a4e..647f0c3c9b0b7a7ffecbb8113fbb7c2a10532a79 100644 (file)
@@ -2154,7 +2154,17 @@ void WebMediaPlayerImpl::OnMetadata(const media::PipelineMetadata& metadata) {
   // Play(), Pause(), etc) so do it last to avoid unexpected states during the
   // calls. An exception to this is UpdatePlayState(), which is safe to call and
   // needs to use the new ReadyState in its calculations.
-  SetReadyState(WebMediaPlayer::kReadyStateHaveMetadata);
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (hbbtv_type_ == media::MediaResource::Type::KUrl && content::IsHbbTV()) {
+    // when hbbtv and capi, will delay report loadedmetadata event to make sure
+    // hbbtv ligada case pass.
+    LOG(INFO) << "when hbbtv and capi, delay report event. after get MM data "
+                 "will report.";
+  } else
+#endif
+  {
+    SetReadyState(WebMediaPlayer::kReadyStateHaveMetadata);
+  }
   UpdatePlayState();
 }
 
@@ -3311,6 +3321,10 @@ media::PipelineStatus WebMediaPlayerImpl::OnDemuxerCreated(
     attempting_suspended_start_ = true;
   }
 #if BUILDFLAG(IS_TIZEN_TV)
+  // in order to filter hbbtv and capi to delay report
+  // loadedmetadata event.
+  hbbtv_type_ = demuxer->GetType();
+
   blink::WebString content_mime_type =
       blink::WebString(client_->GetContentMIMEType());
   pipeline_controller_->SetContentMimeType(content_mime_type.Utf8());
index bb88d9dde5a65c90201de119294c62fcc10afc91..1009be0e5d0b24daa65d750968912abfa1b7f977 100644 (file)
@@ -1201,6 +1201,12 @@ class PLATFORM_EXPORT WebMediaPlayerImpl
   base::RepeatingTimer layer_bound_update_timer_;
 #endif
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  // when demuxer_override_ != null, then record demuxer_override_ type.
+  // to make sure filter hbbtv and capi.
+  media::MediaResource::Type hbbtv_type_;
+#endif
+
   std::unique_ptr<PowerStatusHelper> power_status_helper_;
 
   // Created while playing, deleted otherwise.