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];