diff options
author | Joas Schilling <coding@schilljs.com> | 2018-05-04 12:01:46 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-05-09 12:50:27 +0300 |
commit | 319c8017e5579a4f9029f6856b10901f5e2439c4 (patch) | |
tree | 10d0779bf181d3cdb5c418b3829e40ac365eece4 /js/webrtc.js | |
parent | 18097da5d12279eeb4f34143495580cb47d175a3 (diff) |
Join the call only aftrer media access was done
When we delayed the media access, we were all fast with testing.
Before this patch, when there was already at least one user in the
call and you took longer to accept the media request than webrtc
took to init everything, you would always send a black video signal
and no sound, because the data was not there, when connections were
established with the other users. Now we first request the media and
send the join call to the server afterwards.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'js/webrtc.js')
-rw-r--r-- | js/webrtc.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/js/webrtc.js b/js/webrtc.js index 26b4a08c8..0d0b15c4e 100644 --- a/js/webrtc.js +++ b/js/webrtc.js @@ -188,15 +188,6 @@ var spreedPeerConnectionTable = []; app.signaling.on('leaveCall', function () { webrtc.leaveCall(); }); - app.signaling.on('joinCall', function (token) { - app.setEmptyContentMessage( - 'icon-video-off', - t('spreed', 'Waiting for camera and microphone permissions'), - t('spreed', 'Please, give your browser access to use your camera and microphone in order to use this app.') - ); - - webrtc.joinCall(token); - }); webrtc = new SimpleWebRTC({ localVideoEl: 'localVideo', @@ -219,6 +210,16 @@ var spreedPeerConnectionTable = []; }); OCA.SpreedMe.webrtc = webrtc; + OCA.SpreedMe.webrtc.startMedia = function (token) { + app.setEmptyContentMessage( + 'icon-video-off', + t('spreed', 'Waiting for camera and microphone permissions'), + t('spreed', 'Please, give your browser access to use your camera and microphone in order to use this app.') + ); + + webrtc.joinCall(token); + }; + var spreedListofSpeakers = {}; var spreedListofSharedScreens = {}; var latestSpeakerId = null; |