视频缓存

zhongbaojian 89f70d36d1 init 5 سال پیش
VIMediaCache 89f70d36d1 init 5 سال پیش
VIMediaCacheDemo 89f70d36d1 init 5 سال پیش
VIMediaCacheDemo.xcodeproj 89f70d36d1 init 5 سال پیش
VIMediaCacheDemoTests 89f70d36d1 init 5 سال پیش
LICENSE 89f70d36d1 init 5 سال پیش
README.md 89f70d36d1 init 5 سال پیش
VIMediaCache.podspec 89f70d36d1 init 5 سال پیش

README.md

VIMediaCache

中文说明

Cache media file while play media using AVPlayerr.

VIMediaCache use AVAssetResourceLoader to control AVPlayer download media data.

CocoaPods

pod 'VIMediaCache'

Usage

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)

Contact

vvitozhang@gmail.com

License

MIT