zhongbaojian 89f70d36d1 init | vor 5 Jahren | |
---|---|---|
VIMediaCache | vor 5 Jahren | |
VIMediaCacheDemo | vor 5 Jahren | |
VIMediaCacheDemo.xcodeproj | vor 5 Jahren | |
VIMediaCacheDemoTests | vor 5 Jahren | |
LICENSE | vor 5 Jahren | |
README.md | vor 5 Jahren | |
VIMediaCache.podspec | vor 5 Jahren |
Cache media file while play media using AVPlayerr.
VIMediaCache use AVAssetResourceLoader to control AVPlayer download media data.
pod 'VIMediaCache'
Objective C
NSURL *url = [NSURL URLWithString:@"https://mvvideo5.meitudata.com/571090934cea5517.mp4"];
VIResourceLoaderManager *resourceLoaderManager = [VIResourceLoaderManager new];
self.resourceLoaderManager = resourceLoaderManager;
AVPlayerItem *playerItem = [resourceLoaderManager playerItemWithURL:url];
AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem];
Swift
let url = URL(string: "https://mvvideo5.meitudata.com/571090934cea5517.mp4")
let resourceLoaderManager = VIResourceLoaderManager()
let playerItem = resourceLoaderManager.playerItem(with: url)
let player = AVPlayer(playerItem: playerItem)
vvitozhang@gmail.com
MIT