@gem-sdk/components 2.0.0-dev.607 → 2.0.0-dev.608
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/LiteVimeoEmbed.liquid.js +2 -1
- package/dist/cjs/video/components/common/index.js +3 -3
- package/dist/cjs/video/setting/configs/uiV2.js +11 -5
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +2 -1
- package/dist/esm/video/components/common/index.js +3 -3
- package/dist/esm/video/setting/configs/uiV2.js +11 -5
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ var index = require('./common/index.js');
|
|
|
11
11
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
12
12
|
|
|
13
13
|
const LiteVimeoEmbed = (props)=>{
|
|
14
|
-
const { title, id, lazy, aspectRatio } = props;
|
|
14
|
+
const { title, id, lazy, aspectRatio, autoplay } = props;
|
|
15
15
|
const { iframeSrc } = index.getVimeoParams(props);
|
|
16
16
|
const iframe = !lazy;
|
|
17
17
|
const posterUrl = props.thumbnail;
|
|
@@ -21,6 +21,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
21
21
|
lazy,
|
|
22
22
|
iframeSrc,
|
|
23
23
|
title,
|
|
24
|
+
autoplay,
|
|
24
25
|
style: props?.vimeoStyleIframe || ''
|
|
25
26
|
});
|
|
26
27
|
const iframeVimeoStyle = system.createStyle({
|
|
@@ -25,7 +25,7 @@ const listSourceVideoSupport = [
|
|
|
25
25
|
'.mov'
|
|
26
26
|
];
|
|
27
27
|
const getYoutubeParams = (props)=>{
|
|
28
|
-
const { id, poster, params, muted, webp, controls, adNetwork } = props;
|
|
28
|
+
const { id, poster, params, muted, webp, controls, adNetwork, autoplay } = props;
|
|
29
29
|
const videoId = encodeURIComponent(id);
|
|
30
30
|
const posterImp = poster || 'hqdefault';
|
|
31
31
|
const paramsImp = `${params}` || '';
|
|
@@ -34,7 +34,7 @@ const getYoutubeParams = (props)=>{
|
|
|
34
34
|
const vi = webp ? 'vi_webp' : 'vi';
|
|
35
35
|
const posterUrl = props.thumbnail || `https://i.ytimg.com/${vi}/${videoId}/${posterImp}.${format}`;
|
|
36
36
|
const ytUrl = props.noCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';
|
|
37
|
-
const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay
|
|
37
|
+
const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay=${autoplay}&state=1${mutedImp}${paramsImp}&controls=${controls ? 1 : 0}`;
|
|
38
38
|
const adNetworkImp = adNetwork || false;
|
|
39
39
|
return {
|
|
40
40
|
videoId,
|
|
@@ -52,7 +52,7 @@ const getYoutubeParams = (props)=>{
|
|
|
52
52
|
const getVimeoParams = (props)=>{
|
|
53
53
|
const { id, autoplay, muted, controls, loop } = props;
|
|
54
54
|
const videoId = encodeURIComponent(id);
|
|
55
|
-
const params = `?&autoplay=${autoplay}` + `&muted=${muted}` + `&loop=${loop}` + `&controls=${controls}` + '&autopause=false';
|
|
55
|
+
const params = `?&autoplay=${autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
|
|
56
56
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
57
57
|
return {
|
|
58
58
|
videoId,
|
|
@@ -121,10 +121,10 @@ const SettingUIV2 = [
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
label: {
|
|
124
|
-
en: '
|
|
124
|
+
en: 'Lazy load'
|
|
125
125
|
},
|
|
126
126
|
setting: {
|
|
127
|
-
id: '
|
|
127
|
+
id: 'lazy'
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
],
|
|
@@ -133,11 +133,17 @@ const SettingUIV2 = [
|
|
|
133
133
|
controls: [
|
|
134
134
|
{
|
|
135
135
|
label: {
|
|
136
|
-
en: '
|
|
136
|
+
en: 'Autoplay'
|
|
137
137
|
},
|
|
138
138
|
setting: {
|
|
139
|
-
id: '
|
|
140
|
-
}
|
|
139
|
+
id: 'autoplay'
|
|
140
|
+
},
|
|
141
|
+
options: {
|
|
142
|
+
labelVariant: 'primary',
|
|
143
|
+
fullWidth: true,
|
|
144
|
+
disableMessage: `YouTube videos will not autoplay when lazy load is enabled`
|
|
145
|
+
},
|
|
146
|
+
conditionEnable: "type === 'html5' || (type !== 'html5' && lazy != true)"
|
|
141
147
|
},
|
|
142
148
|
{
|
|
143
149
|
label: {
|
|
@@ -7,7 +7,7 @@ import { getVimeoParams } from './common/index.js';
|
|
|
7
7
|
import NextImage from '../../image/components/NextImage.liquid.js';
|
|
8
8
|
|
|
9
9
|
const LiteVimeoEmbed = (props)=>{
|
|
10
|
-
const { title, id, lazy, aspectRatio } = props;
|
|
10
|
+
const { title, id, lazy, aspectRatio, autoplay } = props;
|
|
11
11
|
const { iframeSrc } = getVimeoParams(props);
|
|
12
12
|
const iframe = !lazy;
|
|
13
13
|
const posterUrl = props.thumbnail;
|
|
@@ -17,6 +17,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
17
17
|
lazy,
|
|
18
18
|
iframeSrc,
|
|
19
19
|
title,
|
|
20
|
+
autoplay,
|
|
20
21
|
style: props?.vimeoStyleIframe || ''
|
|
21
22
|
});
|
|
22
23
|
const iframeVimeoStyle = createStyle({
|
|
@@ -23,7 +23,7 @@ const listSourceVideoSupport = [
|
|
|
23
23
|
'.mov'
|
|
24
24
|
];
|
|
25
25
|
const getYoutubeParams = (props)=>{
|
|
26
|
-
const { id, poster, params, muted, webp, controls, adNetwork } = props;
|
|
26
|
+
const { id, poster, params, muted, webp, controls, adNetwork, autoplay } = props;
|
|
27
27
|
const videoId = encodeURIComponent(id);
|
|
28
28
|
const posterImp = poster || 'hqdefault';
|
|
29
29
|
const paramsImp = `${params}` || '';
|
|
@@ -32,7 +32,7 @@ const getYoutubeParams = (props)=>{
|
|
|
32
32
|
const vi = webp ? 'vi_webp' : 'vi';
|
|
33
33
|
const posterUrl = props.thumbnail || `https://i.ytimg.com/${vi}/${videoId}/${posterImp}.${format}`;
|
|
34
34
|
const ytUrl = props.noCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';
|
|
35
|
-
const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay
|
|
35
|
+
const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay=${autoplay}&state=1${mutedImp}${paramsImp}&controls=${controls ? 1 : 0}`;
|
|
36
36
|
const adNetworkImp = adNetwork || false;
|
|
37
37
|
return {
|
|
38
38
|
videoId,
|
|
@@ -50,7 +50,7 @@ const getYoutubeParams = (props)=>{
|
|
|
50
50
|
const getVimeoParams = (props)=>{
|
|
51
51
|
const { id, autoplay, muted, controls, loop } = props;
|
|
52
52
|
const videoId = encodeURIComponent(id);
|
|
53
|
-
const params = `?&autoplay=${autoplay}` + `&muted=${muted}` + `&loop=${loop}` + `&controls=${controls}` + '&autopause=false';
|
|
53
|
+
const params = `?&autoplay=${autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
|
|
54
54
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
55
55
|
return {
|
|
56
56
|
videoId,
|
|
@@ -119,10 +119,10 @@ const SettingUIV2 = [
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
label: {
|
|
122
|
-
en: '
|
|
122
|
+
en: 'Lazy load'
|
|
123
123
|
},
|
|
124
124
|
setting: {
|
|
125
|
-
id: '
|
|
125
|
+
id: 'lazy'
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
],
|
|
@@ -131,11 +131,17 @@ const SettingUIV2 = [
|
|
|
131
131
|
controls: [
|
|
132
132
|
{
|
|
133
133
|
label: {
|
|
134
|
-
en: '
|
|
134
|
+
en: 'Autoplay'
|
|
135
135
|
},
|
|
136
136
|
setting: {
|
|
137
|
-
id: '
|
|
138
|
-
}
|
|
137
|
+
id: 'autoplay'
|
|
138
|
+
},
|
|
139
|
+
options: {
|
|
140
|
+
labelVariant: 'primary',
|
|
141
|
+
fullWidth: true,
|
|
142
|
+
disableMessage: `YouTube videos will not autoplay when lazy load is enabled`
|
|
143
|
+
},
|
|
144
|
+
conditionEnable: "type === 'html5' || (type !== 'html5' && lazy != true)"
|
|
139
145
|
},
|
|
140
146
|
{
|
|
141
147
|
label: {
|