зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1804770 - add a pref to control video wakelock. r=azebrowski
Differential Revision: https://phabricator.services.mozilla.com/D165324
This commit is contained in:
Родитель
20bc7ced74
Коммит
c74a2f66c2
|
@ -402,15 +402,21 @@ void HTMLVideoElement::UpdateWakeLock() {
|
|||
}
|
||||
|
||||
bool HTMLVideoElement::ShouldCreateVideoWakeLock() const {
|
||||
// Only request wake lock for video with audio or video from media stream,
|
||||
// because non-stream video without audio is often used as a background image.
|
||||
if (!StaticPrefs::media_video_wakelock()) {
|
||||
return false;
|
||||
}
|
||||
// Only request wake lock for video with audio or video from media
|
||||
// stream, because non-stream video without audio is often used as a
|
||||
// background image.
|
||||
//
|
||||
// Some web conferencing sites route audio outside the video element, and
|
||||
// would not be detected unless we check for media stream, so do that below.
|
||||
// Some web conferencing sites route audio outside the video element,
|
||||
// and would not be detected unless we check for media stream, so do
|
||||
// that below.
|
||||
//
|
||||
// Media streams generally aren't used as background images, though if they
|
||||
// were we'd get false positives. If this is an issue, we could check for
|
||||
// media stream AND document has audio playing (but that was tricky to do).
|
||||
// Media streams generally aren't used as background images, though if
|
||||
// they were we'd get false positives. If this is an issue, we could
|
||||
// check for media stream AND document has audio playing (but that was
|
||||
// tricky to do).
|
||||
return HasVideo() && (mSrcStream || HasAudio());
|
||||
}
|
||||
|
||||
|
|
|
@ -10659,6 +10659,10 @@
|
|||
#endif
|
||||
mirror: always
|
||||
|
||||
- name: media.video-wakelock
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Prefs starting with "midi."
|
||||
|
|
Загрузка…
Ссылка в новой задаче