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

This forum is about all development around libVLC.
tuff
New Cone
New Cone
Posts: 6
Joined: 08 Jun 2015 09:26

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

Postby tuff » 09 Jun 2015 13:01

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

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

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

Postby Rémi Denis-Courmont » 09 Jun 2015 15:41

I guess the YouTube link is treated as a playlist containing exactly one video; that would be two "items".
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

tuff
New Cone
New Cone
Posts: 6
Joined: 08 Jun 2015 09:26

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

Postby tuff » 10 Jun 2015 12:41

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.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

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

Postby RSATom » 10 Jun 2015 12:47

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.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

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

Postby RSATom » 10 Jun 2015 12:49

also you could try attach to libvlc_MediaSubItemTreeAdded event

tuff
New Cone
New Cone
Posts: 6
Joined: 08 Jun 2015 09:26

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

Postby tuff » 10 Jun 2015 13:07

Thanks for your quick answer, I will look at your implementation.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests