Welcome Guest Search | Active Topics | Sign In | Register

WebBrowser (WinForm) & video/audio (WebRTC) 'Could not start video source' DOMException Options
Assertus
Posted: Wednesday, April 15, 2020 6:42:32 PM
Rank: Newbie
Groups: Member

Joined: 4/15/2020
Posts: 1
Hi. We have a WinForm that implements the EO.WebBrowser that after opening, the browser navigate to a web application that has a real-time video chat feature (utilizing WebRTC). We noticed that in some cases (notebooks specifically), after 3-4 retries (closing WinForm and re-opening), the web application its able to connect and use peripherals (camera & mic) successfully, and others cases its unable (throwing a DOMException with: 'Could not start video source'). However, if we copy the URL and paste it (instead using EO.WebBrowser) to a Chrome browser, the application runs successfully and always connect to the camera and mic at first time.
**As note; before closing the WinForm, we have code to dispose all objects (webview & webcontrol) and manage the EventHandler for RequestPermissions (e.Allow()) as well.

Code: C#
void DisposeWebView()
{
            this.webView1.Close(true);
            this.webView1.Destroy();
            this.webView1.Dispose();
            this.webControl1.WebView.Close(true);
            this.webControl1.WebView.Destroy();
            this.webControl1.WebView.Dispose();
            this.webControl1.Dispose();
            this.Dispose();
}


Code: C#
private void webView1_RequestPermissions(object sender, RequestPermissionEventArgs e)
        {
            e.Allow();
        }


In summary, the EO.WebBrowser does not guarantees us that will be accurate in all machines at all time.
Do you have some idea what its happening?
Some issue with the current WebBrowser Chromium version (v77)?

Machines: MS Surface, HP Pavilion x360 Convertible 15-cr0xxx
EO.WebBrowser & EO.WebBrowser.WinForm versions: 20.0.81

eo_support
Posted: Thursday, April 16, 2020 11:33:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

This may have to do with focus or user gesture check. The difference between your application and Chrome is probably that when you enter the Url in Chrome, the tab has already completely initialized and already has focus. However in your application you maybe creating the new WebView and try to immediately load the Url. At that point either some part of the WebView is not completely initialized (many internal components are initialized asynchronously), or certain features have failed to start due to user gesture check (for example, auto audio playing may fail unless there was recent user interaction on the WebView). As such you can try two things:

1. Delay your Url loading by a short time period;
2. Set this property to true:

https://www.essentialobjects.com/doc/eo.webengine.engineoptions.bypassusergesturecheck.aspx

For example, you can set it like this on your application start:

Code: C#
EO.WebEngine.EngineOptions.Default.BypassUserGestureCheck = true;


If this still does not resolve the issue for you, we will need you to create a test project so that we can investigate further. You can find more information on how to send test project to us here:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.