Pārlūkot izejas kodu

fix(RemoteVideo): .oncanplay -> addEventListener

Replaces the .oncanplay listener with addEventListener('canplay', ...).
This is needed because third party libraries (for example callstats)
are brutally overriding the .oncanplay property and replacing our
listener.
master
Hristo Terezov 5 gadus atpakaļ
vecāks
revīzija
851976ebdf
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4
    2
      modules/UI/videolayout/RemoteVideo.js

+ 4
- 2
modules/UI/videolayout/RemoteVideo.js Parādīt failu

@@ -456,14 +456,16 @@ export default class RemoteVideo extends SmallVideo {
456 456
             return;
457 457
         }
458 458
 
459
-        streamElement.oncanplay = () => {
459
+        const listener = () => {
460 460
             this._canPlayEventReceived = true;
461 461
             this.VideoLayout.remoteVideoActive(streamElement, this.id);
462
-            streamElement.oncanplay = undefined;
462
+            streamElement.removeEventListener('canplay', listener);
463 463
 
464 464
             // Refresh to show the video
465 465
             this.updateView();
466 466
         };
467
+
468
+        streamElement.addEventListener('canplay', listener);
467 469
     }
468 470
 
469 471
     /**

Notiek ielāde…
Atcelt
Saglabāt