Openvidu-insecure-angular 2.14 issue

I have been working through the openvidu tutorials and having some struggles. I am new to working with live streaming.

When I run openvidu-insecure-angular 2.14 on my windows box (I did make the suggested changes per the FAQ), the desktop chrome browser window does not show the video even though the DOM element is <video autoplay="" id="local-video-undefined"></video>.

When I log in from my mobile phone (Android) to https://:4200, mobile camera stream appears correctly in the desktop browser with the DOM <video autoplay="" id="remote-video-str_CAM_YrQM_con_Z6XaSaNGRQ"></video> on the right-hand side. On the mobile chrome browser both videos appear as expected.

What could be causing the desktop browser to not display the this.publisher video steam? I am running insecure-angular with ng serve --ssl --ssl-key … --ssl-cert … --host 0.0.0.0.

Thanks,

Aaron

I did a little more digging and tried a few changes in the code. I noticed the Session::publish class method did not return when I had “let result = await this.session.publish(publisher)”, even though the docs says it returns a promise. I wonder if there is a bug in this section on code.

 try {
      result = await this.session.connect(token, {...});
      publisher = this.OV.initPublisher('publisher', {
        audioSource: undefined,
        videoSource: undefined,
        publishAudio: true,
        publishVideo: true,
        resolution: '640x480',
        frameRate: 30,
        insertMode: 'APPEND',
        mirror: false
      });
      result = await this.session.publish(publisher);
      this.publisher = publisher;
    } catch(ex) {
      ...
    }

A little more digging into the openvidu-browser code, I single stepped through session.publish and came to “_this.ee.once(‘stream-ready-to-publish’, function() {…})” in Stream.js. That event never occurred so the callback was not called and the promise was not resolved. Could this indicate I setup something wrong somewhere?

Thanks,

Aaron

Have you accepted self-signed certificate in the browser?

Do you have Docker Toolbox or Docker Desktop for Windows?

Hi,

Yes. This is on a windows box. I have Docker Desktop. I made the changes per the FAQ:

  1. Ran container with “docker run -p 4443:4443 --rm -e OPENVIDU_SECRET=MY_SECRET -e DOMAIN_OR_PUBLIC_IP=192.168.1.231 openvidu/openvidu-server-kms:2.14.0”

  2. Changed in app.component.ts to have OPENVIDU_SERVER_URL = ‘https://192.168.1.231:4443’;

  3. Ran ng serve with “ng serve --ssl --ssl-key c:\projects\openvidu-tutorials\key.pem --ssl-cert c:\projects\openvidu-tutorials\cert.pem --host 0.0.0.0”

I can goto https://192.168.1.231:4443 for OpenVidu and I can go to https://192.168.1.231:4200 for the demo. What is weird is when I go to the site with my android phone the broadcast starts up correctly, but when I go from my desktop chrome or the new edge browser the broadcast does not start-up. I traced it down to that ‘stream-ready-to-publish’ event handler is never called.

Thanks,

Aaron

If you have Docker Desktop, then you can connect to OpenVidu using 127.0.0.1 instead of 192.168.1.231. Using 127.0.0.1 I thing allows you to avoid using certificates.

But if you want to use also your mobile phone, then you have to use the public IP… But we never test that setup on windows, only on linux and mac.

Regards

Thanks. I tried it on a nearby desktop and it worked.

For some reason when the browser is running on the same machine that event did not occur on my machine. I tried 127.0.0.1 for the docker connection but the same issue happened.

Aaron

1 Like