AVPlayer seeking to a different point after app resume

Posted by CGuess on Stack Overflow See other posts from Stack Overflow or by CGuess
Published on 2013-11-12T21:51:06Z Indexed on 2013/11/12 21:52 UTC
Read the original article Hit count: 313

Filed under:
|
|

I have an AVPlayer, the video in it is ~2 seconds long. After the video plays, if the app goes to the background and reenters the foreground I need the video to still be shown exactly as it was when the app was exited.

The AVPlayer sticks around just fine, however when I reenter the app from the background the video appears to be seeked to the middle of the video. However, if I just play the video, it starts from the beginning, so it doesn't seem like it actually seeked and is just showing a preview image.

I've tried to auto-seek the video to the end on relaunch but nothing happens . Nothing I can figure out or find in the docs would describe this behavior.

Any tips on having the video launch either at the beginning or end?

© Stack Overflow or respective owner

Related posts about ios

Related posts about avfoundation