Skip to content

Commit

Permalink
[video_player] Add doc for iOS playbackBufferEmpty KVO bug. Refer: #…
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-undefined committed Jun 17, 2023
1 parent ef0e78e commit 5069e69
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ - (void)observeValueForKeyPath:(NSString *)path
}
}
} else if (context == playbackBufferEmptyContext) {
// There's a bug in AVFoundation, KVO for `playbackBufferEmpty` when playing HLS content. The
// expected behavior of the value change for `playbackBufferEmpty` is not triggered. This
// issue has been confirmed in iOS 16.5. Refer:
// https://github.com/flutter/packages/pull/3826#discussion_r1204985454 Fortunately, the KVO
// for `playbackBufferFull` is working correctly, so the bug won't affect the event passing
// responsible for `bufferingEnd` or `bufferingStart` events.
if (_eventSink != nil) {
if ([[_player currentItem] isPlaybackLikelyToKeepUp]) {
_eventSink(@{@"event" : @"bufferingEnd"});
Expand Down

0 comments on commit 5069e69

Please sign in to comment.