mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
@bc-bbay migrate seeking on replay to the flash tech. closes #2519
This commit is contained in:
committed by
David LaPalomento
parent
75e65c6585
commit
fca885a62f
@ -3,6 +3,7 @@ CHANGELOG
|
|||||||
|
|
||||||
## HEAD (Unreleased)
|
## HEAD (Unreleased)
|
||||||
* @dmlap update to videojs-swf 4.7.4 ([view](https://github.com/videojs/video.js/pull/2463))
|
* @dmlap update to videojs-swf 4.7.4 ([view](https://github.com/videojs/video.js/pull/2463))
|
||||||
|
* @bc-bbay migrate seeking on replay to the flash tech ([view](https://github.com/videojs/video.js/pull/2519))
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
@ -101,6 +101,10 @@ vjs.Flash.prototype.dispose = function(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
vjs.Flash.prototype.play = function(){
|
vjs.Flash.prototype.play = function(){
|
||||||
|
if (this.ended()) {
|
||||||
|
this['setCurrentTime'](0);
|
||||||
|
}
|
||||||
|
|
||||||
this.el_.vjs_play();
|
this.el_.vjs_play();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -187,6 +187,36 @@ test('seekable should be empty if no video is loaded', function() {
|
|||||||
equal(tech.seekable().length, 0, 'seekable is empty');
|
equal(tech.seekable().length, 0, 'seekable is empty');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('hitting play again after video ends resets current time to 0', function() {
|
||||||
|
var player = PlayerTest.makePlayer(),
|
||||||
|
currentTime = 60,
|
||||||
|
tech = new vjs.Flash(player, {
|
||||||
|
'parentEl': player.el()
|
||||||
|
});
|
||||||
|
|
||||||
|
// mock out currentTime
|
||||||
|
tech.el()['vjs_getProperty'] = function(name) {
|
||||||
|
if (name === 'currentTime') {
|
||||||
|
return currentTime;
|
||||||
|
}
|
||||||
|
if (name === 'ended') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
tech.el()['vjs_setProperty'] = function(property, value) {
|
||||||
|
if (property === 'currentTime') {
|
||||||
|
currentTime = value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
tech.el()['vjs_play'] = function() {};
|
||||||
|
|
||||||
|
tech.play();
|
||||||
|
|
||||||
|
equal(tech.currentTime(), 0, 'current time was not 0');
|
||||||
|
});
|
||||||
|
|
||||||
test('calling methods before the SWF loads is safe', function() {
|
test('calling methods before the SWF loads is safe', function() {
|
||||||
var player = PlayerTest.makePlayer(),
|
var player = PlayerTest.makePlayer(),
|
||||||
tech = new vjs.Flash(player, {
|
tech = new vjs.Flash(player, {
|
||||||
|
Reference in New Issue
Block a user