Merge pull request #2536 from TheSunCat/fix/videoaspect

Fix aspect ratio of video player
This commit is contained in:
Krille-chan 2026-02-10 17:11:55 +01:00 committed by GitHub
commit 7ec4c6f34e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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) {