Bug 1543680 - Set playbackState as playing when entering in PiP mode; r=JanH

playbackState's default value is PlaybackState.STOPPED.
We can only enter PiP mode if media is playing but we don't save this playing
state.
If the user hasn't done anything to change this, like pause-play, when we check
the playbackState in BrowserApp to know to force fullscreen if still playing
we will not do so because the state is PlaybackState.STOPPED.

Differential Revision: https://phabricator.services.mozilla.com/D27935

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Petru Lingurar 2019-04-17 17:00:00 +00:00
parent b4188e9463
commit e732102628

View File

@ -53,6 +53,7 @@ public class PictureInPictureController implements BundleEventListener {
public void tryEnteringPictureInPictureMode() throws IllegalStateException {
if (shouldTryPipMode() &&
pipActivity.enterPictureInPictureMode(getPipParams(isMediaPlayingForCurrentTab()))) {
playbackState = PlaybackState.PLAYING;
EventDispatcher.getInstance().registerUiThreadListener(this, "MediaControlService:MediaPlayingStatus");
isInPipMode = true;
}