Play Youtube Videos in Visual Basic.Net

Download
Download is available until [expire_date]
  • Version
  • Download 291
  • File Size 137.02 KB
  • File Count 1
  • Create Date March 11, 2016
  • Last Updated March 11, 2016

Play Youtube Videos in Visual Basic.Net

Play Youtube Videos in Visual Basic.Net

This program will allow you to view youtube videos in visual basic.net. Shockwave flash object is used as the video player in this vb.net program.

To use the shockwave flash player component, you need to add first in the toolbox.

Right- Toolbox, and then select Choose Items. A dialog box will appear, select the COM Components tab, select or check Shockwave Flash Object and click ok.

Source code:

Public Class Form1

    Private Sub YoutubeVideos()
        ListBox1.Items.Add("Youtube Video 1")
        ListBox1.Items.Add("Youtube Video 2")
        ListBox1.Items.Add("Youtube Video 3")
        ListBox1.Items.Add("Youtube Video 4")
        ListBox1.Items.Add("Youtube Video 5")
    End Sub

    Private Sub ListBox1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDoubleClick
        If ListBox1.SelectedItem = "Youtube Video 1" Then
            AxShockwaveFlash1.Movie = "https://www.youtube.com/v/ZPnDJeRsglU"
        ElseIf ListBox1.SelectedItem = "Youtube Video 2" Then
            AxShockwaveFlash1.Movie = "https://www.youtube.com/v/iqba6B-QDFE"
        ElseIf ListBox1.SelectedItem = "Youtube Video 3" Then
            AxShockwaveFlash1.Movie = "https://www.youtube.com/v/WJI48mdCJuU"
        ElseIf ListBox1.SelectedItem = "Youtube Video 4" Then
            AxShockwaveFlash1.Movie = "https://www.youtube.com/v/joxr46Ikb48"
        ElseIf ListBox1.SelectedItem = "Youtube Video 5" Then
            AxShockwaveFlash1.Movie = "https://www.youtube.com/v/8hLym7MGsDs"
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        YoutubeVideos()
    End Sub

End Class
, , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.