【发布时间】:2021-02-23 03:28:04
【问题描述】:
我正在使用Better_Player 来显示视频,但我没有得到视频的纵横比,所以我该怎么做。如果有人拥有它,如果你分享会很棒。
【问题讨论】:
标签: flutter dart video media-player
我正在使用Better_Player 来显示视频,但我没有得到视频的纵横比,所以我该怎么做。如果有人拥有它,如果你分享会很棒。
【问题讨论】:
标签: flutter dart video media-player
你的意思是,你没有得到纵横比?
可以给BetterPlayer属性aspectRatio。
BetterPlayer.network(
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
betterPlayerConfiguration: BetterPlayerConfiguration(
**aspectRatio**: 16 / 9,
),
),
Like this 如果这不起作用,您可以简单地尝试将播放器包装在 AspectRatio Widget 中,如文档示例:
AspectRatio(
**aspectRatio**: 10 / 9,
child: BetterPlayer.network(
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
),
),
还是我没看懂问题?
【讨论】:
我遇到了同样的问题并使用了 BoxFit.scaleDown,它对我有用。
BetterPlayerConfiguration( 适合:BoxFit.scaleDown,)
【讨论】: