War*_*ior 15 iphone caching mpmovieplayercontroller mpmovieplayer
我正在开发一个iPhone应用程序,我将URL中的流视频直接存储到本地缓存中,现在我需要在缓存中下载时在电影播放器中播放视频.我关注了这个http://lists.apple.com/archives/cocoa-dev/2011/Jun/msg00844.html,但我无法做到.我可以在缓存中下载视频但我无法从缓存中播放视频.那么下载时怎么玩?
只需将您的网址更改为本地路径网址...
试试这个代码...
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"Movie" ofType:@"m4v"];
NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5724 次 |
最近记录: |