[M120 Migration] Destroy mmplayer while video tag receive removedFrom 75/306975/2
authorzhishun.zhou <zhishun.zhou@samsung.com>
Fri, 1 Mar 2024 09:49:39 +0000 (17:49 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 4 Mar 2024 06:14:14 +0000 (06:14 +0000)
issue:when exit app, video is still on screen.
solution: when exit app, destroy the player.

Patch from:
https://review.tizen.org/gerrit/#/c/301621/

Change-Id: I1d21cba123b08ed69dc098a500a00e11486ff0bb
Signed-off-by: yangzhiwen <zw714.yang@samsung.com>
Signed-off-by: zhishun.zhou <zhishun.zhou@samsung.com>
third_party/blink/renderer/core/html/media/html_media_element.cc

index 3974d21..6c6014b 100644 (file)
@@ -4630,6 +4630,20 @@ void HTMLMediaElement::OnRemovedFromDocumentTimerFired(TimerBase*) {
   // removed from the Document.
   if (!PictureInPictureController::IsElementInPictureInPicture(this))
     PauseInternal(PlayPromiseError::kPaused_RemovedFromDocument);
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (!media_source_attachment_) {
+    LOG(INFO) << "(" << (void*)this << ")"
+              << "HTMLMediaElement::removedFrom(clear)";
+    ClearMediaPlayer();
+    network_state_ = kNetworkEmpty;
+    ready_state_ = kHaveNothing;
+    ready_state_maximum_ = kHaveNothing;
+    seeking_ = false;
+    // Clear any pending events
+    SetShouldDelayLoadEvent(false);
+    async_event_queue_->CancelAllEvents();
+  }
+#endif
 }
 
 void HTMLMediaElement::AudioSourceProviderImpl::Wrap(