mirror of https://github.com/dani/vroom.git
Move capabilities detection earlier
This commit is contained in:
parent
b5a87581d5
commit
b962a9e384
|
@ -716,7 +716,18 @@ function initJoin(room){
|
|||
}
|
||||
data.config.localVideoEl = 'webRTCVideoLocal';
|
||||
webrtc = new SimpleWebRTC(data.config);
|
||||
initVroom(room);
|
||||
// If browser doesn't support webRTC or dataChannels
|
||||
if (!webrtc.capabilities.support || !webrtc.capabilities.supportGetUserMedia || !webrtc.capabilities.supportDataChannel){
|
||||
$('.connecting-msg').not('#no-webrtc-msg').remove();
|
||||
$('#no-webrtc-msg').slideDown();
|
||||
}
|
||||
else{
|
||||
// Hide screen sharing btn if not supported, disable it on mobile
|
||||
if (!webrtc.capabilities.supportScreenSharing || !$.browser.desktop){
|
||||
$('.btn-share-screen').remove();
|
||||
}
|
||||
initVroom(room);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -749,17 +760,6 @@ function initVroom(room) {
|
|||
|
||||
$('#name_local').css('background-color', peers.local.color);
|
||||
|
||||
// If browser doesn't support webRTC or dataChannels
|
||||
if (!webrtc.capabilities.support || !webrtc.capabilities.supportGetUserMedia || !webrtc.capabilities.supportDataChannel){
|
||||
$('.connecting-msg').not('#no-webrtc-msg').remove();
|
||||
$('#no-webrtc-msg').slideDown();
|
||||
}
|
||||
|
||||
// Hide screen sharing btn if not supported, disable it on mobile
|
||||
if (!webrtc.capabilities.supportScreenSharing || !$.browser.desktop){
|
||||
$('.btn-share-screen').remove();
|
||||
}
|
||||
|
||||
// Return the number of peers in the room
|
||||
function countPeers(){
|
||||
var count = Object.keys(peers).length;
|
||||
|
|
Loading…
Reference in New Issue