Skip to content

Picture-In-Picture does not open when app is backgrounded on iOS #347

Description

@paulrinaldi

Versioning & OS:
iPhone 15 Pro
iOS 17.2
"react-native-jw-media-player": "^0.2.44"

Relevant code block

<JWPlayer
  playerId={"myPlayer"}
  onLayout={this.props.onLayout}
  onTime={(event) => {
    ...
  }}
  onPlay={() => {
    ...
  }}
  onPause={() => {
     ...
   }}
  ref={p => (this.JWPlayer = p)}
  key={this.props.tag}
  style={[{flex: 1}]}
  config={{
     autostart: true,
     fullScreenOnLandscape: true,
     landscapeOnFullScreen: true,
     portraitOnExitFullScreen: true,
     exitFullScreenOnPortrait: true,
     enableLockScreenControls: false,
     backgroundAudioEnabled: true,
     playlist: [
       {
         tracks: this.getTracks(),
         file: this.props.url,
         image: getStoryImageUri(
           this.props.mediaItemImage,
           DEFAULT_CONTENT_IMAGE
         ),
       }
     ],
    license: Platform.select({ios: "...", android: "..."})
  }}
  pipEnabled={true}
/>

Steps to Reproduce:
Load JW Player with a video url and press play.
Screenshot 2024-03-08 at 2 46 24 PM
Press home button on iPhone.

Actual:
The home screen is visible.
Screenshot 2024-03-08 at 2 46 45 PM

Expected:
The home screen is visible. A small window of the video still present and playing.

Would this be because iPhone 15 Pro doesn't support PiP? [Edit: I doubt this is the case, due to reddit discussion]

Or perhaps more likely, PiP is disabled somehow as the docs point out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions