Sfoglia il codice sorgente

Fixes setAvailableDevices on error, passing no stream.

master
damencho 9 anni fa
parent
commit
e8b9199c53
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3
    3
      modules/RTC/RTCUtils.js

+ 3
- 3
modules/RTC/RTCUtils.js Vedi File

@@ -302,8 +302,8 @@ function getConstraints(um, options) {
302 302
  * @param stream the stream we received from calling getUserMedia.
303 303
  */
304 304
 function setAvailableDevices(um, stream) {
305
-    var audioTracksReceived = !!stream.getAudioTracks().length;
306
-    var videoTracksReceived = !!stream.getVideoTracks().length;
305
+    var audioTracksReceived = stream && !!stream.getAudioTracks().length;
306
+    var videoTracksReceived = stream && !!stream.getVideoTracks().length;
307 307
 
308 308
     if (um.indexOf("video") != -1) {
309 309
         devices.video = videoTracksReceived;
@@ -918,7 +918,7 @@ var RTCUtils = {
918 918
                     success_callback(stream);
919 919
                 },
920 920
                 function (error) {
921
-                    setAvailableDevices(um, stream);
921
+                    setAvailableDevices(um, undefined);
922 922
                     logger.warn('Failed to get access to local media. Error ',
923 923
                         error, constraints);
924 924
 

Loading…
Annulla
Salva