|
-
Feb 28th, 2011, 12:58 PM
#1
Thread Starter
Junior Member
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
-
Feb 28th, 2011, 01:12 PM
#2
Addicted Member
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...
Last edited by 7777; Feb 28th, 2011 at 01:49 PM.
-
Feb 28th, 2011, 02:46 PM
#3
Thread Starter
Junior Member
Re: VB Flash Player in webbrowser
 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
-
Feb 28th, 2011, 03:42 PM
#4
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>"
-
Feb 28th, 2011, 04:20 PM
#5
Thread Starter
Junior Member
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
-
Feb 28th, 2011, 04:21 PM
#6
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 ?
Last edited by BlindSniper; Feb 28th, 2011 at 04:25 PM.
-
Mar 1st, 2011, 03:32 PM
#7
Thread Starter
Junior Member
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.
-
Mar 1st, 2011, 05:06 PM
#8
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.
-
Mar 1st, 2011, 06:35 PM
#9
Banned
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.
-
Nov 21st, 2012, 05:01 AM
#10
New Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|