Twilio-video.js: Importing Twilio-Video breaks page in Firefox 70+ with RTC disabled

Created on 20 Nov 2019  路  17Comments  路  Source: twilio/twilio-video.js

  • [x] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in the CHANGELOG.md.
  • [x] I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • [x] I verified that the Quickstart application works in my environment.
  • [x] I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

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:

  • Browser(s): Firefox 70+
  • Operating System: Linux, but likely all
  • twilio-video.js: 2.0.0-beta15
  • Third-party libraries (e.g., Angular, React, etc.): not relevant
bug filed

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:

image

All 17 comments

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

  • Firefox 74.0
  • Twilio video 2.0.0-beta16
  • Mac OS Mojave 10.14.6

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:

image

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.enabled set to false in about:config

Thanks,
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

Was this page helpful?
0 / 5 - 0 ratings