Skip to content

Commit 1bbee91

Browse files
committed
Add a native test for supporting HLS (.m3u8) audio
1 parent 685d0e6 commit 1bbee91

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/video_player/video_player_avfoundation/darwin/RunnerTests/VideoPlayerTests.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,22 @@ - (void)testHLSControls {
530530
XCTAssertEqualWithAccuracy([videoInitialization[@"duration"] intValue], 4000, 200);
531531
}
532532

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+
533549
#if TARGET_OS_IOS
534550
- (void)testTransformFix {
535551
[self validateTransformFixForOrientation:UIImageOrientationUp];

0 commit comments

Comments
 (0)