From ef08fa7b59653441ead8528499ea42f9cb63c7a7 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 12 Feb 2015 19:08:20 +0100 Subject: [PATCH] Use capabilities to detect feature And allow Firefox to use screen sharing --- public/js/vroom.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index 7e035b6..f384612 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -600,16 +600,16 @@ function initVroom(room) { $('#name_local').css('background-color', peers.local.color); - // Screen sharing is only suported on chrome desktop > 26 - if ( !$.browser.webkit || $.browser.android || $.browser.versionNumber < 26 ) { - $('#shareScreenLabel').remove(); - } - // If browser doesn't support webRTC or dataChannels - if (!webrtc.capabilities.support || !webrtc.capabilities.supportDataChannel){ + if (!webrtc.capabilities.support || !webrtc.capabilities.supportGetUserMedia || !webrtc.capabilities.supportDataChannel){ $('#noWebrtcSupport').modal('show'); } + // Hide screen sharing btn if not supported + if (!webrtc.capabilities.supportScreenSharing){ + $('#shareScreenLabel').remove(); + } + // Return the number of peers in the room function countPeers(){ var count = Object.keys(peers).length;