Results 1 to 10 of 10

Thread: VB Flash Player in webbrowser

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    25

    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

  2. #2
    Addicted Member
    Join Date
    Oct 2009
    Posts
    212

    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.
    Have you tried Google?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    25

    Re: VB Flash Player in webbrowser

    Quote Originally Posted by 7777 View Post
    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

  4. #4
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    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>"

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    25

    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

  6. #6
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    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.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    25

    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.

  8. #8
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    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.

  9. #9
    Banned
    Join Date
    Mar 2009
    Posts
    764

    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.

  10. #10
    New Member
    Join Date
    Nov 2012
    Posts
    1

    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
  •  



Click Here to Expand Forum to Full Width