contentoh-components-library 21.4.139 → 21.4.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -355,7 +355,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
355
355
|
noClick: true,
|
|
356
356
|
onDrop: function onDrop(acceptedFiles) {
|
|
357
357
|
var newImages = [];
|
|
358
|
-
var createThumbnail = true;
|
|
359
358
|
acceptedFiles.map(function (file) {
|
|
360
359
|
var reader = new FileReader();
|
|
361
360
|
reader.fileName = file.name;
|
|
@@ -370,66 +369,67 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
370
369
|
ext = e.srcElement.fileName.split(".");
|
|
371
370
|
img = new Image();
|
|
372
371
|
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
372
|
+
if (ext[ext.length - 1] == "mp4") {
|
|
373
|
+
obtenerDuracionVideoBase64(e.target.result).then( /*#__PURE__*/function () {
|
|
374
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(duracion) {
|
|
375
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
376
|
+
while (1) {
|
|
377
|
+
switch (_context3.prev = _context3.next) {
|
|
378
|
+
case 0:
|
|
379
|
+
if (!(duracion > 15 && duracion < 600)) {
|
|
380
|
+
_context3.next = 7;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
377
383
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
384
|
+
_context3.next = 3;
|
|
385
|
+
return (0, _generateThumnail.default)(e.target.result, 2);
|
|
386
|
+
|
|
387
|
+
case 3:
|
|
388
|
+
img.src = _context3.sent;
|
|
389
|
+
setTimeout(function () {
|
|
390
|
+
var width = img.width;
|
|
391
|
+
var height = img.height;
|
|
392
|
+
var newImg = {
|
|
393
|
+
action: "addImg",
|
|
394
|
+
img: {
|
|
395
|
+
src: img.src,
|
|
396
|
+
//e.target.result,
|
|
397
|
+
name: e.target.fileName,
|
|
398
|
+
ext: ext[ext.length - 1],
|
|
399
|
+
width: width,
|
|
400
|
+
height: height,
|
|
401
|
+
video_src: ext[ext.length - 1] == "mp4" ? e.target.result : ""
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
setImages(newImg);
|
|
405
|
+
}, 500);
|
|
406
|
+
_context3.next = 8;
|
|
391
407
|
break;
|
|
392
|
-
}
|
|
393
408
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
show: true,
|
|
406
|
-
title: "Hay un error al subir el video",
|
|
407
|
-
message: "Los videos deben durar entre 15 segundos y 5 minutos"
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
case 8:
|
|
411
|
-
case "end":
|
|
412
|
-
return _context3.stop();
|
|
409
|
+
case 7:
|
|
410
|
+
setModalAlert({
|
|
411
|
+
show: true,
|
|
412
|
+
title: "Hubo un error al subir el video",
|
|
413
|
+
message: "Los videos deben durar entre 15 segundos y 10 minutos"
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
case 8:
|
|
417
|
+
case "end":
|
|
418
|
+
return _context3.stop();
|
|
419
|
+
}
|
|
413
420
|
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
case 9:
|
|
428
|
-
img.src = e.target.result;
|
|
429
|
-
|
|
430
|
-
case 10:
|
|
431
|
-
if (createThumbnail) {
|
|
432
|
-
generasetTimeout(function () {
|
|
421
|
+
}, _callee3);
|
|
422
|
+
}));
|
|
423
|
+
|
|
424
|
+
return function (_x4) {
|
|
425
|
+
return _ref5.apply(this, arguments);
|
|
426
|
+
};
|
|
427
|
+
}()).catch(function (error) {
|
|
428
|
+
console.error("Error al obtener la duración del video:", error);
|
|
429
|
+
});
|
|
430
|
+
} else {
|
|
431
|
+
img.src = e.target.result;
|
|
432
|
+
setTimeout(function () {
|
|
433
433
|
var width = img.width;
|
|
434
434
|
var height = img.height;
|
|
435
435
|
var newImg = {
|
|
@@ -448,7 +448,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
448
448
|
}, 500);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
case
|
|
451
|
+
case 3:
|
|
452
452
|
case "end":
|
|
453
453
|
return _context4.stop();
|
|
454
454
|
}
|
package/package.json
CHANGED
|
@@ -204,7 +204,7 @@ export const RetailerProductEdition = ({
|
|
|
204
204
|
if (ext[ext.length - 1] == "mp4") {
|
|
205
205
|
obtenerDuracionVideoBase64(e.target.result)
|
|
206
206
|
.then(async (duracion) => {
|
|
207
|
-
if (duracion > 15 && duracion <
|
|
207
|
+
if (duracion > 15 && duracion < 600) {
|
|
208
208
|
img.src = await generateThumbnail(e.target.result, 2);
|
|
209
209
|
setTimeout(() => {
|
|
210
210
|
const width = img.width;
|
|
@@ -226,9 +226,9 @@ export const RetailerProductEdition = ({
|
|
|
226
226
|
} else {
|
|
227
227
|
setModalAlert({
|
|
228
228
|
show: true,
|
|
229
|
-
title: "
|
|
229
|
+
title: "Hubo un error al subir el video",
|
|
230
230
|
message:
|
|
231
|
-
"Los videos deben durar entre 15 segundos y
|
|
231
|
+
"Los videos deben durar entre 15 segundos y 10 minutos",
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
})
|