Twilio-video.js: Is there a quick way to check if the browser is supported without actually connecting to a call?

Created on 15 Aug 2017  路  9Comments  路  Source: twilio/twilio-video.js

I want to provide a custom "test" page that my users can load in order to check if their browser is supported. I do not need to check network conditions, just browser support. Is there a way to perform this check with the SDK without actually connecting to a call?

enhancement question

All 9 comments

Hi @dannycohn ,

You can use the following snippet:

function isRTCPeerConnectionSupported() {
  return typeof RTCPeerConnection !== 'undefined'
    || typeof webkitRTCPeerConnection !== 'undefined'
    || typeof mozRTCPeerConnection !== 'undefined';
}

function isGetUserMediaSupported() {
  return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia)
    || !!(navigator.getUserMedia)
    || !!(navigator.webkitGetUserMedia)
    || !!(navigator.mozGetUserMedia);
}

function isWebRTCSupported() {
  return isGetUserMediaSupported() && isRTCPeerConnectionSupported();
}

@dannycohn ,

Do you think that it will be useful for you if our SDK provided a way to check for browser support. Do you have any suggestions on how that might look? Please feel free to respond with your thoughts.

Thanks,

Manjesh Malavalli

Yes I think it would be extremely valuable. I'm not even sure that the code snippet you provided would provide enough confidence. That snippet returns true on Safari 11, but with 1.2.0, Safari 11 doesn't work. I would think that a check that is provided by the SDK that can confirm specifically that the loaded SDK supports the current browser would be very helpful.

I want to test for browser support as soon as the page loads, and notify the user immediately if it is not supported, rather than wait until a call starts.

I guess I just imagined something along the lines of Video.isBrowserSupported(). It could either return a boolean, or if you want to indicate experimental support, an enum value indicating the level of support.

@dannycohn ,

Thank you for the detailed response. Regarding Safari, we just released [email protected] that has experimental Safari support (CHANGELOG).

Regarding your suggestion, we were thinking of something similar, although it would just be a boolean property instead of a function. We will get back to you on implementing that check soon.

Thanks,

Manjesh Malavalli

That makes sense. Thanks. I look forward to updates on this!

Sorry to be a bother, but any movement on this?

Hi @dannycohn ,

We are planning to begin work on this next week. I'll keep you posted.
Thanks for checking in.

Manjesh Malavalli

Hi @dannycohn ,

We have added Video.isSupported flag. Please refer to the above pull request for details.
It will be formally released as part of [email protected]. Feel free to try it out and let me know if you have any further questions.

Thanks,

Manjesh Malavalli

This was released as part of twilio-video.[email protected].

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julien-l picture julien-l  路  4Comments

himichaelroberts picture himichaelroberts  路  3Comments

antonlive picture antonlive  路  5Comments

altescape picture altescape  路  3Comments

kumail-raza picture kumail-raza  路  5Comments