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

iOS 11 repeat with m3u8 video repeats only once #831

Closed
jalieven opened this issue Oct 24, 2017 · 7 comments
Closed

iOS 11 repeat with m3u8 video repeats only once #831

jalieven opened this issue Oct 24, 2017 · 7 comments
Labels
stale Closed due to inactivity or lack or resources

Comments

@jalieven
Copy link
Contributor

We observed the fact that our videos are only looping once after which they are stuck on the last frame on iOS 11. While we encountered no problems of the sort in lower iOS versions. Looking at the code it all boils down to the AVPlayerItemDidPlayToEndTimeNotification observer not getting called after the first repeat. While the _repeat variable doesn't change and the removeFromSuperView nor the dealloc methods get called while looping (these methods remove the AVPlayerItemDidPlayToEndTimeNotification observer). So I am quite baffled on how it is that this observer isn't getting called after the first loop. So to be clear: the AVPlayerItemDidPlayToEndTimeNotification observer method is called once after which the video stops and doesn't get repeated. Also worth noting is that this only occurs with m3u8 videos. Our mp4 variants work fine.

@itaydressler
Copy link

Same here. iOS 11, m3u8, repeats only once.

@ftuckey-chwy
Copy link

Same here.

@JonChristensen
Copy link

@jalieven have you been able to find a work around for this? We're currently pretty badly stuck on it.

@jalieven
Copy link
Contributor Author

jalieven commented Dec 6, 2017

@JonChristensen No progress from my part. Not sure when I could look into this and try to work around the problem.

@jalieven
Copy link
Contributor Author

jalieven commented Jan 9, 2018

FWIW There appears to exist another way to loop video with AVPlayer:

playerLayer = AVPlayerLayer(player: player)
playerItem = AVPLayerItem(url: videoURL)
playerLooper = AVPlayerLooper(player: player, templateItem: playerItem)
player.play()

I haven't tried to integrate this into the react-native-video though. Don't know if this fixes the problem for hls video on iOS 11.
Another possible (less optimal) workaround would be to obtain the length of the movie on the first succesful complete run of the video and on the second run monitor the progress and act accordingly. This can prolly be done in the sendProgressUpdate method of RCTVideo.m.

@zachrnolan
Copy link
Contributor

Running into the same issue. If anyone has a workaround, please let me know.

RN 0.54.1
react-native-video 2.0.0

@SheldonWangRJT
Copy link

Is this solved in react-community?

I am seeing the same behavior on native iOS 12.2.

I do have a work around, which is to observe the current playing time of the playerItem, once it reaches the end, call reply function.

@hueniverse hueniverse added the stale Closed due to inactivity or lack or resources label Apr 22, 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

7 participants