Skip to content

Commit e1f409c

Browse files
committed
Improve the comment for checking HLS audio-only tracks
1 parent 86c0ee0 commit e1f409c

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +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`.
386+
// Audio-only HLS files have no size, so `currentItem.tracks.count` must be used to check for track presence,
387+
// as AVAsset does not always provide track information in HLS streams.
388388
BOOL hasNoTracks = currentItem.tracks.count == 0 && asset.tracks.count == 0;
389389

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

0 commit comments

Comments
 (0)