Skip to content

Cache media file while play media using AVPlayer

License

Notifications You must be signed in to change notification settings

Wenxixx/VIMediaCache

 
 

Repository files navigation

VIMediaCache

Cache media file while play media using AVPlayerr.

VIMediaCache use AVAssetResourceLoader to control AVPlayer download media data, then manage cache data using NSURLProtocol.

CocoaPods

pod 'VIMediaCache'

Usage

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];

Contact

vvitozhang@gmail.com

License

MIT

About

Cache media file while play media using AVPlayer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 99.1%
  • Ruby 0.9%