Code to reproduce the issue:
import TwilioVideo from 'twilio-video'
...in Firefox 70+ with media.peerconnection.enabled set to false in about:config.
Expected behavior:
Twilio SDK should see that WebRTC is not available and still allow other functions on the page to work.
Actual behavior:
Entire page is brought down _at import time_ by undefined reference to global mozRTCSessionDescription (https://github.com/twilio/twilio-webrtc.js/issues/106).
When I tried patching around this, I hit another undefined reference to RTCPeerConnection.
These references both need to be fixed to ensure importing Twilio-Video, even when WebRTC is disabled, doesn't break non-call related functions on the page. The simplest fix would seem to be accessing both via window.
Software versions:
Thank you for finding and reporting this issue @graue!
I have filed a bug for this - we should get to this soon. (JSDK-2591)
Thanks,
Makarand
Fixed in 2.0.0-beta16 release (https://github.com/twilio/twilio-video.js/releases/tag/2.0.0-beta16).
I faced this same issue again. When importing the library it fails and doesn't allow the normal execution.
TypeError: 'get peerIdentity' called on an object that does not implement interface RTCPeerConnection.
Versions
Weirdest stuff is this happens in my EmberJS app and not in the Svelte one
Using the CDN version let me continue "importing" twilio-video although the error still shows up.
TypeError: 'get peerIdentity' called on an object that does not implement interface RTCPeerConnection. twilio-video.min.js:55:5388
@makarandp0 getting this error again in Firefox
Unhandled Rejection (TypeError): 'get peerIdentity' called on an object that does not implement interface RTCPeerConnection.
firefox version : 76.0.1 64bit
twilio-video : 2.0.1
Mac OS Mojave: 10.14.6
facing same issue. any fix for this issue?
@deep-link Use Twilio CDN to fix this issue
@deep-link I could use the NPM package by importing it this way:
import * as Video from 'twilio-video/dist/twilio-video';
BTW, using the CDN still shows the error but let's your app keep working.
Still occurs in firefox 78, twilio-video 2.7.0.
Still occurs on Firefox 80, twilio-video 2.7.2. I'm using twilio-video with create-react-app.
This issue doesn't appear for me until switching to Firefox's built-in mobile emulator, and then I get the following error:

This is still happening on firefox 86 and twilio-video 2.10.0.
sorry for super late reply on this. @marcelloma - Can you give me some repro steps. I am sure I am missing something - I tried loading twilio-video on Firefox 86 and did not see this error - even with media.peerconnection.enabled set to false in about:config
Thanks,
Makarand
sorry for super late reply on this. @marcelloma - Can you give me some repro steps. I am sure I am missing something - I tried loading twilio-video on Firefox 86 and did not see this error - even with
media.peerconnection.enabledset to false in about:configThanks,
Makarand
Have you tried in Responsive Design Mode with some phone selected?
Thanks @Galzk for the screen recording. Got the repro now. Very interesting that Firefox does this :). I have opened an internal ticket (VIDEO-4654) to track this issue. We should be able to get to it soon.
Thanks,
Makarand
Hello @Galzk, This issue is fixed in 2.14.0 - There are also other significant improvements in 2.14.0. Please check it out!
Thanks
Makarand
Most helpful comment
Still occurs on Firefox 80, twilio-video 2.7.2. I'm using twilio-video with create-react-app.
This issue doesn't appear for me until switching to Firefox's built-in mobile emulator, and then I get the following error: