Skip to content

Commit 99696c1

Browse files
committed
MAGETWO-44249: Instant video playing doesn't work
Change order array
1 parent 59c768d commit 99696c1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ define([
138138
* @private
139139
*/
140140
_createVideoData: function (inputData, isJSON) {
141-
var videoData = {},
141+
var videoData = [],
142142
dataUrl,
143143
tmpVideoData,
144144
tmpInputData,
145-
i;
145+
i,
146+
iPlace;
146147

147148
if (isJSON) {
148149
inputData = $.parseJSON(inputData);
@@ -171,10 +172,14 @@ define([
171172
tmpVideoData.id = dataUrl.id;
172173
tmpVideoData.provider = dataUrl.type;
173174
}
175+
iPlace = i + 1;
176+
if(tmpVideoData.isBase) {
177+
videoData.unshift(tmpVideoData);
178+
continue;
179+
}
174180

175-
videoData[i] = tmpVideoData;
181+
videoData.push(tmpVideoData);
176182
}
177-
178183
return videoData;
179184
},
180185

0 commit comments

Comments
 (0)