From bfda8bec8986496aa63309132da38a476b652448 Mon Sep 17 00:00:00 2001 From: Valera Rozuvan Date: Fri, 1 Feb 2013 16:47:34 +0200 Subject: [PATCH] Fixed bug with HTML5 start end options. Now can specify an interval of video which must be played. --- .../js/src/videoalpha/display/html5_video.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js b/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js index 1623b1b5eb..c4f375d138 100644 --- a/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js +++ b/common/lib/xmodule/xmodule/js/src/videoalpha/display/html5_video.js @@ -183,17 +183,8 @@ this.HTML5Video = (function () { } }, false); this.video.addEventListener('timeupdate', function (data) { - console.log('[timeupdate]'); - console.log(_this.video.currentTime); - 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 - }); - } + if (_this.end < _this.video.currentTime) { + _this.video.pause(); } }, false); @@ -206,6 +197,9 @@ this.HTML5Video = (function () { Player.prototype.seekTo = function (value) { if ((typeof value === 'number') && (value <= this.video.duration) && (value >= 0)) { + this.start = 0; + this.end = this.video.duration; + this.video.currentTime = value; } };