fix: get correct aspect ratio from VideoPlayerController
This commit is contained in:
parent
dd1e2f34d3
commit
0c7c8f8d5a
1 changed files with 1 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue