Temasys / SkylinkJS

SkylinkJS Javascript WebRTC SDK
http://skylink.io/web
Other
275 stars 57 forks source link

Skylink not working some error at skylink.js #226

Closed jonasmedeiros closed 8 years ago

jonasmedeiros commented 8 years ago

Look the error, I have the same code runing with simplewebrtc working fine.

adapter.min.js:2 Uncaught NotSupportedError: Failed to execute 'createOffer' on 'RTCPeerConnection': Unsatisfiable constraint iceRestartwebkitRTCPeerConnection.(anonymous function) @ adapter.min.js:2(anonymous function) @ skylink.min.js:4checkMediaDataChannelSettings @ adapter.min.js:2Skylink._doOffer @ skylink.min.js:4Skylink._addPeer @ skylink.min.js:3Skylink._welcomeHandler @ skylink.min.js:6Skylink._processSingleMessage @ skylink.min.js:5Skylink._processSigMessage @ skylink.min.js:5(anonymous function) @ skylink.min.js:5Emitter.emit @ skylink.complete.min.js:2Socket.onevent @ skylink.complete.min.js:2Socket.onpacket @ skylink.complete.min.js:2(anonymous function) @ skylink.complete.min.js:2Emitter.emit @ skylink.complete.min.js:2Manager.ondecoded @ skylink.complete.min.js:2(anonymous function) @ skylink.complete.min.js:2Emitter.emit @ skylink.complete.min.js:2Decoder.add @ skylink.complete.min.js:4Manager.ondata @ skylink.complete.min.js:2(anonymous function) @ skylink.complete.min.js:2Emitter.emit @ skylink.complete.min.js:2Socket.onPacket @ skylink.complete.min.js:2(anonymous function) @ skylink.complete.min.js:2Emitter.emit @ skylink.complete.min.js:2Transport.onPacket @ skylink.complete.min.js:2Transport.onData @ skylink.complete.min.js:2ws.onmessage @ skylink.complete.min.js:3

jonasmedeiros commented 8 years ago

screen shot 2016-05-17 at 2 45 04 pm

jonasmedeiros commented 8 years ago

Test is using Opera browser, sometimes safari sometimes firefox, I use temasys plugin for safari.

oooookk7 commented 8 years ago

Hi @gunsline2, which version of SkylinkJS are you using?

This issue seems to be something that has already been rectified in release 0.6.11, but it's advisable to upgrade to release 0.6.12.

jonasmedeiros commented 8 years ago
<script src="https://cdn.temasys.com.sg/adapterjs/0.11.x/adapter.debug.js"></script>

<script src="https://cdn.temasys.com.sg/skylink/skylinkjs/0.6.12/skylink.complete.min.js"></script>

skylink = new Skylink();

      //Temasys Adapter for Not native WebRTC browsers
      AdapterJS.webRTCReady(function() {

        skylink.init('free_account');
        skylink.joinRoom('room-4', {
          userData:'somename',
          audio: true,
          video: true
        });

      });
oooookk7 commented 8 years ago

Hi @gunsline2,

Based on your code above, it seems like you re-referencing AdapterJS which the bundled script of SkylinkJS skylink.complete.js does that already. The bundled version contains the AdapterJS and socket.io-client dependency it requires and follows. It's only the skylink.debug.js script where you require to reference both the AdapterJS and socket.io-client dependencies.

SkylinkJS 0.6.12 uses AdapterJS 0.13.3 as a heads up.

Additionally, SkylinkJS init() function already takes care of the AdapterJS.webRTCReady part so you don't have to call the method.

Here's how it should be for an example:

<script src="https://cdn.temasys.com.sg/skylink/skylinkjs/0.6.12/skylink.complete.min.js"></script>

var skylink = new Skylink();

skylink.init('free_account', function (err, success) {
  if (err) return;

  skylink.joinRoom('room-4', {
     userData:'somename',
     audio: true,
     video: true
  });
});

You can try the getaroom.io demo which currently uses SkylinkJS version 0.6.12.

oooookk7 commented 8 years ago

Btw, we have an article on how to setup SkylinkJS which may be useful for you https://temasys.com.sg/getting-started-with-webrtc-and-skylinkjs/

oooookk7 commented 8 years ago

Hi @gunsline2, did you managed to resolve your issue?

oooookk7 commented 8 years ago

Hi @gunsline2, I assume you have resolved your issue since following up this issue #231. If that is so, I would close this ticket.

jonasmedeiros commented 8 years ago

Hi @letchoo Yes was the version thanks

oooookk7 commented 8 years ago

Thanks! I'll close this ticket then.

ApurvaKunkulol commented 7 years ago

So the $(document).ready() function is not needed, for the JS code, right? I always face this issue where the skylink.min.js script is not found at all. Any help would be appreciated. Thanks.

image

oooookk7 commented 7 years ago

Hi @ApurvaKunkulol, this seems to be your app key configuration. Note that 404 is directed to the platform server URL. Check the CORS url field configuration on your app key.

ApurvaKunkulol commented 7 years ago

@letchoo Thanks for the prompt reply. I have defined my CORS url as below:

localhost,polls_1 Is this how it should be defined. I am just trying out the Web SDK of Temasys, hence the localhost. Please point out any mistake that might have been made. Thanks.

oooookk7 commented 7 years ago

@ApurvaKunkulol are you connecting from https://localhost/ or https://polls_1? If you are for example am connecting from https://www.app.com or https://192.168.1.5 (CORS URL app.com,192.168.1.5).

ApurvaKunkulol commented 7 years ago

@letchoo I am connecting from localhost. Example URL: http://localhost:8000/polls_1/ In this case how should it be specified?

oooookk7 commented 7 years ago

@ApurvaKunkulol localhost is required only. /polls_1 is the path, :8000 is the port and http:// is the protocol. A recommendation is just the domain name itself that is required.

ApurvaKunkulol commented 7 years ago

That clears a lot. Thanks. Also I have another question, in the skylink.init() function, which one should be included the "KEYID" or the "secret" in the "apikey" part as shown below: skylink.init({ apiKey:"xxxxxxxx", defaultRoom: "Apurva's Chat room." }, function(){ skylink.joinRoom({ audio: true, video: true }); });

oooookk7 commented 7 years ago

@ApurvaKunkulol "KEYID" (app key ID) is for the appKey (or the older format apiKey) you configure in the init() method. The "secret" is used for generating a hash (which we recommend from the web server end) which can be used to authenticate the platform usage instead of using CORS domain authentication. The init() method API doc should contain the segment on how the hash is generated.

ApurvaKunkulol commented 7 years ago

So this essentially means that I will have to use the "KEYID", in my app, right?

oooookk7 commented 7 years ago

@ApurvaKunkulol yes you will still require it for whatever authentication methods.

ApurvaKunkulol commented 7 years ago

Thanks a ton for taking out the time @letchoo , I highly appreciate that. I can see my own face in the browser now!! 😄