Reputation: 1
I using libCLCSharp and xamarin forms to playvideo. With this url below is OK. but when i replace by an youtuble video it can not to play. how can i do it. Thanks
my code:
_libvlc = new LibVLC();
var media = new Media(_libvlc, "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4", FromType.FromLocation); myVideo.MediaPlayer = new MediaPlayer(media) { EnableHardwareDecoding = true }; myVideo.MediaPlayer.Play();
Upvotes: 0
Views: 2086
Reputation: 2184
Core.Initialize();
using(var libVLC = new LibVLC())
{
var media = new Media(libVLC, "https://www.youtube.com/watch?v=dQw4w9WgXcQ", FromType.FromLocation);
await media.Parse(MediaParseOptions.ParseNetwork);
using (var mp = new MediaPlayer(media.SubItems.First()))
{
mp.Play();
}
}
Upvotes: 3