Open yuxingmin opened 5 months ago
Future initializePlayer() async { videoController = VideoPlayerController.networkUrl(Uri.parse(widget.url)); await Future.wait([videoController.initialize()]); chewieController = ChewieController( videoPlayerController: videoController, aspectRatio: widget.aspectRatio, autoPlay: widget.autoPlay, looping: widget.looping, isLive: true, showOptions: false, // useRootNavigator: false, // controlsSafeAreaMinimum: EdgeInsets.fromLTRB(0, 0, 0, 20), allowPlaybackSpeedChanging: false, allowMuting: false, //声音 // placeholder: placeHolder, materialProgressColors: progressColors, customControls: const MaterialControls( showPlayButton: true, )); setState(() {}); }
就是当我播放一个直播流的地址,是么m3u8格式的,当我开始后,中间的控制按钮总是replay,不是播放和暂停的图标
Future initializePlayer() async {
videoController = VideoPlayerController.networkUrl(Uri.parse(widget.url));
await Future.wait([videoController.initialize()]);
chewieController = ChewieController(
videoPlayerController: videoController,
aspectRatio: widget.aspectRatio,
autoPlay: widget.autoPlay,
looping: widget.looping,
isLive: true,
showOptions: false,
// useRootNavigator: false,
// controlsSafeAreaMinimum: EdgeInsets.fromLTRB(0, 0, 0, 20),
allowPlaybackSpeedChanging: false,
allowMuting: false, //声音
// placeholder: placeHolder,
materialProgressColors: progressColors,
customControls: const MaterialControls(
showPlayButton: true,
));
setState(() {});
}