@meduza/ui-kit-2 1.0.7 → 1.0.9
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.
- package/dist/ui-kit-2.cjs.development.js +15 -4
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +15 -4
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/EmbedBlock/EmbedBlock.tsx +17 -3
|
@@ -1167,6 +1167,16 @@ const EmbedGif = ({
|
|
|
1167
1167
|
|
|
1168
1168
|
/* eslint-disable react/no-unknown-property */
|
|
1169
1169
|
/* eslint-disable jsx-a11y/media-has-caption */
|
|
1170
|
+
const thumbnailToImagePath = url => {
|
|
1171
|
+
if (!url) {
|
|
1172
|
+
return undefined;
|
|
1173
|
+
}
|
|
1174
|
+
const indexImage = url.indexOf('/image');
|
|
1175
|
+
if (indexImage >= 0) {
|
|
1176
|
+
return url.slice(indexImage);
|
|
1177
|
+
}
|
|
1178
|
+
return url;
|
|
1179
|
+
};
|
|
1170
1180
|
const EmbedBlock = ({
|
|
1171
1181
|
block,
|
|
1172
1182
|
block: {
|
|
@@ -1182,7 +1192,8 @@ const EmbedBlock = ({
|
|
|
1182
1192
|
large_url: large,
|
|
1183
1193
|
gif_url: gifUrl,
|
|
1184
1194
|
mp4_url: mp4Url,
|
|
1185
|
-
video_file_path: videoFileUrl
|
|
1195
|
+
video_file_path: videoFileUrl,
|
|
1196
|
+
thumbnail_url: thumbnailUrl
|
|
1186
1197
|
}
|
|
1187
1198
|
},
|
|
1188
1199
|
styleContext,
|
|
@@ -1251,10 +1262,10 @@ const EmbedBlock = ({
|
|
|
1251
1262
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1252
1263
|
className: makeClassName([[styles$r.objectWrap, true], [styles$r.isDefaultVideo, true]])
|
|
1253
1264
|
}, /*#__PURE__*/React.createElement("video", {
|
|
1254
|
-
src:
|
|
1265
|
+
src: videoFileUrl,
|
|
1266
|
+
poster: thumbnailToImagePath(thumbnailUrl),
|
|
1255
1267
|
controls: true,
|
|
1256
|
-
playsInline: true
|
|
1257
|
-
preload: "metadata"
|
|
1268
|
+
playsInline: true
|
|
1258
1269
|
})));
|
|
1259
1270
|
}
|
|
1260
1271
|
return /*#__PURE__*/React.createElement("div", {
|