Commit 81a3b72f by Alexander Kryklia

Merge pull request #2586 from edx/alex/fix_position_video

Fix for saving video in studio when saving position. BLD-834
parents 409e6e57 d2f17235
......@@ -110,6 +110,20 @@ function (Initialize) {
});
});
it('data contains position 0, async is true', function () {
itSpec({
asyncVal: true,
speedVal: undefined,
positionVal: 0,
data: {
saved_video_position: 0
},
ajaxData: {
saved_video_position: Time.formatFull(Math.round(0))
}
});
});
return;
function itSpec(value) {
......
......@@ -674,6 +674,7 @@ function (VideoPlayer, VideoStorage) {
}
function saveState(async, data) {
if (!($.isPlainObject(data))) {
data = {
saved_video_position: this.videoPlayer.currentTime
......@@ -684,7 +685,7 @@ function (VideoPlayer, VideoStorage) {
this.storage.setItem('speed', data.speed, true);
}
if (data.saved_video_position) {
if (data.hasOwnProperty('saved_video_position')) {
this.storage.setItem('savedVideoPosition', data.saved_video_position, true);
data.saved_video_position = Time.formatFull(data.saved_video_position);
......
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