WebBrowser stops responding to embedded video player controls.

iosys

Member
Joined
Apr 6, 2006
Messages
7
Programming Experience
5-10
This is very simple to reproduce on my end.

Insert a WebBrowser control and set the URL to "youtube.com". Click on a video there and start watching it. You can use the controls on the video player only once, and then it will not work. For example, change the volume, then try changing the volume again. The same thing happens with google video. It doesn't seem to happen with embedded windows media player or games at pogo.com.

What's going on here?
 
Click somewhere in webpage outside the flash to change focus, then it'll work again, but still only for one more click, where you may do the same again. Not a good solution indeed, and I know no explanation for neither the bug nor the quickfix. Searching the web only throws up one other forum question about the same which was not answered.
 
Flash Button in WebBrowserControl - Must click outside of flash to work?!?!?!

Hello, all.

I am trying to use flash within the webbrowser control, but for some reason, you must mouseclick outside of flash (anywhere on the surrounding html page) before the buttons will work. I have to click outside first before everysingle flash mouseclick of the button.

Is there anyway to fix this?

Thanks.

-kaanuki-
 
Did iosys submit the bug report to Microsoft about this issue? If not maybe you kaanuki should look into this?
 
According to my findings, there is a problem with the new webbrowser and Flash. This problem was reported and has been known for over a year now. The only work around is by using the old Active X webrbowser.

How or Why they would let this problem linger on is beyond me.
 
Does anyone know if this was fixed in SP1? I don't see anything about it in the release notes. I'm currently downloading SP1, but it will take awhile.
 
The service pack did not correct the problem, but the subclassing work around does work.

Imports System
Imports System.Collections.Generic
Imports System.Text

Public Class ExtendedWebBrowser
Inherits System.Windows.Forms.WebBrowser
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case &H201, &H204, &H207, &H21 ' WM_LMOUSEBUTTON
MyBase.DefWndProc(m)
Return
End Select
MyBase.WndProc(m)
End Sub 'WndProc
End Class
 
Last edited:
help

can someone please upload a project with the workaround embedded, or remind me how to do it. I can't for the life of me work out how to enter this code.

VB.NET:
Imports System
Imports System.Collections.Generic
Imports System.Text

    Public Class ExtendedWebBrowser
        Inherits System.Windows.Forms.WebBrowser
        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
            Select Case m.Msg
                Case &H201, &H204, &H207, &H21 ' WM_LMOUSEBUTTON
                    MyBase.DefWndProc(m)
                    Return
            End Select
            MyBase.WndProc(m)
        End Sub 'WndProc
    End Class
 
Add a class to your project and use this code. Build and go to Toolbox where it now lists under "Your-Application components" tab. I can confirm it fixes the browser-flash bug.
 
Back
Top