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

PictureInPicture not work after source uri change #2916

Closed
MaxJadav opened this issue Nov 8, 2022 · 4 comments
Closed

PictureInPicture not work after source uri change #2916

MaxJadav opened this issue Nov 8, 2022 · 4 comments
Labels
Platform: iOS stale Closed due to inactivity or lack or resources triage needed Help needed to confirm the issue

Comments

@MaxJadav
Copy link

MaxJadav commented Nov 8, 2022

Bug

-Video not playing in background after chang props.

Platform

  • iOS 14.4 real device

Environment info

"react-native": "0.67.2"
"react-native-video": "^5.2.1"

Library version: 5.2.1

Steps To Reproduce

1.Play video with uri1, goto background, pipvideo is visible.
2.Open app again. on next change uri2
3.uri2 video is playing, Goto background, pipvideo not display.

Expected behaviour

1.On video uri change
2.Goto background pipvideo should be display.

Reproducible sample code

<Video
ref={videoRef}
paused={false}
source={{
uri: props.videoUrl,
}}
controls
pictureInPicture
resizeMode="contain"
onLoad={meta => console.log(meta)}
style={{
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
}}
/>

Seems like issue in RCTVideo.m
When this setSrc call second time:
(void)setSrc:(NSDictionary *)source -> removePlayerLayer but not remove refrence _pipController.

In this function delegate not set with updated _playerLayer

- (void)setupPipController {
  if (!_pipController && _playerLayer && [AVPictureInPictureController isPictureInPictureSupported]) {
    // Create new controller passing reference to the AVPlayerLayer
    _pipController = [[AVPictureInPictureController alloc] initWithPlayerLayer:_playerLayer];
    _pipController.delegate = self;
  }
}
@freeboub
Copy link
Collaborator

freeboub commented Nov 19, 2022

Seems duplicated of #2746

@freeboub freeboub added Platform: iOS triage needed Help needed to confirm the issue labels Nov 19, 2022
Copy link

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

@github-actions github-actions bot added the stale Closed due to inactivity or lack or resources label Oct 26, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@freeboub
Copy link
Collaborator

should be tested with: #3385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS stale Closed due to inactivity or lack or resources triage needed Help needed to confirm the issue
Projects
None yet
Development

No branches or pull requests

2 participants