开发者

AVPlayerItem and KVO - am i missing something?

so in the init of a simple Controller i have this code:

self.playerItem = [AVPlayerItem playerItemWithURL:url];
[self.playerItem addObserver:self forKeyPath:@"status" options:0 context:nil];

which should try and load media from the url, right? i'm implemeting

observeValueForKeyPath:ofObject:change:context:

however, this method开发者_如何学运维 is never called. Clueless?


playerItem starts working after being assigned to a AVPlayer object (duh)

self.player = [AVPlayer playerWithPlayerItem:self.playerItem];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜