mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
@ldayananda updated videojs to not do anything if no src is set. closes #3378
This commit is contained in:
committed by
Gary Katsevman
parent
68c7ab4748
commit
c51c180b3c
@ -13,6 +13,7 @@ CHANGELOG
|
|||||||
* @nickygerritsen Fix test for tooltips in IE8 ([view](https://github.com/videojs/video.js/pull/3327))
|
* @nickygerritsen Fix test for tooltips in IE8 ([view](https://github.com/videojs/video.js/pull/3327))
|
||||||
* @mboles added loadstart event to jsdoc ([view](https://github.com/videojs/video.js/pull/3370))
|
* @mboles added loadstart event to jsdoc ([view](https://github.com/videojs/video.js/pull/3370))
|
||||||
* @hartman added default print styling ([view](https://github.com/videojs/video.js/pull/3304))
|
* @hartman added default print styling ([view](https://github.com/videojs/video.js/pull/3304))
|
||||||
|
* @ldayananda updated videojs to not do anything if no src is set ([view](https://github.com/videojs/video.js/pull/3378))
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
@ -1292,7 +1292,15 @@ class Player extends Component {
|
|||||||
* @method play
|
* @method play
|
||||||
*/
|
*/
|
||||||
play() {
|
play() {
|
||||||
this.techCall_('play');
|
// Only calls the tech's play if we already have a src loaded
|
||||||
|
if (this.src() || this.currentSrc()) {
|
||||||
|
this.techCall_('play');
|
||||||
|
} else {
|
||||||
|
this.tech_.one('loadstart', function() {
|
||||||
|
this.play();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ test('should hide the poster when play is called', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
equal(player.hasStarted(), false, 'the show poster flag is true before play');
|
equal(player.hasStarted(), false, 'the show poster flag is true before play');
|
||||||
player.play();
|
player.tech_.trigger('play');
|
||||||
equal(player.hasStarted(), true, 'the show poster flag is false after play');
|
equal(player.hasStarted(), true, 'the show poster flag is false after play');
|
||||||
|
|
||||||
player.tech_.trigger('loadstart');
|
player.tech_.trigger('loadstart');
|
||||||
@ -255,7 +255,7 @@ test('should hide the poster when play is called', function() {
|
|||||||
false,
|
false,
|
||||||
'the resource selection algorithm sets the show poster flag to true');
|
'the resource selection algorithm sets the show poster flag to true');
|
||||||
|
|
||||||
player.play();
|
player.tech_.trigger('play');
|
||||||
equal(player.hasStarted(), true, 'the show poster flag is false after play');
|
equal(player.hasStarted(), true, 'the show poster flag is false after play');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user