VB Flash Player in webbrowser
Hello.
I've searched the forum for a while, but i can't find any solution how to use flash in webbrowser.
My goal is to make an application that can play youtube videos with a webbrowser or anything similar.
Note that by webbrowser i mean the item from toolbox :)
Re: VB Flash Player in webbrowser
The way I have done it in the past was to set the Document.Body.InnerHtml = "<your flash embed html here>"
You can't set Document.Body.InnerHtml until there is a document.
So you'll have to navigate to about:blank first. Navigate("about:blank")
You might also need to call application.doevents after you navigate to about:blank, so that the document is created...
Re: VB Flash Player in webbrowser
Quote:
Originally Posted by
7777
The way I have done it in the past was to set the Document.Body.InnerHtml = "<your flash embed html here>"
You can't set Document.Body.InnerHtml until there is a document.
So you'll have to navigate to about:blank first. Navigate("about:blank")
You might also need to call application.doevents after you navigate to about:blank, so that the document is created...
Thanks for the answer.
I think i misunderstood something. The webbrowser just write the url on the screen, but doesn't load the video.
Here is my code:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("about:blank")
Application.DoEvents()
WebBrowser1.Document.Body.InnerHtml = "http://www.youtube.com/embed/4N3N1MlvVc4"
End Sub
Re: VB Flash Player in webbrowser
try This.
Code:
WebBrowser1.DocumentText = _
"<object style=""height: 390px; width: 640px""><param name=""movie"" value=""http://www.youtube.com/v/4N3N1MlvVc4?version=3""><param name=""allowFullScreen"" value=""true""><param name=""allowScriptAccess"" value=""always""><embed src=""http://www.youtube.com/v/4N3N1MlvVc4?version=3"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" allowScriptAccess=""always"" width=""640"" height=""390""></object>"
Re: VB Flash Player in webbrowser
Thanks for the reply.
doesn't seem to work. anything else i have to add in order to make it work?
-tyranlol
Re: VB Flash Player in webbrowser
it works on my pc.
Try Adding
Code:
WebBrowser1.Refresh()
After the code i posted.
EDIT: tested it and it doesn't needed to be refreshed.
Also I couldn't get that code Not to work so are you sure it is being called ?
Re: VB Flash Player in webbrowser
Sorry for the late answer. tested it again with and without the Refresh. still doesn't work. i added a picture now. maybe that can clarify something. the only error i get, is the 'X' inside my webbrowser.
http://filebeam.com/125d5dd3677884f4...ed8eeb8432.jpg
Re: VB Flash Player in webbrowser
Only thing i can think of now is we have different versions of flash player. Go to the youtube video you want and rightclick and click on copy embed html. Replace the string that i gave you and see if it works.
Re: VB Flash Player in webbrowser
you could use your default browser(iexplorer, firefox, maxthone) and a vb.net application to control the mouse and keyboard to autosurf to videos, my ebook has codes for that.
Re: VB Flash Player in webbrowser
best and most effective way is to copy a youtube link,
replace the "watch? part with "" (nothing) and replace the "v=" with "v/"
then let the browser navigate to that new link. the video will be displayed perfectly.