ios – Avplayer 403 error after reinitiation the url


Initially I’ll clarify my situation:

I’ve a participant that performs a stay url and I substitute it on person motion with one other url that could be a 30″ video url and I additionally added observers for AVPlayerItemDidPlayToEndTime to catch when the video will finish so I return to my unique url.

The issue happens after I return to my first url after the top of the interrupted url, BUT this is one other bizarre factor right here if I shut the interrupted url earlier than it reaches the top so the observer won’t ever been referred to as the primary url performs because it ought to.

This occurs solely with particular urls, possibly as a result of one thing is caching? that is why the error is 403, I am unsure.

Issues that I attempted:

I add and take away observers earlier than any video begins (I additionally tried to not take away the observer)

I name this after eradicating observer

playerItem?.asset.cancelLoading()
playerItem = nil
participant?.replaceCurrentItem(with: nil)
participant = nil

If I shut the entire stream so the PlayerView that holds avplayer name deinit after which begin it once more the url performs once more.

If you’d like any extra code please ask for it within the feedback
Thanks upfront

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles