Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting iOS 5 AVPlayer to display the last frame of the video when playback completes instead of a black screen

I am making some modifications to an iPad app written by somebody else and one of the things I need to fix is that the video needs to continue to show the last frame when playback is complete rather than the screen just going black.

On the iPad simulator using iOS 4.3, this is exactly what it does already, but it just goes black on iOS 5 (on both the simulator and a device).

Any suggestions on the best way to achieve this so that it works for iOS 5? The code is using AVQueuePlayer.

like image 677
Dan Dyer Avatar asked Jan 17 '23 17:01

Dan Dyer


1 Answers

I eventually found the solution:

[player setActionAtItemEnd:AVPlayerActionAtItemEndPause];

I'd already tried this and discarded it as not working, but I think I made the mistake of not setting it via the setter.

like image 60
Dan Dyer Avatar answered Apr 08 '23 15:04

Dan Dyer