Latest 0.0.3
Homepage https://github.com/OneMC/MResourceLoader
License MIT
Platforms ios 6.0, requires ARC
Frameworks MobileCoreServices, AVFoundation
Authors

CocoaPods

pod 'MResourceLoader'

Usage

Objective C

NSURL *url = [NSURL URLWithString:@"http://www.w3school.com.cn/example/html5/mov_bbb.mp4"];

self.loader = [MResourceLoader new]; // instance hold mresourceloader
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[MResourceScheme mrSchemeURL:url] options:nil];
[asset.resourceLoader setDelegate:self.loader queue:dispatch_get_main_queue()];

AVPlayerItem *playitem = [AVPlayerItem playerItemWithAsset:asset];
AVPlayer *player = [AVPlayer playerWithPlayerItem:playitem];
AVPlayerLayer *playLayer = [AVPlayerLayer playerLayerWithPlayer:player];
playLayer.frame = CGRectMake(50, 100, 300, 400);
playLayer.backgroundColor = [UIColor blackColor].CGColor;
[self.view.layer addSublayer:playLayer];
[player play];

Contact

[email protected]
[email protected]

License

MIT

Latest podspec

{
    "name": "MResourceLoader",
    "version": "0.0.3",
    "summary": "MResourceLoader use for AVPlayer loading resource",
    "homepage": "https://github.com/OneMC/MResourceLoader",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "MiaoChao": "[email protected]"
    },
    "source": {
        "git": "https://github.com/OneMC/MResourceLoader.git",
        "tag": "0.0.3"
    },
    "source_files": [
        "MResourceLoader",
        "MResourceLoader/**/*.{h,m}"
    ],
    "frameworks": [
        "MobileCoreServices",
        "AVFoundation"
    ],
    "requires_arc": true,
    "platforms": {
        "ios": "6.0"
    }
}

Pin It on Pinterest

Share This