现在,我的AVPlayer使用以下代码播放来自远程URL(视频文件大小为200-300KB)的视频,
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];
到目前为止,我只看到过只从远程网址播放视频或首先下载视频,然后从本地网址播放的示例。
我想开始播放来自网址的视频,正在播放,我想将其保存在本地缓存。我该怎么做?