【发布时间】:2021-06-19 01:41:06
【问题描述】:
我正在使用yoyo_player 播放直播视频。当我返回/弹出主页时,出现以下异常:
这个小部件已被卸载,因此状态不再有上下文(应该被视为已失效)
我无法处理 yoyo 播放器,因为它没有控制器。以下是我的代码:
YoYoPlayer(
aspectRatio: 16 / 9,
url:
"https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
//"https://stream.mux.com/pYcUEtxsvAyEQBydYkR7dCnBVenRMt7JyuvVno6Y40000.m3u8",
videoStyle: VideoStyle(
play : Icon(Icons.play_arrow),
pause : Icon(Icons.pause),
fullscreen : Icon(Icons.fullscreen),
),
videoLoadingStyle: VideoLoadingStyle(
loading: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircularProgressIndicator(),
Text("Loading video"),
],
),
),
),
onfullscreen: (t) {
if(mounted){
removeBannerAd();
setState(() {
fullscreen = t;
});
}
},
)
如何解决这个异常?
【问题讨论】:
-
您是否碰巧找到了解决此问题的方法?我也面临同样的情况
-
@VedantRathore 到目前为止我没有找到任何解决方案
标签: flutter video-player