I am currently developing a video player for streaming content using the AVPlayer Framework. I came across an AVPlayerLayer VideoGravity String-Property, which would allow me to set the scaling / resizing mode of the players to different values.
To provide the user with the zoom features known from the default player, I have configured a method that will 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 Simulator, but somehow not on my iPad 2 with iOS 5.0.1 installed.
Has anyone encountered similar problems? Is this a known iOS bug with 5.0.1? Is there a better way to implement scaling / resizing using AVPlayerLayer?
Any ideas / tips / help and recommendations are greatly appreciated,
Thanks,
Sam
ios objective-c avplayer
samsam
source share