I'm currently developing a video player for streamed-content using the AVPlayer Framework. I stumbled across the AVPlayerLayer's VideoGravity String-Property which would allow me to set the players Scaling/Resizing Mode to different values.
In order to provide the user with the scaling-features known from the default player, I've set up a method that would execute the following code:
AVPlayerLayer *layer = (AVPlayerLayer *)[self.videoContainer layer];
if([layer.videoGravity isEqualToString:AVLayerVideoGravityResizeAspect])
layer.videoGravity = AVLayerVideoGravityResizeAspectFill;
else
layer.videoGravity = AVLayerVideoGravityResizeAspect;
This works very well in the Simulator, but somehow not on my iPad 2 with iOS 5.0.1 installed.
Has anyone experienced similar issues? Is this a known iOS Bug with 5.0.1? Is there a better approach of implementing scaling / resizing with AVPlayerLayer?
Any ideas/tips/help and recommendations are greatly appreciated,
Thanks,
Sam