We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buffer为空时,先设置 loadState 为 ZFPlayerLoadStateStalled:
if (self.playerItem.playbackBufferEmpty) { self.loadState = ZFPlayerLoadStateStalled; [self bufferingSomeSecond]; }
然后在bufferingSomeSecond方法中,调用了pause,把 isPlaying 设置为 NO
[self pause]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // 如果此时用户已经暂停了,则不再需要开启播放了 if (!self.isPlaying && self.loadState == ZFPlayerLoadStateStalled) { self.isBuffering = NO; return; } [self play]; // 如果执行了play还是没有播放则说明还没有缓存好,则再次缓存一段时间 self.isBuffering = NO; if (!self.playerItem.isPlaybackLikelyToKeepUp) [self bufferingSomeSecond]; });
那过了3s,“!self.isPlaying && self.loadState == ZFPlayerLoadStateStalled” 总是为 YES,就会直接 return 了,不会执行下面尝试 play、或者继续 bufferingSomeSecond 的代码。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
buffer为空时,先设置 loadState 为 ZFPlayerLoadStateStalled:
然后在bufferingSomeSecond方法中,调用了pause,把 isPlaying 设置为 NO
那过了3s,“!self.isPlaying && self.loadState == ZFPlayerLoadStateStalled” 总是为 YES,就会直接 return 了,不会执行下面尝试 play、或者继续 bufferingSomeSecond 的代码。
The text was updated successfully, but these errors were encountered: