0
我使用此代碼與自動佈局視圖控制器,並在另一個視圖中播放視頻稱爲videoView,但它不是全屏播放視頻。視頻觀看不是全屏在橫向模式iPhone
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:saveFileName];
NSURL *url1 = [[NSURL alloc] initFileURLWithPath: path];
videoPlayer = [AVPlayer playerWithURL:url1] ;
self.avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:videoPlayer];
avPlayerLayer.frame = self.videoView.bounds;
[self.videoView.layer addSublayer: avPlayerLayer];
[videoView setHidden:NO];
[self.videoPlayer play];
感謝reply.But我必須使用AVplayer – iTag