navigator.mediadevices is undefined in IE

294 views
Skip to first unread message

Milan Martinkovič

unread,
Jun 6, 2016, 12:58:26 PM6/6/16
to Temasys WebRTC Plugin
Hi,

I am trying to use navigator.mediaDevices.enumerateDevices() in IE, however debugging tool says that it is unable to get property enumerateDevices of undefined reference. I tried to directly access navigator.mediadevices and it was really undefined. This behavior could be only seen in IE, in Safari everything works fine. Can you please tell me what kind of problem it could be? Is it some kind of bug, or mediadevices is currently not supported in IE, or something different? (Im using the latest stable version of the plugin)
thank you

Milan

Jacques-Olivier Haché

unread,
Jun 6, 2016, 10:22:44 PM6/6/16
to Temasys WebRTC Plugin
Hi,

We only define mediaDevices when
- It's not already defined
- Promises are supported

As mediaDevices APIs are all promise based, there define it without promise support,

--> You should be able to get mediaDevices and its APIs by requiring any Promise library before requiring AJS.

Hope this help,
J-O

Milan Martinkovič

unread,
Jun 7, 2016, 9:44:39 AM6/7/16
to Temasys WebRTC Plugin
Hi,

thank you for your response. I think that I am not fully understanding your answer, however I have made a few more experiments to better understand the problem:
- In Safari, when the plugin(your adapter.js) is not embedded, mediadevices is not defined also in Safari. As soon as I have included your AJS mediadevices object was defined in Safari.
- On the other side - in IE - it doesnt matter if AJS is included or not, mediadevices is not defined in both cases.

I have also looked in the documentation of mediadevices API and it is not supported by Safari, neither IE. Promise object is supported in Safari but in IE it is not.
So am I right when Im saying that currently it is not possible to make mediadevices API to work in IE because of not supporting of the promise objects? You have stated that i should be able to get mediadevices before requiring AJS, but as I have already said, it looks like that in Safari it is required to include AJS and in IE it doesnt make a difference if its included or not - mediadevices is still undefined.
I hope its much more clearier right now, please let me know if I am understanding something wrong and if there is some solution to my problem.
thank you

Milan

Dňa utorok, 7. júna 2016 4:22:44 UTC+2 Jacques-Olivier Haché napísal(-a):

Jacques-Olivier Haché

unread,
Jun 7, 2016, 10:08:24 PM6/7/16
to Milan Martinkovič, Temasys WebRTC Plugin
You need to add a Promise library (bluebird, promises.js, ...) before AJS.
Adding such a library will add support for promises to your app in IE.
Once this is done, AJS will see the promises available and define mediaDevices ?

Again, this include needs to be done BEFORE AJS

Is that any clearer ?
--
You received this message because you are subscribed to the Google Groups "Temasys WebRTC Plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to temasys-discuss-webr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/temasys-discuss-webrtcplugin/a613ed50-da95-4b4f-bd48-5940753f2583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

--
Jacques-Olivier HACHÉ
Software Engineer at Temasys Communications Pte Ltd
Sg : +65 9086 3673



This email and any files transmitted with it are for the sole use of the intended recipient and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply email and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this email is strictly prohibited and may be unlawful. Thank you for your cooperation.

2016, Temasys Communications Pte Ltd, 80 Amoy Street 02-02, Singapore 069899 (www.temasys.com.sg)

Milan Martinkovič

unread,
Jun 8, 2016, 4:56:55 AM6/8/16
to Temasys WebRTC Plugin
Yes, now I see it :) i didnt undestand the part about promise library in your first answer. Now I got it and after addition of bluebird library mediadevices API works fine in IE.
thank you very much for help

Milan

Dňa streda, 8. júna 2016 4:08:24 UTC+2 Jacques-Olivier Haché napísal(-a):

Jacques-Olivier Haché

unread,
Jun 8, 2016, 5:07:10 AM6/8/16
to Temasys WebRTC Plugin
No problem :)
Reply all
Reply to author
Forward
0 new messages