Merge pull request #2586 from edx/alex/fix_position_video
Fix for saving video in studio when saving position. BLD-834
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user