Commit bfda8bec by Valera Rozuvan

Fixed bug with HTML5 start end options. Now can specify an interval of video which must be played.

parent 6729eae9
...@@ -183,17 +183,8 @@ this.HTML5Video = (function () { ...@@ -183,17 +183,8 @@ this.HTML5Video = (function () {
} }
}, false); }, false);
this.video.addEventListener('timeupdate', function (data) { this.video.addEventListener('timeupdate', function (data) {
console.log('[timeupdate]'); if (_this.end < _this.video.currentTime) {
console.log(_this.video.currentTime); _this.video.pause();
if (_this.video.end > _this.video.currentTime) {
console.log('_this.video.end >= _this.video.currentTime -> pausing video');
_this.playerState = HTML5Video.PlayerState.PAUSED;
if ($.isFunction(_this.config.events.onStateChange) === true) {
_this.config.events.onStateChange({
'data': _this.playerState
});
}
} }
}, false); }, false);
...@@ -206,6 +197,9 @@ this.HTML5Video = (function () { ...@@ -206,6 +197,9 @@ this.HTML5Video = (function () {
Player.prototype.seekTo = function (value) { Player.prototype.seekTo = function (value) {
if ((typeof value === 'number') && (value <= this.video.duration) && (value >= 0)) { if ((typeof value === 'number') && (value <= this.video.duration) && (value >= 0)) {
this.start = 0;
this.end = this.video.duration;
this.video.currentTime = value; this.video.currentTime = value;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment