iOS 关于相机胶卷,视频库,app内部中的视频播放方法
来源:未知 责任编辑:责任编辑 发表时间:2014-01-25 11:34 点击:次
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];
相关新闻>>
- 发表评论
-
- 最新评论 更多>>