gpt4 book ai didi

iphone - 以编程方式播放 iPhone 缓存中的视频

转载 作者:行者123 更新时间:2023-12-03 18:23:38 24 4
gpt4 key购买 nike

我正在开发一个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];

关于iphone - 以编程方式播放 iPhone 缓存中的视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7402579/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com