Iphone 同时玩,;保存电影
现在我的AVPlayer使用以下代码从远程URL播放视频(视频文件大小为200-300KB)Iphone 同时玩,;保存电影,iphone,ios,objective-c,cocoa-touch,avplayer,Iphone,Ios,Objective C,Cocoa Touch,Avplayer,现在我的AVPlayer使用以下代码从远程URL播放视频(视频文件大小为200-300KB) AVURLAsset *asset = [AVURLAsset URLAssetWithURL:someURL options:nil]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset]; cell.player = [AVPlayer playerWithPlayer
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:someURL options:nil];
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];
cell.player = [AVPlayer playerWithPlayerItem:playerItem];
AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:cell.player];
cell.player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
layer.frame = someFrame;
[cell.layer addSublayer: layer];
到目前为止,我只看到一些示例,其中视频仅从远程URL播放,或者先下载,然后从本地URL播放
我想从URL开始播放视频,在播放时,我想将其本地保存到缓存中。我如何做到这一点?我也在努力为用户节省一些带宽,你找到解决方案了吗?不幸的是,没有,我不得不先下载视频,下载后再播放。如果你能同时找到一种方法,请告诉我。我已经尝试了所有我能找到的方法,希望至少有一个答案可能适用于iOS 7.1,但没有成功。如果您尝试改用Avassetrader,您将得到一个更详细的错误,而不是未知的错误。