diff --git a/src/js/player.js b/src/js/player.js index f207557ace..56e300e991 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2285,7 +2285,7 @@ class Player extends Component { src(source) { // getter usage if (typeof source === 'undefined') { - return this.cache_.src; + return this.cache_.src || ''; } // filter out invalid sources and turn our source into // an array of source objects diff --git a/test/unit/player.test.js b/test/unit/player.test.js index 4723378054..d4b3e7e783 100644 --- a/test/unit/player.test.js +++ b/test/unit/player.test.js @@ -193,6 +193,7 @@ QUnit.test('should get current source from src set', function(assert) { // check for matching undefined src assert.deepEqual(player.currentSource(), {}); + assert.equal(player.src(), ''); player.src('http://google.com');