Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture in Picture (PIP) callbacks don't fire on restoration from a full-screen PIP #2278

Closed
jcarioti opened this issue Feb 4, 2021 · 3 comments
Labels
stale Closed due to inactivity or lack or resources

Comments

@jcarioti
Copy link

jcarioti commented Feb 4, 2021

Bug

When launching picture in picture in iOS, there are two modes: PIP mode directly from the current viewer, and fullscreen PIP mode where you launch into fullscreen, and then press the PIP button from there.

I've noticed some different functionality between the two:

  1. in fullscreen PIP mode, both videos play: the PIP as well as the original video frame.
  2. in pure PIP mode, only the PIP plays while the original video frame shows a message about PIP
  3. in pure PIP mode, the onPictureInPictureStatusChanged callback fires appropriately
  4. in fullscreen PIP mode, the callback never fires either on PIP start or PIP end.

I noticed someone saw this before the feature went in here: #1325 (comment)

Platform

Which player are you experiencing the problem on:

  • iOS

Environment info

React native info output:

System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 719.15 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.18.2/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 23, 28, 29
      Build Tools: 28.0.3, 29.0.2, 29.0.3
      System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.3/12C33 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_232 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 5.1.1

Steps To Reproduce

  1. Play an HLS stream
  2. Enter fullscreen
  3. Enter PIP mode from fullscreen
  4. Restore PIP to app

Expected behaviour

  1. The onPictureInPictureStatusChanged callbacks fire as the PIP starts and ends from the context of the fullscreen viewer

Reproducible sample code

 <Video
          source={{ uri: 'someHlsStream.m3u8' }}
          muted
          fullscreen
          playInBackground
          ignoreSilentSwitch="ignore"
          onPictureInPictureStatusChanged={({ isActive }) => {
            console.log('PIP is', isActive );
          }}
          onRestoreUserInterfaceForPictureInPictureStop={() => {
            console.log('on restore from PIP');
            videoRef.current?.restoreUserInterfaceForPictureInPictureStopCompleted(true);
          }}
          onFullscreenPlayerWillDismiss={() => {
            console.log('player dismissing')
          }}
          onFullscreenPlayerDidDismiss={() => {
            console.log('player dismissed');
          }}
        />

Video sample

Any HLS m3u8 stream.

@jcarioti jcarioti changed the title Picture in Picture (PIP) callbacks don't fire from restoration from a full-screen PIP Picture in Picture (PIP) callbacks don't fire onrestoration from a full-screen PIP Feb 4, 2021
@jcarioti jcarioti changed the title Picture in Picture (PIP) callbacks don't fire onrestoration from a full-screen PIP Picture in Picture (PIP) callbacks don't fire on restoration from a full-screen PIP Feb 4, 2021
@fielddaychurch
Copy link

I am running into the exact same issue. (watching)

@megabayt
Copy link

Same issue.
Steps to reproduce:

  1. Enter fullscreen
  2. Go to home screen or press PiP icon
  3. It should fire onPictureInPictureStatusChanged event

When you manually change pictureInPicture property event is fired.

@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are having a similar problem, please open a new issue and reference this one instead of commenting on a stale or closed issue.

@stale stale bot added the stale Closed due to inactivity or lack or resources label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests

4 participants