Skip to content

Commit 86c0ee0

Browse files
committed
Add clarification comment for checking HLS audio-only tracks
1 parent a7ff3ad commit 86c0ee0

File tree

1 file changed

+2
-0
lines changed
  • packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation

1 file changed

+2
-0
lines changed

packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayer.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ - (void)setupEventSinkIfReadyToPlay {
383383
}
384384

385385
BOOL hasVideoTracks = [asset tracksWithMediaType:AVMediaTypeVideo].count != 0;
386+
// In HLS streams, AVAsset may not always provide track information because it is a streaming format.
387+
// For audio-only HLS files, track information must be checked using `currentItem.tracks.count`.
386388
BOOL hasNoTracks = currentItem.tracks.count == 0 && asset.tracks.count == 0;
387389

388390
// The player has not yet initialized when it has no size, unless it is an audio-only track.

0 commit comments

Comments
 (0)