diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 920192212e..e1eb7173a3 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) { 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');