iOS 关于相机胶卷,视频库,app内部中的视频播放方法

1.iOS 关于相机胶卷,视频库

Apple suggests:

Uses AVPlayer to play videos from the iPod Library, Camera Roll, or via iTunes File Sharing. Also displays metadata.

可以参考官方的AVPlayerDemo。


2. 播放app本地的视频文件。

Code:

NSString *path = [[NSBundle mainBundle] pathForResource:@"testvideo" ofType:@"mov"];

#if 1

    _playView = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]];

    _playView.view.frame = self.view.bounds;

    _playView.movieSourceType = MPMovieSourceTypeFile;

    [_playView prepareToPlay];


// todo

// resolve the notification

//

    [self.view addSubview:_playView.view];

    [_playView play];

你可能感兴趣的:(ios,视频,Objective-C,avplayer)