chore: Follow up VideoPlayer in ImageViewer

This commit is contained in:
krille-chan 2025-05-19 19:36:49 +02:00
commit 92d3e7f1c3
No known key found for this signature in database
2 changed files with 31 additions and 22 deletions

View file

@ -69,6 +69,10 @@ 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(
@ -77,6 +81,7 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
autoPlay: true,
autoInitialize: true,
looping: true,
aspectRatio: videoHeight == 0 ? null : videoWidth / videoHeight,
);
});
} on IOException catch (e) {