You writing the code use C# or VB.Net?
May you forgot to Change the equal sign (=) with slash (/) and Remove the "watch?" string.

You writing the code use C# or VB.Net?
May you forgot to Change the equal sign (=) with slash (/) and Remove the "watch?" string.

Hi Every body
by seeing this video i tried but it is not working
"http://www.youtube.com/v/kg-z8JfOIKw"
i used shockwaveflash to play a movie but when i execute only a blank screen will be their it is not playing the movie guide through the code really i am confused totally

I did not watch the video, though I thought I'd supply a "watch youtube video with vb.net" solution.
1.WebBrowser,1.Button

Public Class Form1

    Private iVidHeight As Integer = 500, iVidWidth As Integer = 800
    Private iVidStyleVersion As Integer = 3 '// changes vid.style. 

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        playCoolYouTubeVid("phYaduairf8", WebBrowser1) '// play video.
    End Sub
    Private Sub playCoolYouTubeVid(ByVal selCoolVid As String, ByVal selCoolWebBrowser As WebBrowser)
        Dim sObject As String = "<object style=""height:" & iVidHeight & "px; width:" & iVidWidth & "px""><param name=""movie"" value=""http://www.youtube.com/v/" & selCoolVid & "?version=" & iVidStyleVersion & "&feature=player_detailpage""><param name=""allowFullScreen"" value=""true""><param name=""allowScriptAccess"" value=""always""><embed src=""http://www.youtube.com/v/" & selCoolVid & "?version=" & iVidStyleVersion & "&feature=player_detailpage"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" allowScriptAccess=""always"" height=""" & iVidHeight & "px"" width=""" & iVidWidth & "px""></object>"
        selCoolWebBrowser.DocumentText = sObject
    End Sub
End Class

To play the video, just copy the last part or any part of the url that contains the video.id.
.ex:
Vid.URL: http://www.youtube.com/watch?v=kg-z8JfOIKw
Vid.ID: kg-z8JfOIKw

I did not watch the video, though I thought I'd supply a "watch youtube video with vb.net" solution.
1.WebBrowser,1.Button

Public Class Form1

    Private iVidHeight As Integer = 500, iVidWidth As Integer = 800
    Private iVidStyleVersion As Integer = 3 '// changes vid.style. 

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        playCoolYouTubeVid("phYaduairf8", WebBrowser1) '// play video.
    End Sub
    Private Sub playCoolYouTubeVid(ByVal selCoolVid As String, ByVal selCoolWebBrowser As WebBrowser)
        Dim sObject As String = "<object style=""height:" & iVidHeight & "px; width:" & iVidWidth & "px""><param name=""movie"" value=""http://www.youtube.com/v/" & selCoolVid & "?version=" & iVidStyleVersion & "&feature=player_detailpage""><param name=""allowFullScreen"" value=""true""><param name=""allowScriptAccess"" value=""always""><embed src=""http://www.youtube.com/v/" & selCoolVid & "?version=" & iVidStyleVersion & "&feature=player_detailpage"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" allowScriptAccess=""always"" height=""" & iVidHeight & "px"" width=""" & iVidWidth & "px""></object>"
        selCoolWebBrowser.DocumentText = sObject
    End Sub
End Class

To play the video, just copy the last part or any part of the url that contains the video.id.
.ex:
Vid.URL: http://www.youtube.com/watch?v=kg-z8JfOIKw
Vid.ID: kg-z8JfOIKw

hey i am really in a big confusion how can i do this please guide me
this is web based application i am doing

if i put the name of the video in the textbox and when i click button it should search in all over the internet and Show me only videos either it is perfect matched video or any similar videos
and on cliking on the video i should be able to play in the same page

please help me

This seems like a very big task to accomplish.
First off, using something as:

With WebBrowser1
            .Navigate("http://www.google.com/search?q=" & TextBox1.Text & " video")
        End With

Will not always return video links, it will return links to pages with videos.

The best solution I can offer is to search YouTube.

With WebBrowser1
            .Navigate("http://www.youtube.com/results?search_query=" & TextBox1.Text)
        End With

.get the link clicked, extract the video.ID, and load the video in the WebBrowser with the code I recently posted.
You can and should be able to do this with other video sites, If they allow you to embed their video player on your web.page, as YouTube does.

Hope this helps.

Edited 4 Years Ago by codeorder: n/a

I played around w/this project.idea and got my own results(view att.image).
.it only searches "gametrailers.com" For now, though it uses HttpWebResponse and extracts info from:

Private urlGameTrailers As String = "http://www.gametrailers.com/"
    Private urlSrcGameTrailers As String = urlGameTrailers & "search.php?str_type=games&s="

...Then creates little WebBrowsers(For.now)) w/extracted content from each HTTP.search result.

.hitting.up major video web.sights That allow you to <embed> videos in your website, could always give you an advantage w/this typeOf(project) .

Attachments web.vid_.beta_.png 183.38 KB
This article has been dead for over six months. Start a new discussion instead.