From fa138eae4306657b164421913e02f47048d40dbf Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 2 Nov 2015 12:11:14 -0600 Subject: [PATCH] Replaces deprecated ended call with active check for media streams. --- modules/RTC/LocalStream.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/RTC/LocalStream.js b/modules/RTC/LocalStream.js index 4223dd168..bc1a2438b 100644 --- a/modules/RTC/LocalStream.js +++ b/modules/RTC/LocalStream.js @@ -15,7 +15,6 @@ function implementOnEndedHandling(localStream) { stream.stop = function () { originalStop.apply(stream); if (localStream.isActive()) { - stream.ended = true; stream.onended(); } }; @@ -127,10 +126,15 @@ LocalStream.prototype.getId = function () { /** * Checks whether the MediaStream is avtive/not ended. + * When there is no check for active we don't have information and so + * will return that stream is active (in case of FF). * @returns {boolean} whether MediaStream is active. */ LocalStream.prototype.isActive = function () { - return !this.stream.ended; + if((typeof this.stream.active !== "undefined")) + return this.stream.active; + else + return true; }; module.exports = LocalStream;