Skip to content

Commit 543a04d

Browse files
hellohuanlinIVLIVS-III
authored andcommitted
[video_player]add integration test for inverted aspect ratio bug (flutter#6662)
1 parent 2cf9291 commit 543a04d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/video_player/video_player_avfoundation/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Adds an integration test for a bug where the aspect ratios of some HLS videos are incorrectly inverted.
4+
15
## 2.3.7
26

37
* Fixes a bug where the aspect ratio of some HLS videos are incorrectly inverted.

packages/video_player/video_player_avfoundation/example/integration_test/video_player_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,19 @@ void main() {
177177
expect(livestreamController.value.duration,
178178
(Duration duration) => duration != Duration.zero);
179179
});
180+
181+
testWidgets('rotated m3u8 has correct aspect ratio',
182+
(WidgetTester tester) async {
183+
// Some m3u8 files contain rotation data that may incorrectly invert the aspect ratio.
184+
// More info [here](https://github.com/flutter/flutter/issues/109116).
185+
final MiniController livestreamController = MiniController.network(
186+
'https://flutter.github.io/assets-for-api-docs/assets/videos/hls/rotated_nail_manifest.m3u8',
187+
);
188+
await livestreamController.initialize();
189+
190+
expect(livestreamController.value.isInitialized, true);
191+
expect(livestreamController.value.size.width,
192+
lessThan(livestreamController.value.size.height));
193+
});
180194
});
181195
}

0 commit comments

Comments
 (0)