mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1657224 - add a pref to control stopping media after media reaches to the end. r=chunmin
In bug1654045, we would stop controlling media once media reaches to the end. Considering some user might still want to control media by pressing media keys even if it has ended, so adding a pref to control this abilitiy. Differential Revision: https://phabricator.services.mozilla.com/D85930
This commit is contained in:
parent
405d662683
commit
96afc7c19e
@ -5678,7 +5678,9 @@ void HTMLMediaElement::PlaybackEnded() {
|
||||
mAutoplaying = true;
|
||||
}
|
||||
|
||||
mMediaControlKeyListener->StopIfNeeded();
|
||||
if (StaticPrefs::media_mediacontrol_stopcontrol_aftermediaends()) {
|
||||
mMediaControlKeyListener->StopIfNeeded();
|
||||
}
|
||||
DispatchAsyncEvent(u"ended"_ns);
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,12 @@
|
||||
const PAGE_URL =
|
||||
"https://example.com/browser/dom/media/mediacontrol/tests/file_non_looping_media.html";
|
||||
|
||||
add_task(async function setupTestingPref() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["media.mediacontrol.stopcontrol.aftermediaends", true]],
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* This test is used to ensure that we would stop controlling media after it
|
||||
* reaches to the end.
|
||||
|
@ -7565,6 +7565,13 @@
|
||||
value: 60000
|
||||
mirror: always
|
||||
|
||||
# If this pref is on, we would stop controlling media after it reaches to the
|
||||
# end.
|
||||
- name: media.mediacontrol.stopcontrol.aftermediaends
|
||||
type: bool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# We would only use media control to control media which duration is longer
|
||||
# than this value.
|
||||
- name: media.mediacontrol.eligible.media.duration.s
|
||||
|
Loading…
Reference in New Issue
Block a user