Skip to content

Commit 77124e5

Browse files
Demonstrating the usage of the isSupported flag. (#124)
1 parent 5981a29 commit 77124e5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"prismjs": "^1.6.0",
6060
"stackblur-canvas": "^1.4.0",
6161
"twilio": "^3.19.1",
62-
"twilio-video": "^2.1.0"
62+
"twilio-video": "^2.4.0"
6363
},
6464
"devDependencies": {
6565
"browserify": "^14.3.0",

quickstart/src/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
const { isSupported } = require('twilio-video');
4+
35
const { isMobile } = require('./browser');
46
const joinRoom = require('./joinroom');
57
const micLevel = require('./miclevel');
@@ -46,7 +48,7 @@ const connectOptions = {
4648
// using Peer-to-Peer Rooms, so you can comment this line.
4749
preferredVideoCodecs: [{ codec: 'VP8', simulcast: true }],
4850

49-
// For desktop browsers, capture 720p video @ 24 fps.
51+
// Capture 720p video @ 24 fps.
5052
video: { height: 720, frameRate: 24, width: 1280 }
5153
};
5254

@@ -146,4 +148,8 @@ async function selectMicrophone() {
146148
return selectCamera();
147149
}
148150

149-
window.addEventListener('load', selectMicrophone);
151+
// If the current browser is not supported by twilio-video.js, show an error
152+
// message. Otherwise, start the application.
153+
window.addEventListener('load', isSupported ? selectMicrophone : () => {
154+
showError($showErrorModal, new Error('This browser is not supported.'));
155+
});

0 commit comments

Comments
 (0)