I have a problem using AVURLAsset.
NSString * const kContentURL = @
"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8";
...
NSURL *contentURL = [NSURL URLWithString:kContentURL];
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:contentURL
options:nil];
[asset loadValuesAsynchronouslyForKeys:[NSArray arrayWithObject:tracksKey]
completionHandler:^{
...
NSError *error = nil;
AVKeyValueStatus status = [asset statusOfValueForKey:tracksKey
error:&error];
...
}
In the completion block, the status is AVKeyValueStatusFailed and the error message is "Cannot Open". All exemples I have seen, use a local file, so maybe there is a problem using a remote file...
Regards, Quentin
You can't directly create an
AVURLAsset
for an HTTP Live stream as stated in Apple's AV Foundation Programming Guide. You'll have to create anAVPlayerItem
with the stream url and instantiate an AVPlayer with itIf you need to have access to the
AVURLAsset
behind that you could follow these steps.Step 1/ register for changes of the
status
property of the player itemStep 2/ in
observeValueForKeyPath:ofObject:change:context:
EDIT: corrected the answer