Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Youtube video can not be played #345

Closed
jonijm opened this issue Nov 8, 2017 · 14 comments
Closed

Youtube video can not be played #345

jonijm opened this issue Nov 8, 2017 · 14 comments

Comments

@jonijm
Copy link

jonijm commented Nov 8, 2017

Hi!

I am trying in "myControl.MediaPlayer.Play(new Uri("https://www.youtube.com/watch?v=GMFewiplIbw")), but it doesn't work;", it's strange...anybody can help me?

This is the trace:
libVlc : Debug Name: Becky G, Bad Bunny - Mayores (Official Video) ft. Bad Bunny @ lua
libVlc : Debug meta-URL: https://www.youtube.com/watch?v=GMFewiplIbw @ lua
libVlc : Debug removing module "lua" @ core
libVlc : Debug ArtURL: https://i.ytimg.com/vi/GMFewiplIbw/maxresdefault.jpg @ lua
libVlc : Debug removing module "http" @ core
libVlc : Debug removing module "record" @ core
El subproceso 0xc18 terminó con código 0 (0x0).
El subproceso 0xc9c terminó con código 0 (0x0).
El subproceso 0xd28 terminó con código 0 (0x0).
El subproceso 0xf54 terminó con código 0 (0x0).

Vlc.DotNet version : 2.2.1
Vlc.DotNet project used : WinWpf
libvlc version : x86, 2.2.6 and 3.0.0
.net version : 4.0
Project language : Visual C#
Project build architecture : x86
Operating system : Windows 7 x64

Thanks!

@ebalmol
Copy link

ebalmol commented Dec 1, 2017

Did you finally get it? I have the same problem :(

Thanks!

@jeremyVignelles
Copy link
Collaborator

There has been work made on the youtube lua script recently, but I don't know if this is related. did you try the latest nightly build?

@jeremyVignelles
Copy link
Collaborator

Please also confirm that your issue don't show up with vlc.exe

@ebalmol
Copy link

ebalmol commented Dec 1, 2017

With vlc.exe it works fine.
I have tested it with Vlc.DotNet 2.2.1, I'll try it with 2.2.2.

Thanks,

@jeremyVignelles
Copy link
Collaborator

Please also try with vlc-3.0.0 nightly from nightlies.videolan.org

@ebalmol
Copy link

ebalmol commented Dec 1, 2017

With vlc-3.0.0 nightly from nightlies.videolan.org it works (x86 and x64 are ok).

@ebalmol
Copy link

ebalmol commented Dec 15, 2017

Hi again,

I've been working on this and It's possible that playing youtube videos is only supported under playlist feature (https://stackoverflow.com/questions/11436864/vlc-python-doesnt-play-youtube-video).

If you look for youtube lua it is under Playlist folder.

I have been looking for playing Playlist with vlcdotnet and I think it is still not possible, isn't it? Does anyone know if it will be developed in the near future?

Thanks,

@jeremyVignelles
Copy link
Collaborator

@ebalmol : Thanks for your finding. Indeed, playlists are not (yet?) supported by Vlc.DotNet. This is tracked by #193 . It is not currently planned to add playlist support in Vlc.DotNet, but I welcome contributions :) If you want to contribute and need help to implement it, feel free to join the gitter discussion.

@jeremyVignelles
Copy link
Collaborator

It might be a solution. I did not test and do not guarantee that this will work.

I think that youtube streaming URL is purposefully opaque so that you use their player or their website. This means that whatever the way you try to reach it, it is a hack and you're not sure it will still work in the future...

@MachDemon
Copy link

MachDemon commented Jun 4, 2018

I can play youtube videos using YouTubeExplode

private async void PlayYouTubeVideoAsync()
        {
            var url = "https://youtu.be/PbGDH_JOM9w";
            var youtubeVidId = YoutubeClient.ParseVideoId(url);
            var yt = new YoutubeClient();
            var video = await yt.GetVideoMediaStreamInfosAsync(youtubeVidId);
            var muxed = video.Muxed.WithHighestVideoQuality();

            vlcControl.SetMedia(new Uri(muxed.Url));
            vlcControl.Play();
        }

@jeremyVignelles
Copy link
Collaborator

This looks nice, thanks for sharing your findings @MachDemon ;-)

@jeremyVignelles
Copy link
Collaborator

Since there's no answer from the original poster, I'm going to close that, because several options have been provided.

@nekinci
Copy link

nekinci commented Jul 14, 2019

var url = "https://youtu.be/PbGDH_JOM9w";
var youtubeVidId = YoutubeClient.ParseVideoId(url);
var yt = new YoutubeClient();
var video = await yt.GetVideoMediaStreamInfosAsync(youtubeVidId);
var muxed = video.Muxed.WithHighestVideoQuality();

        vlcControl.SetMedia(new Uri(muxed.Url));
        vlcControl.Play();

Thank you very much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants