提交 179c06fa authored 作者: jungleiOS's avatar jungleiOS

修复音量设置问题

上级 fbfc666b
...@@ -248,7 +248,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer> ...@@ -248,7 +248,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
@override @override
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (!_hasShow) return; if (!mounted || !_hasShow) return;
var orientation = MediaQuery.of(context).orientation; var orientation = MediaQuery.of(context).orientation;
bool fullscreen = false; bool fullscreen = false;
if (orientation == Orientation.landscape) { if (orientation == Orientation.landscape) {
...@@ -388,7 +388,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer> ...@@ -388,7 +388,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
vol = 0.0; vol = 0.0;
} }
if (vol >= 1.0) { if (vol >= 1.0) {
vol = 0.0; vol = 1.0;
} }
if (_controller.value.isInitialized) { if (_controller.value.isInitialized) {
widget.onVolume?.call(vol); widget.onVolume?.call(vol);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论