Don't fire ontrack if flag used by RTCTrackEvent is disabled.
It turned out that without making this event dispatching conditional on
the flag it would fire anyway.
It only fires if you listen to the event using addEventListener('track',
X), not if you use ontrack = X. When it fires and the flag is off it
looks like RTCTrackEvent members such as track and streams are undefined
because RTCTrackEvent is behind flag.
With this change you get the expected behavior with and without the flag
enabled.
Also fixes https://github.com/webrtc/apprtc/issues/481
Bug: 761612
Change-Id: Ideaf636633821b0bd9718ef0d2a7a8e7e8b289c1
Reviewed-on: https://chromium-review.googlesource.com/663259Reviewed-by:
Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501325}
Showing
Please register or sign in to comment