Page 1 of 1

how to play 1 link youtube?

Posted: 18 Jul 2015 05:59
by parker
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

Re: how to play 1 link youtube?

Posted: 18 Jul 2015 08:51
by sherington
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.

Re: how to play 1 link youtube?

Posted: 18 Jul 2015 12:29
by parker
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

Re: how to play 1 link youtube?

Posted: 25 Jul 2015 05:31
by parker
hi sherington!
Are you there? Help me pls.
thanks

Re: how to play 1 link youtube?

Posted: 25 Jul 2015 08:57
by sherington
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.