Bug 1543680 - Set playbackState as playing when entering in PiP mode; r=JanH
authorPetru Lingurar <petru.lingurar@softvision.ro>
Wed, 17 Apr 2019 17:00:00 +0000
changeset 470061 db411f941b862836f10050c056b8e55c3fd2f4e2
parent 470060 448a0265509b6f1f75863f820a03a88efa72d7fb
child 470062 b6b08e336e6f236189da007f79b6dcd4f3521b5e
push id112843
push useraiakab@mozilla.com
push dateFri, 19 Apr 2019 09:50:22 +0000
treeherdermozilla-inbound@c06f27cbfe40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJanH
bugs1543680
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
mobile/android/base/java/org/mozilla/gecko/media/PictureInPictureController.java
--- a/mobile/android/base/java/org/mozilla/gecko/media/PictureInPictureController.java
+++ b/mobile/android/base/java/org/mozilla/gecko/media/PictureInPictureController.java
@@ -48,16 +48,17 @@ public class PictureInPictureController 
     /**
      * If the feature is supported and media is playing in fullscreen will try to activate
      * Picture In Picture mode for the current activity.
      * @throws IllegalStateException if entering Picture In Picture mode was not possible.
      */
     public void tryEnteringPictureInPictureMode() throws IllegalStateException {
         if (shouldTryPipMode() &&
                 pipActivity.enterPictureInPictureMode(getPipParams(isMediaPlayingForCurrentTab()))) {
+            playbackState = PlaybackState.PLAYING;
             EventDispatcher.getInstance().registerUiThreadListener(this, "MediaControlService:MediaPlayingStatus");
             isInPipMode = true;
         }
     }
 
     public void cleanResources() {
         if (isInPipMode) {
             EventDispatcher.getInstance().unregisterUiThreadListener(this, "MediaControlService:MediaPlayingStatus");