Created
June 12, 2017 21:35
-
-
Save juliofruta/741e49f728c47df161ecf9c31b4c4587 to your computer and use it in GitHub Desktop.
How to reproduce assets at the same time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:url options:nil]; | |
NSArray *keys = [NSArray arrayWithObject:@"playable"]; | |
//Carga los assets | |
[asset loadValuesAsynchronouslyForKeys:keys completionHandler:^() | |
{ | |
//Al terminar reproducelos en la cola principal | |
dispatch_async(dispatch_get_main_queue(), ^ | |
{ | |
AVPlayerItem *playerItem = [[[AVPlayerItem alloc] initWithAsset:asset] autorelease]; | |
[player insertItem:playerItem afterItem:nil]; | |
}); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment