@gem-sdk/components 2.0.0-dev.651 → 2.0.0-dev.652
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/cjs/video/components/HTML5Embed.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.liquid.js +1 -1
- package/dist/cjs/video/hooks/useLiteHtml5Embed.js +2 -2
- package/dist/esm/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/HTML5Embed.liquid.js +1 -1
- package/dist/esm/video/hooks/useLiteHtml5Embed.js +2 -2
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ const HTML5Embed = (props)=>{
|
|
|
18
18
|
const mode = core.useEditorMode();
|
|
19
19
|
const isInstantLP = mode !== 'edit';
|
|
20
20
|
const { thumbnail, muted, autoplay, loop, controls, src, style, title, className, lazy, preload } = props;
|
|
21
|
-
const { playVideoAndTurnOffThumbnail, videoRef, showThumbnail } = useLiteHtml5Embed.useLiteHtml5Embed(autoplay, src);
|
|
21
|
+
const { playVideoAndTurnOffThumbnail, videoRef, showThumbnail } = useLiteHtml5Embed.useLiteHtml5Embed(autoplay, src, muted);
|
|
22
22
|
const preloadThumbnail = !isInstantLP && autoplay && muted && !!thumbnail;
|
|
23
23
|
const offLazyLoad = !lazy && props.isVideoComponent && isInstantLP;
|
|
24
24
|
const isMp4Video = index.listSourceVideoSupport.some((ext)=>src.endsWith(ext));
|
|
@@ -17,7 +17,7 @@ const HTML5Embed = (props)=>{
|
|
|
17
17
|
const preloadThumbnail = autoplay && muted && !!thumbnail;
|
|
18
18
|
const offLazyLoad = !lazy && props.isVideoComponent;
|
|
19
19
|
const isMp4Video = src.endsWith('.mp4');
|
|
20
|
-
const hiddenRenderThumbnail = !thumbnail || autoplay;
|
|
20
|
+
const hiddenRenderThumbnail = !thumbnail || autoplay && muted;
|
|
21
21
|
const srcUnLazyVideo = offLazyLoad && !isInstantLP ? src : undefined;
|
|
22
22
|
const attrs = system.createAttr({
|
|
23
23
|
...getAttr.getHtml5Attr({
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
7
|
-
const useLiteHtml5Embed = (autoplay, src)=>{
|
|
8
|
-
const [showThumbnail, setShowThumbnail] = React.useState(!autoplay);
|
|
7
|
+
const useLiteHtml5Embed = (autoplay, src, muted)=>{
|
|
8
|
+
const [showThumbnail, setShowThumbnail] = React.useState(!(autoplay && muted));
|
|
9
9
|
const videoRef = React.useRef(null);
|
|
10
10
|
React.useEffect(()=>{
|
|
11
11
|
videoRef.current?.load();
|
|
@@ -14,7 +14,7 @@ const HTML5Embed = (props)=>{
|
|
|
14
14
|
const mode = useEditorMode();
|
|
15
15
|
const isInstantLP = mode !== 'edit';
|
|
16
16
|
const { thumbnail, muted, autoplay, loop, controls, src, style, title, className, lazy, preload } = props;
|
|
17
|
-
const { playVideoAndTurnOffThumbnail, videoRef, showThumbnail } = useLiteHtml5Embed(autoplay, src);
|
|
17
|
+
const { playVideoAndTurnOffThumbnail, videoRef, showThumbnail } = useLiteHtml5Embed(autoplay, src, muted);
|
|
18
18
|
const preloadThumbnail = !isInstantLP && autoplay && muted && !!thumbnail;
|
|
19
19
|
const offLazyLoad = !lazy && props.isVideoComponent && isInstantLP;
|
|
20
20
|
const isMp4Video = listSourceVideoSupport.some((ext)=>src.endsWith(ext));
|
|
@@ -13,7 +13,7 @@ const HTML5Embed = (props)=>{
|
|
|
13
13
|
const preloadThumbnail = autoplay && muted && !!thumbnail;
|
|
14
14
|
const offLazyLoad = !lazy && props.isVideoComponent;
|
|
15
15
|
const isMp4Video = src.endsWith('.mp4');
|
|
16
|
-
const hiddenRenderThumbnail = !thumbnail || autoplay;
|
|
16
|
+
const hiddenRenderThumbnail = !thumbnail || autoplay && muted;
|
|
17
17
|
const srcUnLazyVideo = offLazyLoad && !isInstantLP ? src : undefined;
|
|
18
18
|
const attrs = createAttr({
|
|
19
19
|
...getHtml5Attr({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useRef, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
const useLiteHtml5Embed = (autoplay, src)=>{
|
|
4
|
-
const [showThumbnail, setShowThumbnail] = useState(!autoplay);
|
|
3
|
+
const useLiteHtml5Embed = (autoplay, src, muted)=>{
|
|
4
|
+
const [showThumbnail, setShowThumbnail] = useState(!(autoplay && muted));
|
|
5
5
|
const videoRef = useRef(null);
|
|
6
6
|
useEffect(()=>{
|
|
7
7
|
videoRef.current?.load();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.652",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js",
|
|
23
23
|
"update-img-src-3rd": "node ./scripts/update-img-src-3rd.js",
|
|
24
24
|
"scan-and-translate": "node ./scripts/scan-and-translate.js",
|
|
25
|
-
"scan-all-text": "node ./scripts/scan-all-text
|
|
25
|
+
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@gem-sdk/core": "2.0.0-dev.649",
|