opentok / cordova-plugin-opentok

Cordova Plugin for OpenTok - add webrtc video to your iOS or Android App
MIT License
30 stars 80 forks source link

Browser haven´t support to WebRTC #106

Closed brunosoune closed 6 years ago

brunosoune commented 6 years ago

I have the error "Browser haven´t support to WebRTC" to IOS

I added the plugin cordova-plugin-opentok and the npm install --save @opentok/client to use @opentok/client/dist/js/opentok.min.js on html...

It work fine to desktop web browser, safari browser in iphone and compiled app android. But in compiled app iphone occur the error above.

msach22 commented 6 years ago

The iOS webview does not support webrtc so you cannot use the JS SDK to run it in an iOS app. You have add this plugin and use the JS wrapper from this plugin to run OpenTok on your iOS app

brunosoune commented 6 years ago

plugins\cordova-plugin-opentok\www\opentok.js ? I should use this to android too?

msach22 commented 6 years ago

Yes, that's correct! You can use the JS SDK and run it in an Android WebView, but I recommend sticking with the plugin so you can leverage the native SDKs.

brunosoune commented 6 years ago

Ok @msach22

I'll try your recommendation and I'll post any result here.

Thanks a lot

msach22 commented 6 years ago

@brunosoune Since this is not an issue with the plugin, I'm going to close this issue. Please feel free to re-open if you have issues using the plugin!

brunosoune commented 6 years ago

@msach22 the same code wich work using JS SDK, also work using JS wrapper opentok.js?

msach22 commented 6 years ago

@brunosoune Yes, it should be working. I recommend checking out the samples here: https://github.com/opentok/opentok-cordova-samples/

brunosoune commented 6 years ago

In your samples you use this way:

session.connect(token, function() { // publish to the session session.publish(publisher); }); But in tokbox's examples is: session.connect(token, function(error) { if (error) { console.log(error.message); } else { session.publish(publisher); } });

There are some difference use the if (error).... ?

msach22 commented 6 years ago

@brunosoune Yes, it looks like the error handler on the cordova js wrapper is not firing. I'll file an issue and try to patch it in the next release. You should be able to use it without adding the error handler.

msach22 commented 6 years ago

Here's the issue: https://github.com/opentok/cordova-plugin-opentok/issues/107

brunosoune commented 6 years ago

ok @msach22

thanks