Skip to content

Commit 899f0f1

Browse files
[video_player] Add doc for iOS playbackBufferEmpty KVO bug. Refer: #3826 (comment)
1 parent ef0e78e commit 899f0f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ - (void)observeValueForKeyPath:(NSString *)path
337337
}
338338
}
339339
} else if (context == playbackBufferEmptyContext) {
340+
// There's a bug in AVFoundation, KVO for `playbackBufferEmpty` when playing HLS content. The
341+
// expected behavior of the value change for `playbackBufferEmpty` is not triggered. This
342+
// issue has been confirmed in iOS 16.5. Refer:
343+
// https://github.com/flutter/packages/pull/3826#discussion_r1204985454 Fortunately, the KVO
344+
// for `playbackBufferFull` is working correctly, so the bug won't affect the event passing
345+
// responsible for `bufferingEnd` or `bufferingStart` events.
340346
if (_eventSink != nil) {
341347
if ([[_player currentItem] isPlaybackLikelyToKeepUp]) {
342348
_eventSink(@{@"event" : @"bufferingEnd"});

0 commit comments

Comments
 (0)