fix: get correct aspect ratio from VideoPlayerController

This commit is contained in:
Matias 2026-02-05 20:35:28 +01:00
parent dd1e2f34d3
commit 0c7c8f8d5a
No known key found for this signature in database
GPG key ID: ED35A6AC65A06B69

View file

@ -82,10 +82,6 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
await videoPlayerController.initialize();
final infoMap = widget.event.content.tryGetMap<String, Object?>('info');
final videoWidth = infoMap?.tryGet<int>('w') ?? 400;
final videoHeight = infoMap?.tryGet<int>('h') ?? 300;
// Create a ChewieController on top.
setState(() {
_chewieController = ChewieController(
@ -94,7 +90,7 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
autoPlay: true,
autoInitialize: true,
looping: true,
aspectRatio: videoHeight == 0 ? null : videoWidth / videoHeight,
aspectRatio: _videoPlayerController?.value.aspectRatio,
);
});
} on IOException catch (e) {