Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yiplee/ypavassetresourceloader

A lightweight AVAssetResourceLoaderDelegate implementation.
https://github.com/yiplee/ypavassetresourceloader

avassetresourceloaderdelegate

Last synced: about 6 hours ago
JSON representation

A lightweight AVAssetResourceLoaderDelegate implementation.

Awesome Lists containing this project

README

        

# YPAVAssetResourceLoader

[![CI Status](http://img.shields.io/travis/yiplee/YPAVAssetResourceLoader.svg?style=flat)](https://travis-ci.org/yiplee/YPAVAssetResourceLoader)
[![Version](https://img.shields.io/cocoapods/v/YPAVAssetResourceLoader.svg?style=flat)](http://cocoapods.org/pods/YPAVAssetResourceLoader)
[![License](https://img.shields.io/cocoapods/l/YPAVAssetResourceLoader.svg?style=flat)](http://cocoapods.org/pods/YPAVAssetResourceLoader)
[![Platform](https://img.shields.io/cocoapods/p/YPAVAssetResourceLoader.svg?style=flat)](http://cocoapods.org/pods/YPAVAssetResourceLoader)

```YPAVAssetResourceLoader``` A lightweight AVAssetResourceLoaderDelegate implementation for short streaming media.
It will cache all receiving data when playing and reuse the data next time.

- [x] cache media data
- [ ] seek support (todo)

## Requirements

Xcode 9 & iOS 8

## Installation

YPAVAssetResourceLoader is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'YPAVAssetResourceLoader'
```

## Usage

```objc
#import

NSURL *url = [NSURL URLWithString:@"http://www.yiplee.com/example.mp4"];
AVAsset *asset = [AVURLAsset assetWithYPResourceURL:url];
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];
```

An ```YPAVPlayerResourceLoader``` instance is not designed to power mutiple asset URLs at the same time.

Always create new ```YPAVPlayerResourceLoader``` when needed.

## License

YPAVAssetResourceLoader is available under the MIT license. See the LICENSE file for more info.