File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
packages/video_player/video_player_avfoundation
video_player_avfoundation/Sources/video_player_avfoundation Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.6.5
2
+
3
+ * Bugfix to allow the audio-only HLS (.m3u8) on iOS.
4
+
1
5
## 2.6.4
2
6
3
7
* Refactors native code structure.
Original file line number Diff line number Diff line change @@ -530,6 +530,22 @@ - (void)testHLSControls {
530
530
XCTAssertEqualWithAccuracy ([videoInitialization[@" duration" ] intValue ], 4000 , 200 );
531
531
}
532
532
533
+ - (void )testAudioOnlyHLSControls {
534
+ NSObject <FlutterPluginRegistrar> *registrar =
535
+ [GetPluginRegistry () registrarForPlugin: @" TestAudioOnlyHLSControls" ];
536
+
537
+ FVPVideoPlayerPlugin *videoPlayerPlugin =
538
+ (FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
539
+
540
+ NSDictionary <NSString *, id > *videoInitialization =
541
+ [self testPlugin: videoPlayerPlugin
542
+ uri: @" https://flutter.github.io/assets-for-api-docs/assets/videos/hls/"
543
+ @" bee_audio_only.m3u8" ];
544
+ XCTAssertEqualObjects (videoInitialization[@" height" ], @0 );
545
+ XCTAssertEqualObjects (videoInitialization[@" width" ], @0 );
546
+ XCTAssertEqualWithAccuracy ([videoInitialization[@" duration" ] intValue ], 4000 , 200 );
547
+ }
548
+
533
549
#if TARGET_OS_IOS
534
550
- (void )testTransformFix {
535
551
[self validateTransformFixForOrientation: UIImageOrientationUp];
Original file line number Diff line number Diff line change @@ -383,7 +383,9 @@ - (void)setupEventSinkIfReadyToPlay {
383
383
}
384
384
385
385
BOOL hasVideoTracks = [asset tracksWithMediaType: AVMediaTypeVideo].count != 0 ;
386
- BOOL hasNoTracks = asset.tracks .count == 0 ;
386
+ // Audio-only HLS files have no size, so `currentItem.tracks.count` must be used to check for
387
+ // track presence, as AVAsset does not always provide track information in HLS streams.
388
+ BOOL hasNoTracks = currentItem.tracks .count == 0 && asset.tracks .count == 0 ;
387
389
388
390
// The player has not yet initialized when it has no size, unless it is an audio-only track.
389
391
// HLS m3u8 video files never load any tracks, and are also not yet initialized until they have
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: video_player_avfoundation
2
2
description : iOS and macOS implementation of the video_player plugin.
3
3
repository : https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
5
- version : 2.6.4
5
+ version : 2.6.5
6
6
7
7
environment :
8
8
sdk : ^3.3.0
You can’t perform that action at this time.
0 commit comments