open-webrtc-toolkit / owt-client-javascript

Open WebRTC Toolkit JavaScript SDK
https://01.org/open-webrtc-toolkit
Apache License 2.0
207 stars 124 forks source link

How to add iceServer config? #548

Open Myshny opened 2 years ago

Myshny commented 2 years ago

Hello

It missed in sample conference - how to add iceServer config to Owt.Conference.ConferenceClient?

I try this but it is not working:

const rtcConfiguration = {
      iceServers: [{
    urls: '"stun:stun.l.google.com:19302"',
  }, {
    credential: 'password',
    username: 'username',
  }],
};

    const signaling = new Owt.Conference.SioSignaling();
    var configuration =  Owt.Conference.ConferenceClientConfiguration = rtcConfiguration;
    conference = new Owt.Conference.ConferenceClient({
      audioEncodings: true,
      videoEncodings: [{
          codec: {
            name: "h264"
          }
      },
        {
          codec: {
            name: "vp9"
          }
      },
        {
          codec: {
            name: "vp8"
          }
      }],
     configuration,
},signaling);
Myshny commented 2 years ago

Could somebody help? I stuck with it.

Error: Ice procedure failed. Unhandled Promise Rejection: Error: Ice procedure failed.

jianjunz commented 2 years ago

Please create a ConferenceClient with your own configuration.

Myshny commented 2 years ago

jianjunz - Thank you for reply!

What do you mean? In my code above I assume that I created new OWT configuration?

var configuration =  Owt.Conference.ConferenceClientConfiguration = rtcConfiguration;
    conference = new Owt.Conference.ConferenceClient({
      audioEncodings: true,
      videoEncodings: [{
          codec: {
            name: "h264"
          }
      },
        {
          codec: {
            name: "vp9"
          }
      },
        {
          codec: {
            name: "vp8"
          }
      }],
     configuration,
},signaling);

This block of code?

Maybe you can share some examples? In fact im I don't know how to do this.. In IOS/Android all works fine, I add STUN servers and all is ok but in web js it's not clear for me(