提交 3797b19d 编写于 作者: Z zhangxinzheng 提交者: xinzhengzhang

ios/IJKAVMoviePlayer add once token for ready to play status

上级 33f85005
......@@ -122,7 +122,7 @@ static void *KVO_AVPlayerItem_playbackBufferEmpty = &KVO_AVPlayerItem_play
IJKKVOController *_playerItemKVO;
id _timeObserver;
dispatch_once_t _readyToPlayToken;
// while AVPlayer is prerolling, it could resume itself.
// foring start could
BOOL _isPrerolling;
......@@ -726,6 +726,7 @@ static IJKAVMoviePlayerController* instance;
/* Once the AVPlayerItem becomes ready to play, i.e.
[playerItem status] == AVPlayerItemStatusReadyToPlay,
its duration can be fetched from the item. */
dispatch_once(&_readyToPlayToken, ^{
[_avView setPlayer:_player];
self.isPreparedToPlay = YES;
......@@ -742,6 +743,7 @@ static IJKAVMoviePlayerController* instance;
if (_shouldAutoplay)
[_player play];
});
}
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册