From 4fc6cefc9c37a2946569c2eb52fe79d1f4fc1bf6 Mon Sep 17 00:00:00 2001
From: Lance Stout <lancestout@gmail.com>
Date: Tue, 3 Jul 2018 08:40:32 -0700
Subject: [PATCH] Use ontrack instead of onaddtrack

---
 rtcpeerconnection.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rtcpeerconnection.js b/rtcpeerconnection.js
index 364e449..471d401 100644
--- a/rtcpeerconnection.js
+++ b/rtcpeerconnection.js
@@ -161,7 +161,7 @@ function PeerConnection(config, constraints) {
     this.pc.onremovestream = this.emit.bind(this, 'removeStream');
     this.pc.onremovetrack = this.emit.bind(this, 'removeTrack');
     this.pc.onaddstream = this.emit.bind(this, 'addStream');
-    this.pc.onaddtrack = this.emit.bind(this, 'addTrack');
+    this.pc.ontrack = this.emit.bind(this, 'addTrack');
     this.pc.onnegotiationneeded = this.emit.bind(this, 'negotiationNeeded');
     this.pc.oniceconnectionstatechange = this.emit.bind(this, 'iceConnectionStateChange');
     this.pc.onsignalingstatechange = this.emit.bind(this, 'signalingStateChange');
-- 
GitLab