-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathVideo.fusion
188 lines (161 loc) · 7.09 KB
/
Video.fusion
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
prototype(Jonnitto.PrettyEmbedVideoPlatforms:Content.Video) < prototype(Jonnitto.PrettyEmbedHelper:Content) {
package = 'VideoPlatforms'
platform = ${q(node).property('platform')}
type = ${q(node).property('type')}
videoID = ${q(node).property('videoID')}
metadataID = ${q(node).property('metadataID')}
metadataTitle = ${q(node).property('metadataTitle')}
alternativeText = ${this.metadataTitle}
imageFromPlatform = ${q(node).property('metadataImage')}
thumbnailFromResources = ${q(node).property('metadataThumbnail')}
ratio = ${q(node).property('metadataRatio')}
async = true
// This can used as alternative preview
content = null
loadImageStrategy = ${Configuration.setting('Jonnitto.PrettyEmbedVideoPlatforms.loadImageStrategy')}
enableGdprMessage = ${Configuration.setting('Jonnitto.PrettyEmbedHelper.enableGdprMessage')}
gdprMessage = Jonnitto.PrettyEmbedHelper:GdprMessage
showBackendNotification = true
// Should the video be opened on a lightbox?
lightbox = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'lightbox'
}
// When the lightbox is set, should the preview image preserve his aspect ratio?
preserveAspectRatio = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'preserveAspectRatio'
}
// If no aspect ratio can be calcualted from the oembed service, you have the possibility to force the aspect ratio 16:9
force16to9 = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'force16to9'
}
// Whether to restart the video automatically after reaching the end.
loop = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'loop'
}
// Whether the video plays inline on supported mobile devices.
// Note that if set to false it does not imply that the video will always be played in fullscreen.
playsinline = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'playsinline'
}
// Allow full screen
allowFullScreen = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'allowFullScreen'
}
//////////////////////////////////
// Additional settings for Youtube
//////////////////////////////////
// This parameter indicates whether the video player controls are displayed
controls = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'controls'
}
// Setting the parameter's value to true causes closed captions to be shown by default,
// even if the user has turned captions off.
closedCaptions = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'closedCaptions'
}
// It is not possible to disable related videos, but if it is set to false, the player will
// show related videos that are from the same channel as the video that was just played.
showRelated = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'showRelated'
}
////////////////////////////////
// Additional settings for Vimeo
////////////////////////////////
// Whether to pause the current video when another Vimeo video on the same page starts to play.
// Set this value to false to permit simultaneous playback of all the videos on the page.
autopause = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'autopause'
}
// Whether the player is in background mode, which hides the playback controls, enables autoplay, and loops the video.
background = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'background'
}
// Whether the video is muted upon loading. The true value is required for the autoplay behavior in some browsers.
muted = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'muted'
}
// Whether the responsive player and transparent background are enabled
transparent = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'transparent'
}
// The hexadecimal color value of the playback controls, which is normally 00ADEF.
color = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'color'
}
// Whether the player displays the title overlay
previewTitle = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'previewTitle'
}
// Whether to display the video owner's name.
previewByline = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'previewByline'
}
// Whether to display the video owner's portrait.
previewPortrait = Jonnitto.PrettyEmbedHelper:GetProperty {
property = 'previewPortrait'
}
/*
These properties are already defined in Jonnitto.PrettyEmbedHelper:Content
- maximumWidth
- wrapper
- origin
- image
*/
// Internal
[email protected] = ${this.metadataID ? this.metadataID : (value && this.platform ? Jonnitto.PrettyEmbedHelper.platformID(value, this.platform) : value)}
renderer = Neos.Fusion:Component {
@apply.props = ${props}
poster = Neos.Fusion:Case {
hasAlternativePreview {
condition = ${props.content}
renderer = true
}
hasPersistentResource {
condition = ${props.image || props.thumbnailFromResources}
renderer = Neos.Neos:ImageUri {
asset = ${props.image || props.thumbnailFromResources}
async = ${props.async}
maximumWidth = ${props.maximumWidth}
}
}
imageFromVimeo {
condition = ${props.videoID && props.platform == 'vimeo'}
renderer = ${props.imageFromPlatform || Jonnitto.PrettyEmbedHelper.vimeoThumbnail(props.videoID)}
}
imageFromPlatform {
condition = ${props.videoID}
renderer = ${props.imageFromPlatform}
}
}
poster2x = Neos.Neos:ImageUri {
@if {
hasAsset = ${this.asset}
hasEnoughPixel = ${this.asset.width >= props.maximumWidth * 2}
}
asset = ${props.image || props.thumbnailFromResources}
async = ${props.async}
maximumWidth = ${props.maximumWidth * 2}
}
renderer = Neos.Fusion:Case {
noVideoID {
condition = ${!props.videoID || !props.platform}
renderer = Jonnitto.PrettyEmbedHelper:Notification {
@if.set = ${props.showBackendNotification}
key = 'noVideoID'
default = 'Please add a Video URL / ID or url in the inspector'
}
}
noPoster {
condition = ${!props.poster && (props.platform == 'youtube' ? props.type == 'playlist' : true)}
renderer = Jonnitto.PrettyEmbedHelper:Notification {
key = 'needPreviewImage'
default = 'You need to define a custom preview image.'
}
}
default {
condition = true
renderer = afx`<Jonnitto.PrettyEmbedVideoPlatforms:Component.Video {...props} live={node.context.live} />`
}
}
}
}