EricssonResearch / bowser

A WebRTC browser for iOS developed in the open
BSD 2-Clause "Simplified" License
208 stars 65 forks source link

WebRtc detection in Bowser doesn't work #64

Closed truestep closed 8 years ago

truestep commented 8 years ago

I read in the doc that webrtc detection will not before owr.js will be injected. So I have following function for detecting the webrtc features in bowser

var isWebRTCSupported;
var detectWebRTCBowser = function()
{
 isWebRTCSupported = (!!window.webkitRTCPeerConnection || !!window.mozRTCPeerConnection)
if (isWebRTCSupported)
 {
    return;
 }
else
 {
   setTimeout(detectWebRTCBowser , 1000);
 }
}
$(window).load(function () {
 detectWebRTCBowser();
});

It doesn't work. If it can't detect webrtc from the first time it'll never detect it. And if it's detectabe it'll detected from the first time. Also what is important I think is that: when you launch bowser for the first time and load the page it never detects webrtc. If to refresh the page it'll detect it. And all ongoing sessions it'll work, untill you realunch the bowser. How to correctly implement webrtc detection in bowser?

truestep commented 8 years ago

What I just discovered is that owr.js is not injected sometimes. Especially looks like this is happens after bowser crashes and you launch it again. Can I just inject http://localhost:10717/owr.js to my html myself? Or how to deal with this?

stefanalund commented 8 years ago

I would recommend having a look at this PR https://github.com/EricssonResearch/bowser/pull/61

We are moving to WKWebView which makes the JavaScript injection of owr.js robust (there is a proper API for injection).

truestep commented 8 years ago

With this PR webrtc detection works fine. I merged it locally with current master branch. But now video sending and receiving doesn't work. I see alot of HTTP GETs to 127.0.0.1:21428/__JAflv/{alotofsymbols} when sending video from bowser. Is it ok? What I noticed here is that my ajax stopped to work after this GETs start.

Also When I try to send video from safari wirth plugin and latest daemon from openwebrtc I got: ERROR: owr_transport_agent.c:1522:prepare_transport_bin_send_elements: assertion failed: (scream_queue) Abort trap: 6

stefanalund commented 8 years ago

That has been fixed in a newer version of OpenWebRTC. Could you please update and re-build?

stefanalund commented 8 years ago

The Issue specified in the title is fixed. If you have other problems please open a new Issue. Closing, thanks.