views:

9

answers:

0

Hi,

This is a difficult question to ask and answer, because it involves a lot of components. I would appreciate it however if any suggestions can be made.

I have a vb.net forms application that has a form containing a webbrowser control. This control i feed a URL with a flash applet. The flash applet's purpose is to start the user's webcam, open a stream to a streaming server (in this case wowza media server), and send out the user's video.

All that works great. The issue is when i close the form with the webbrowser control. The flash applet keeps sending its stream out indefinitely, until i close my entire application. I don't know who is keeping the stream open.

This is some vb.net code that i was hoping took care of the problem, but it doesn't:

Private Sub Record_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
    wbBrowser.Url = New Uri("file:///C:/myfolder/dummy.htm")
    wbBrowser.GoHome()
    wbBrowser.Navigate(New Uri("file:///C:/myfolder/dummy.htm"))
    wbBrowser.Stop()
    wbBrowser.Dispose()
    Me.Controls.Remove(wbBrowser)
End Sub

As you can see, i try every way i can think of to make the old page in the browser control invalid, and even remove the component itself. Nothing helps. (The reason i move to another page, is because in regular internet explorer, moving away to another url does close the stream. Just closing the tab window, doesn't close the stream either.)

Does anyone have any experience or solution? I'm fluent enough in actionscript, javascript and .net to try many things out.