зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1621166 - part2 : do not stop media control for media being used in PIP mode. r=MeFisto94
The media element being used in the PIP mode would always display on the screen even if the the tab it belongs to is in the background, so users would have high chance to interact with it again. Therefore, we don't want to start a stop-timer to cancel media control for that element. Differential Revision: https://phabricator.services.mozilla.com/D67381 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
86fbf04461
Коммит
7db6ce8171
|
@ -7763,6 +7763,20 @@ void HTMLMediaElement::CreateStopMediaControlTimerIfNeeded() {
|
||||||
!mMediaControlEventListener->IsStarted()) {
|
!mMediaControlEventListener->IsStarted()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// As the media element being used in the PIP mode would always display on the
|
||||||
|
// screen, users would have high chance to interact with it again, so we don't
|
||||||
|
// want to stop media control.
|
||||||
|
if (IsBeingUsedInPictureInPictureMode()) {
|
||||||
|
MEDIACONTROL_LOG("No need to create a timer for PIP video.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Paused()) {
|
||||||
|
MEDIACONTROL_LOG("No need to create a timer for playing media.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MEDIACONTROL_LOG("Start stop media control timer");
|
MEDIACONTROL_LOG("Start stop media control timer");
|
||||||
NS_NewTimerWithFuncCallback(
|
NS_NewTimerWithFuncCallback(
|
||||||
getter_AddRefs(mStopMediaControlTimer), StopMediaControlTimerCallback,
|
getter_AddRefs(mStopMediaControlTimer), StopMediaControlTimerCallback,
|
||||||
|
|
|
@ -582,6 +582,8 @@ void HTMLVideoElement::EndCloningVisually() {
|
||||||
Unused << mVisualCloneTarget->SetVisualCloneSource(nullptr);
|
Unused << mVisualCloneTarget->SetVisualCloneSource(nullptr);
|
||||||
Unused << SetVisualCloneTarget(nullptr);
|
Unused << SetVisualCloneTarget(nullptr);
|
||||||
|
|
||||||
|
CreateStopMediaControlTimerIfNeeded();
|
||||||
|
|
||||||
if (IsInComposedDoc() && !StaticPrefs::media_cloneElementVisually_testing()) {
|
if (IsInComposedDoc() && !StaticPrefs::media_cloneElementVisually_testing()) {
|
||||||
NotifyUAWidgetSetupOrChange();
|
NotifyUAWidgetSetupOrChange();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче