Page 1 of 1

Why libvlc_MediaListPlayerNextItemSet event is triggered twice when list contains youtube videos?

Posted: 09 Jun 2015 13:01
by tuff
Hello,

I am using libvlc_media_list_t to hold a bunch of media. This list contains local and youtube videos. When I change the media with a keyboard key, if the next media is a youtube video, then libvlc_MediaListPlayerNextItemSet is triggered twice. On the other hand, if the next media is a local video, then libvlc_MediaListPlayerNextItemSet is triggered once. Is there anyone who knows the reason?

Moreover, libvlc_playback_mode_repeat is also not working with youtube videos properly. I think the reasons should be the same.

tuff

Re: Why libvlc_MediaListPlayerNextItemSet event is triggered twice when list contains youtube videos?

Posted: 09 Jun 2015 15:41
by RĂ©mi Denis-Courmont
I guess the YouTube link is treated as a playlist containing exactly one video; that would be two "items".

Re: Why libvlc_MediaListPlayerNextItemSet event is triggered twice when list contains youtube videos?

Posted: 10 Jun 2015 12:41
by tuff
Do you have any advice for me to create a playlist that will contain youtube videos and have the following properties. I want to change the media via keyboard command. I am holding indexes for these videos and using libvlc_media_list_player_play_item_at_index. This works exactly as I want. However, when a video comes to an end without a keyboard interaction, the indexes leads confusion. Therefore, I want to re-play the video. However, libvlc_playback_mode_repeat and libvlc_MediaPlayerEndReached is not working correctly with youtube videos.

Re: Why libvlc_MediaListPlayerNextItemSet event is triggered twice when list contains youtube videos?

Posted: 10 Jun 2015 12:47
by RSATom
In the same situation I've did my own loop implementation.
https://github.com/RSATom/ya-libvlc-wra ... r.cpp#L414
https://github.com/RSATom/ya-libvlc-wra ... r.cpp#L377

in client code next() is attached to libvlc_MediaPlayerEndReached and libvlc_MediaPlayerEncounteredError. But keep in mind in my case it called from GUI thread, but libvlc events arrive from worker thread.

Re: Why libvlc_MediaListPlayerNextItemSet event is triggered twice when list contains youtube videos?

Posted: 10 Jun 2015 12:49
by RSATom
also you could try attach to libvlc_MediaSubItemTreeAdded event

Re: Why libvlc_MediaListPlayerNextItemSet event is triggered twice when list contains youtube videos?

Posted: 10 Jun 2015 13:07
by tuff
Thanks for your quick answer, I will look at your implementation.