Closed dylanjha closed 2 years ago
Are there any updates with this issue? This bug is absolutely killing me
@henryjeff not that I have heard. I'm eager to get this fixed too
The issue here appears to be that the iOS implementation uses a different approach to seeking when the player is scrubbed with the progress bar. The function passed as onVideoSeek
is only called when seek
is invoked on the ref, and not internally, and therefore the event is never fired. It does, however, get fired when you programmatically seek.
Did a little looking around, and there's really not a good way to detect when the player is being scrubbed (neither AVPlayer nor AVPlayerViewController fire any related events, and the "scrubbing" state isn't explicitly exposed at all). The best option I've found is what's suggested in this SO thread, which is a pretty heavy-handed workaround and still seems kind of brittle to me.
@garrottkai thanks! Ya I'm not surprised. We (mux.com) have a quality-of-service product as part of our Mux Data offering and with that we have an AVPlayer SDK that tracks everything around video performance on the playback side (including seeking).
The way we do it is by keeping track of the playhead time. While taking into consideration re-buffering events, pause events, we can see if the playhead time jumps forward or backwards in time relative to elapsed wallclock.
Bug
onSeek
event is not firingPlatform
Which player are you experiencing the problem on:
Environment info
React native info output:
Library version: x.x.x
Steps To Reproduce
onSeek
callback to theVideo
element. See thatonSeek
does not get called when running on iOS app (it does get called when running on Android ) ...Expected behaviour
onSeek
should be called on iOS. In this exampledebug onSeek
should be printed to the logs like it is on the Android app.Reproducible sample code
Video sample
If possible, include a link to the video that has the problem that can be streamed or downloaded from.