Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Incompatible Browser on IOS and getUserMedia error #168

Open
ufuksuu opened this issue Jun 13, 2019 · 2 comments
Open

Incompatible Browser on IOS and getUserMedia error #168

ufuksuu opened this issue Jun 13, 2019 · 2 comments

Comments

@ufuksuu
Copy link

ufuksuu commented Jun 13, 2019

I have an error on iOS when I tried to publish my video. I have followed each step in the Running the Application section for iOS.It s working on Safari when I tried ionic serve.But on iPhone
36440023-4883e506-1634-11e8-8d31-fbb398bca384
and I saw a couple of errors on console.
Ekran Resmi 2019-06-13 10 42 48

@abhilashbr92
Copy link

@ufuksuu Even i have the same error. Did you find any solution?

@phiferd
Copy link

phiferd commented Nov 2, 2019

That happened to me when I tried to use the JS plugin (for web) rather than the cordova plugin's js file. The cordova plugin will put a new .js file in the www directory of your app, so you should include a line like this:

<script type="text/javascript" charset="utf-8" src="opentok.js"></script>

Note that the script tag references a javascript file that doesn't exist until the project is built for iOS.

If you want to be able to develop in the browser, you either need to put the web version there, or include the following

<script type="text/javascript" charset="utf-8" src="opentok.js"></script>
<script type="text/javascript">window.OT || document.write(`<script src="https://static.opentok.com/v2/js/opentok.min.js">\x3C/script>`)</script>

This extra script tag checks to see if window.OT is defined. If it is, then you're running on the device and the build must have inserted the opentok.js into www and it's basically a no-op. If window.OT is not defined, then it adds a new script tag to the document as a fallback.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants