@antscorp/antsomi-ui 1.3.3-beta.90 → 1.3.3-beta.91
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.
|
@@ -107,7 +107,12 @@ export const convertHtmlText = (htmlText, format = 'raw', state, objectWidgetInp
|
|
|
107
107
|
else if (found[0] === 'productTemplate') {
|
|
108
108
|
bgColor = '#9238b5';
|
|
109
109
|
}
|
|
110
|
-
else if (
|
|
110
|
+
else if (foundLink[0] === 'nontrackurl' ||
|
|
111
|
+
foundLink[0] === 'shortlink' ||
|
|
112
|
+
foundLink[0] === 'shortlink_static') {
|
|
113
|
+
bgColor = '#cae5fe';
|
|
114
|
+
}
|
|
115
|
+
else if (found[0] === 'promotion_code') {
|
|
111
116
|
bgColor = '#6750A7';
|
|
112
117
|
}
|
|
113
118
|
else if (found[0] === 'custom') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MediaThumbProps } from './MediaThumb';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const VideoThumbnail: React.FC<MediaThumbProps>;
|
|
4
|
+
export default VideoThumbnail;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable jsx-a11y/media-has-caption */
|
|
2
2
|
// Libraries
|
|
3
|
-
import React, { useState,
|
|
3
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
4
4
|
// Assets
|
|
5
5
|
import PlaceholderImage from '@antscorp/antsomi-ui/es/assets/images/placeholder-image.png';
|
|
6
6
|
// Styled
|
|
@@ -24,7 +24,10 @@ const VideoThumbnail = props => {
|
|
|
24
24
|
setIsShow(true);
|
|
25
25
|
};
|
|
26
26
|
video.addEventListener('loadeddata', listener);
|
|
27
|
-
|
|
27
|
+
// Set the preload time range
|
|
28
|
+
video.currentTime = 2;
|
|
29
|
+
// Start loading the video from the specified time
|
|
30
|
+
video.load();
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
return () => {
|
|
@@ -32,8 +35,9 @@ const VideoThumbnail = props => {
|
|
|
32
35
|
};
|
|
33
36
|
}, [media, mode]);
|
|
34
37
|
return (React.createElement("div", { style: { width: '100%', height: '100%' } },
|
|
35
|
-
React.createElement("video", { width: 400, height: 400, ref: videoRef, style: { display: 'none' } }
|
|
38
|
+
React.createElement("video", { loop: false, muted: true, controls: false, width: 400, height: 400, ref: videoRef, style: { display: 'none' }, preload: "metadata" },
|
|
39
|
+
React.createElement("source", { src: media === null || media === void 0 ? void 0 : media.url, type: "video/mp4" })),
|
|
36
40
|
React.createElement("canvas", { ref: canvasRef, style: { width: '100%', height: '100%', display: isShow ? 'block' : 'none' } }),
|
|
37
41
|
React.createElement(Image, { src: PlaceholderImage, alt: "placeholder", style: { display: isShow ? 'none' : 'block' } })));
|
|
38
42
|
};
|
|
39
|
-
export default
|
|
43
|
+
export default VideoThumbnail;
|