Bug 1654277 - part2 : pause playing media but stop already paused media when receiving 'pause'. r=chunmin

We want to modify our current behavior from "resuming all media" to "resuming latest paused media" when pressing `play` media key.

The reason of doing that is because that give us better user experience, espeically on Facebook. Chrome has been taking this approach, so we want to follow this strategy. The test in D84879 can help to understand this scenario.

Differential Revision: https://phabricator.services.mozilla.com/D85118
This commit is contained in:
alwu
2020-07-30 04:01:08 +00:00
parent 3c031374cf
commit 3927087eb5
3 changed files with 38 additions and 1 deletions

View File

@@ -449,6 +449,10 @@ class HTMLMediaElement::MediaControlKeyListener final
bool IsStarted() const { return mState != MediaPlaybackState::eStopped; }
bool IsPlaying() const override {
return Owner() ? !Owner()->Paused() : false;
}
/**
* Following methods should only be used after starting listener.
*/