I have a UIView which contains an AVPlayer to show a video. When changing orientation, I need to change the size and location of the video.
Actually you shouldn't add AVPlayer's layer as a sublayer. Instead of that you should use the following method, in the subclass of view in which you want to display AVPlayer.
+ (Class)layerClass
{
return [AVPlayerLayer class];
}
And use the following line to add(set) the player layer.
[(AVPlayerLayer *)self.layer setPlayer:self.avPlayer];
Hope it helps;-)