how to play 1 link youtube?

This forum is about all development around libVLC.
parker
Blank Cone
Blank Cone
Posts: 39
Joined: 21 Sep 2010 05:25

how to play 1 link youtube?

Postby parker » 18 Jul 2015 05:59

Here is my code but it does not work

Code: Select all

string[] args = new string[] { "-I", "dummy", "--ignore-config", @"--plugin-path=C:\Program Files (x86)\VideoLAN\VLC\plugins", "--vout-filter=deinterlace", "--deinterlace-mode=blend" }; instance = new VlcInstance(args); player = null; using (VlcMedia media = new VlcMedia(instance, "https://www.youtube.com/watch?v=xCF19cBWb0I")) { if (player != null) player.Dispose(); player = new VlcMediaPlayer(media); } player.Drawable = panel1.Handle; player.Play();
thanks

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: how to play 1 link youtube?

Postby sherington » 18 Jul 2015 08:51

When you 'play' a YouTube watch URL, the HTML page is parsed looking for the actual streaming URL. The real streaming URL, if found, is created as a sub-item of the original media.

So you're supposed to play the watch URL, wait for a finished event, then iterate the sub-items to find the actual streaming URL and play that.

That's how you do it in general, I don't know which library/framework you're using so I can't be more specific.

parker
Blank Cone
Blank Cone
Posts: 39
Joined: 21 Sep 2010 05:25

Re: how to play 1 link youtube?

Postby parker » 18 Jul 2015 12:29

hi sherington!
I use the code here. Hope you edit the code to work with youtube
http://www.helyar.net/2009/libvlc-media ... -c-part-2/

thanks

parker
Blank Cone
Blank Cone
Posts: 39
Joined: 21 Sep 2010 05:25

Re: how to play 1 link youtube?

Postby parker » 25 Jul 2015 05:31

hi sherington!
Are you there? Help me pls.
thanks

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: how to play 1 link youtube?

Postby sherington » 25 Jul 2015 08:57

I have no idea how to make it work with those six year old unmaintained LibVLC bindings that you want to use.

I told you *what* you need to do, you need to work out the *how* yourself. Or, contact the author of those bindings for help, or use some official/better LibVLC bindings for your chosen programming language and maybe someone else can help you.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 24 guests