flutter_vlc_player
flutter_vlc_player copied to clipboard
video doesnt loop
here's the code I'm using for the controller:
vidcontroller = VlcPlayerController.file( (snapshot.data as FileInfo).file, options: VlcPlayerOptions(video: VlcVideoOptions(['--loop'])), onInit: () async {await vidcontroller.setLooping(true);} );
It just plays to the end and then pauses. Am I setting this wrong?
when you call setLooping method, we set the loop option of vlc. it might be an issue with vlc.
Any news on that ? Is there an example to use setLooping method ? When it should be called for vlc to set it correctly.
I use the following code, but it stops at the end of the video, maybe the player just doesn't "see" these settings because it's already initialized differently?:
_videoPlayerController = VlcPlayerController.file(
file,
hwAcc: HwAcc.FULL,
autoPlay: false,
options: VlcPlayerOptions(),
onInit: () async {
await _videoPlayerController.setLooping(true);
await _videoPlayerController.play();
},
);
This is what I've used as a workaround:
@override
void initState() {
super.initState();
var file = File("/localfilename");
_videoPlayerController = VlcPlayerController.file(
file,
hwAcc: HwAcc.FULL,
autoPlay: true,
onInit: () async {
await _videoPlayerController.startRendererScanning();
},
options: VlcPlayerOptions(),
);
_videoPlayerController.addListener(listener);
}
void listener() async {
if (!mounted) return;
if (_videoPlayerController.value.isEnded) {
_videoPlayerController.stop();
_videoPlayerController.play();
}
}
Any updates on the Issue?
Not Working....
vlcController = VlcPlayerController.network(
widget.videoUrl,
hwAcc: HwAcc.FULL,
autoPlay: true,
autoInitialize: true,
options: VlcPlayerOptions(),
);
vlcController.addOnInitListener(initializePlayer);
Future<void> initializePlayer() async {
vlcController.setLooping(true);
}
onInit : is depricated in latest version the docs say use addOnInitListener but this way also not working. Anyone got the solution to loop the video.....????
Yes, both not working.