Bug 1655204 - part3 : start listening to media control keys once media starts again. r=chunmin

For media which has been stopped via media key `Stop`, we should start controlling it if it starts playing again.

Differential Revision: https://phabricator.services.mozilla.com/D85102
This commit is contained in:
alwu
2020-07-29 22:15:54 +00:00
parent bdfb4e4873
commit ff1ca2df82

View File

@@ -4489,6 +4489,7 @@ void HTMLMediaElement::PlayInternal(bool aHandlingUserInput) {
AddRemoveSelfReference();
UpdatePreloadAction();
UpdateSrcMediaStreamPlaying();
StartMediaControlKeyListenerIfNeeded();
// Once play() has been called in a user generated event handler,
// it is allowed to autoplay. Note: we can reach here when not in
@@ -6216,6 +6217,7 @@ void HTMLMediaElement::CheckAutoplayDataReady() {
AddRemoveSelfReference();
UpdateSrcMediaStreamPlaying();
UpdateAudioChannelPlayingState();
StartMediaControlKeyListenerIfNeeded();
if (mDecoder) {
SetPlayedOrSeeked(true);