mirror of
https://github.com/videojs/video.js.git
synced 2024-12-25 02:42:10 +02:00
fix: player.src() should return empty string if no source is set (#4711)
player.src() returns undefined for a new player but it should return '' like player.currentSrc() does and as the video element itself does.
This commit is contained in:
parent
9cf98006d5
commit
9acbcd8410
@ -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
|
||||
|
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user