Przeglądaj źródła

do not throw error when attaching audio stream to hidden element on Safari

dev1
isymchych 10 lat temu
rodzic
commit
7c3ea3984d
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3
    2
      modules/RTC/RTCUtils.js

+ 3
- 2
modules/RTC/RTCUtils.js Wyświetl plik

@@ -543,8 +543,9 @@ var RTCUtils = {
543 543
                             return;
544 544
                         }
545 545
 
546
-                        if (!elSel.is(':visible')) {
547
-                            throw new Error('video element must be visible to attach the stream');
546
+                        var isVideoStream = !!stream.getVideoTracks().length;
547
+                        if (isVideoStream && !elSel.is(':visible')) {
548
+                            throw new Error('video element must be visible to attach video stream');
548 549
                         }
549 550
 
550 551
                         attachMediaStream(elSel[0], stream);

Ładowanie…
Anuluj
Zapisz