playVideo method
dynamic
playVideo(
- String url
)
Implementation
playVideo(String url) {
if (videoController != null) {
videoController?.pause();
videoController?.dispose();
}
videoController = VideoPlayerController.networkUrl(Uri.parse(url));
state.isPlay.value = false;
state.initializeVideoPlayerFuture = null;
var initializeVideoPlayerFuture = videoController?.initialize().then((_) {
videoController?.seekTo(const Duration(milliseconds: 0));
videoController?.play();
});
state.initializeVideoPlayerFuture = initializeVideoPlayerFuture;
state.isPlay.value = true;
}