【发布时间】:2022-01-19 12:14:57
【问题描述】:
我正在做一个项目,我正在使用颤振咀嚼播放器播放视频。但是当没有网络时(或者当我关闭互联网时),它会显示错误:
VideoError, Video player had error com.google.android.exoplayer2.ExoPlaybackException: Source error, null, null
我想在网络丢失时显示一个圆形指示器,而不是这个错误,并希望在网络恢复后继续播放。如何实现?
我的咀嚼控制器如下:
chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
aspectRatio: 16 / 9,
autoPlay: true,
looping: false,
startAt: Duration(seconds: timeWatched),
errorBuilder: (context, errorMessage) {
return Center(
child: Text(
errorMessage,
style: TextStyle(color: Colors.white),
),
);
},
showControls: true,
allowFullScreen: true,
fullScreenByDefault: false,
customControls: CupertinoControls(
backgroundColor: Colors.black,
iconColor: COLORS['PRIMARY_COLOR'],
));```
【问题讨论】:
标签: flutter dart flutter-video-player