mirror of
https://github.com/videojs/video.js.git
synced 2025-01-25 11:13:52 +02:00
@dmlap move seek on replay into the flash tech. closes #2527
This commit is contained in:
parent
c38778c296
commit
90c6890567
@ -109,6 +109,7 @@ CHANGELOG
|
||||
* @gkatsev fixed nativeControlsForTouch handling. Defaults to native controls on iphone and native android browsers. ([view](https://github.com/videojs/video.js/pull/2499))
|
||||
* @heff fixed cross-platform track tests by switching to a fake tech ([view](https://github.com/videojs/video.js/pull/2496))
|
||||
* @gkatsev improved tech controls listener handling. ([view](https://github.com/videojs/video.js/pull/2511))
|
||||
* @dmlap move seek on replay into the flash tech ([view](https://github.com/videojs/video.js/pull/2527))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -113,6 +113,9 @@ class Flash extends Tech {
|
||||
* @method play
|
||||
*/
|
||||
play() {
|
||||
if (this.ended()) {
|
||||
this.setCurrentTime(0);
|
||||
}
|
||||
this.el_.vjs_play();
|
||||
}
|
||||
|
||||
|
@ -166,6 +166,28 @@ test('seekable', function() {
|
||||
equal(result.length, mockFlash.duration_, 'seekable is empty with a zero duration');
|
||||
});
|
||||
|
||||
test('play after ended seeks to the beginning', function() {
|
||||
let plays = 0, seeks = [];
|
||||
|
||||
Flash.prototype.play.call({
|
||||
el_: {
|
||||
vjs_play() {
|
||||
plays++;
|
||||
}
|
||||
},
|
||||
ended() {
|
||||
return true;
|
||||
},
|
||||
setCurrentTime(time) {
|
||||
seeks.push(time);
|
||||
}
|
||||
});
|
||||
|
||||
equal(plays, 1, 'called play on the SWF');
|
||||
equal(seeks.length, 1, 'seeked on play');
|
||||
equal(seeks[0], 0, 'seeked to the beginning');
|
||||
});
|
||||
|
||||
// fake out the <object> interaction but leave all the other logic intact
|
||||
class MockFlash extends Flash {
|
||||
constructor() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user