YoutubeKit icon indicating copy to clipboard operation
YoutubeKit copied to clipboard

Looping does not respect start and end time

Open lehelmedves opened this issue 5 years ago • 4 comments

If I play a video with a set startTime, endTime and looping enabled, the startTime and endTime is respected the first time, but when the video is played for the second time (looping engaged), it starts from 0.0 and plays to the end of the video. Is this an issue in the library or within the Youtube JS API?

lehelmedves avatar Oct 29 '18 08:10 lehelmedves

I am noting it respects the end timestamp but not the start. It fires off here in YTSwiftyPlayer line288: case .onStateChange: updateState(message.body as? Int) let isLoop = playerVars["loop"] as? String == "1" if playerState == .ended && isLoop { playVideo() } delegate?.player(self, didChangeState: playerState)

wdcurry avatar Jan 08 '19 02:01 wdcurry

@lehelmedves Thank you for your report. I think this is a bug on YoutubeKit, So i'll check and fix it on next release.

rinov avatar Jan 08 '19 04:01 rinov

Thank you. If you could post an idea of the fix, we can implement it on our side as well. I will check it out myself as time permits but of course with any new repo, it can take time to walk new code ;)

wdcurry avatar Jan 08 '19 11:01 wdcurry

Looping also manifests an oddness if .playsInline(false) is set. A more zoomed view seems to present.

wdcurry avatar Jan 08 '19 21:01 wdcurry