-
Notifications
You must be signed in to change notification settings - Fork 0
/
ww-config.js
121 lines (121 loc) · 3.59 KB
/
ww-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
export default {
options: {
ignoredStyleProperties: ['overflow'],
},
editor: {
label: {
fr: 'Video - WeWeb',
en: 'Video - WeWeb',
},
icon: 'play',
},
actions: [
{ label: 'Play video', action: 'playVideo' },
{ label: 'Pause video', action: 'pauseVideo' },
{
label: 'Seek to',
action: 'seekTo',
args: [
{
name: 'Time',
type: 'number',
},
],
},
],
triggerEvents: [
{ name: 'play', label: { en: 'On play' }, event: { value: '' }, default: true },
{ name: 'pause', label: { en: 'On pause' }, event: { value: '' } },
{ name: 'end', label: { en: 'On end' }, event: { value: '' } },
],
properties: {
file: {
label: { en: 'File', fr: 'Fichier' },
type: 'Video',
section: 'settings',
bindable: true,
defaultValue: '',
/* wwEditor:start */
bindingValidation: {
type: 'string',
tooltip: 'A weweb local video url`',
},
/* wwEditor:end */
},
previewImage: {
label: { en: 'Preview image', fr: "Image de d'aperçu" },
type: 'Image',
section: 'settings',
bindable: true,
defaultValue: '',
/* wwEditor:start */
bindingValidation: {
type: 'string',
tooltip: 'A string that defines an image url`',
},
/* wwEditor:end */
},
videoStartTime: {
label: {
en: 'Start time (s)',
},
type: 'Number',
options: (_, sidepanelContent) => {
console.log(sidepanelContent.videoDuration);
return { min: 0, max: sidepanelContent.videoDuration };
},
section: 'settings',
bindable: true,
defaultValue: 0,
/* wwEditor:start */
bindingValidation: {
type: 'number',
tooltip: 'A number that defines the video start time, in seconds: `42`',
},
/* wwEditor:end */
},
videoDuration: {
editorOnly: true,
defaultValue: 0,
hidden: true,
},
autoplay: {
label: { en: 'Autoplay', fr: 'Lecture automatique' },
type: 'OnOff',
section: 'settings',
defaultValue: false,
bindable: true,
/* wwEditor:start */
bindingValidation: {
type: 'boolean',
tooltip: 'A boolean that defines if the video should start automatically: `true | false`',
},
/* wwEditor:end */
},
muted: {
label: { en: 'Muted', fr: 'Muet' },
type: 'OnOff',
section: 'settings',
defaultValue: false,
},
loop: {
label: { en: 'Loop', fr: 'Lecture en boucle' },
type: 'OnOff',
section: 'settings',
defaultValue: false,
},
controls: {
label: { en: 'Controls', fr: 'Contrôles' },
type: 'OnOff',
section: 'settings',
defaultValue: true,
},
preload: {
label: { en: 'Preload', fr: 'Précharger' },
type: 'OnOff',
section: 'settings',
bindable: true,
defaultValue: true,
},
},
};