From 42ddf3945838091c58bc8c8babc1f1067b9ef95b Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 11 May 2016 15:12:07 -0400 Subject: [PATCH 1/3] null out currentSource_ on tech dispose and src change --- src/js/tech/tech.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 920192212e..94d826ea91 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -813,6 +813,8 @@ Tech.withSourceHandlers = function(_Tech){ // than clear all of our current tracks if (this.currentSource_) { this.clearTracks(['audio', 'video']); + + this.currentSource_ = null; } if (sh !== _Tech.nativeSourceHandler) { @@ -852,6 +854,7 @@ Tech.withSourceHandlers = function(_Tech){ if (this.sourceHandler_ && this.sourceHandler_.dispose) { this.off(this.el_, 'loadstart', _Tech.prototype.firstLoadStartListener_); this.off(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); + this.currentSource_ = null; this.sourceHandler_.dispose(); } }; From 1e25c63c2cf64cd94628c917bb171f54c2b9f609 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 11 May 2016 16:25:27 -0400 Subject: [PATCH 2/3] only clear out the currentSource_ in setSource if it's set --- src/js/tech/tech.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 94d826ea91..e1eb7173a3 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -854,7 +854,6 @@ Tech.withSourceHandlers = function(_Tech){ if (this.sourceHandler_ && this.sourceHandler_.dispose) { this.off(this.el_, 'loadstart', _Tech.prototype.firstLoadStartListener_); this.off(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); - this.currentSource_ = null; this.sourceHandler_.dispose(); } }; From 1d62d2da3ff06b8f7b6124fbd869216115a96aae Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 11 May 2016 16:25:45 -0400 Subject: [PATCH 3/3] fix naming issue in test case message --- test/unit/tech/tech.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/tech/tech.test.js b/test/unit/tech/tech.test.js index ef006a810f..a82eee3f64 100644 --- a/test/unit/tech/tech.test.js +++ b/test/unit/tech/tech.test.js @@ -265,7 +265,7 @@ test('should add the source handler interface to a tech', function(){ // verify that all the tracks were removed as we got a new source equal(tech.audioTracks().length, 0, 'should have zero audio tracks'); equal(tech.videoTracks().length, 0, 'should have zero video tracks'); - equal(tech.textTracks().length, 2, 'should have two video tracks'); + equal(tech.textTracks().length, 2, 'should have two text tracks'); equal(tech.remoteTextTrackEls().length, 2, 'should have two remote text tracks els'); equal(tech.remoteTextTracks().length, 2, 'should have two remote text tracks');