none
How to play Youtube videos in AxVLCPlugin21 ? RRS feed

  • Question

  • At very first i tried to add a file to AxVLCPlugin21 like:

    AxVLCPlugin21 .playlist.Add("D:\Example.mp4");

    It Didn't worked.

    I found that we have to use it like:

    AxVLCPlugin21 .playlist.Add("file:///D:\Example.mp4");

    It worked fine with local file. I tried lots of ways to play "Youtube" video but failed.  Is there any way to play "Youtube" video with AxVLCPlugin21 or anything i can replace "file:///" with and play "Youtube" video?

    Thursday, January 2, 2020 11:28 AM

All replies

  • A consideration

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/27c17127-b447-419e-8dd7-7ef8a8d4c16e/help-embedding-a-youtube-video-into-a-windows-form?forum=vbgeneral


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, January 2, 2020 5:36 PM
    Moderator
  • Hi Aditya, 

    Thank you for posting here.

    Check the following reference about playing Youtube videos in AxVLCPlugin21

    How to play youtube videos through vlc plugin?

    Beisdes, in order to play Youtube videos, you can use WebBrowser control.

    You need to create a form and put a WebBrowser control on it.

    Note: you should make sure the video is allowed to be played as embedded, and use the embed url.

    Here’s the code you can refer to.

        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim embed = "<html><head>" & "<meta http-equiv=""X-UA-Compatible"" content=""IE=Edge""/>" & "</head><body>" & "<iframe width=""300"" src=""{0}""" & "frameborder = ""0"" allow = ""autoplay; encrypted-media"" allowfullscreen></iframe>" & "</body></html>"
            Dim url = "https://www.youtube.com/embed/yg2u_De8j5o"
            Me.WebBrowser1.DocumentText = String.Format(embed, url)
        End Sub
    

    Result of my test:

    Hope them can help you.

    Best Regards,

    Xingyu Zhao



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 3, 2020 5:58 AM
    Moderator