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

Fixes #963 #974

Merged
merged 1 commit into from
Jun 4, 2018
Merged

Fixes #963 #974

merged 1 commit into from
Jun 4, 2018

Conversation

wildseansy
Copy link
Contributor

@wildseansy wildseansy commented Mar 19, 2018

Fixes #963
Bug happens when uri is changed for a video that is already rendered. This is because [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath] is called twice because the _playerItemObserversSet variable isn't properly set in sequence.

The fix:

Remove player layer before addPlayerItemObservers so _playerItemObserversSet is still set to NO if observers have already been removed.

@masarusanjp
Copy link
Contributor

Thanks for fixing!

Could you please remove these lines too?

https://github.com/wildseansy/react-native-video/blob/bfa2969c5f8a295b4abb060b59e8b585580a3d96/ios/RCTVideo.m#L255-L257

I think these lines are no longer needed by this pr.

Bug happens when uri is changed for a video.

The fix:
Remove player layer before addPlayerItemObservers so _playerItemObserversSet is still set to NO if observers have already been removed.
@wildseansy
Copy link
Contributor Author

@masarusanjp - updated. Also re-ordered these lines so removePlayerItemObservers consistently comes after removePlayerLayer

@cobarx cobarx merged commit 761549c into TheWidlarzGroup:master Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashed(ios): to call setSrc twice
3 participants