Repeat or loop a video

This forum is about all development around libVLC.
fasteque
Blank Cone
Blank Cone
Posts: 10
Joined: 04 Jul 2016 11:24

Repeat or loop a video

Postby fasteque » 30 Aug 2016 15:25

Hello guys,

I'm trying to repeat a video in a loop but even if I thought it would have been an easy task, I've found out I'm not able to do it.

I'm using libvlc for Android and I'm playing a video over the network. I simply instantiate a LibVLC object and then I create a MediaPlayer, set a Media to it and play.
When I get event EndReached, I try to set the position of the MediaPlayer to 0 but the video is not played back.

I've also try to see options like "--repeat", "--loop", "-L", "--global-key-loop=Loop" without any success.

The only working thing is to set the position to 0 at about 95% of the video length: it's working but the visual effect is not good, because the video is made to start and end with the same frame, so if I skip some of them it's a little bit "nervous" the transaction.


Thanks in advance for your help!

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Repeat or loop a video

Postby Rémi Denis-Courmont » 30 Aug 2016 15:28

Stop the media player and start (play) again.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

fasteque
Blank Cone
Blank Cone
Posts: 10
Joined: 04 Jul 2016 11:24

Re: Repeat or loop a video

Postby fasteque » 30 Aug 2016 15:46

Ok thanks, stop and playing again for EndReached event works, but of course there's a gap in the playback because of buffering.
Considering it's an http video, I guess that's the best result I can quickly/easily get with libvlc right?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Repeat or loop a video

Postby Rémi Denis-Courmont » 30 Aug 2016 15:56

There's also a gap when seeking backward.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

trickbiker121
New Cone
New Cone
Posts: 2
Joined: 02 Sep 2016 02:57

Re: Repeat or loop a video

Postby trickbiker121 » 02 Sep 2016 03:36

The way I am doing it is by checking if the state is ended if so set the media in the player again and play the media.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Repeat or loop a video

Postby Rémi Denis-Courmont » 03 Sep 2016 11:41

That is probably racy.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 18 guests