Skip to content

Commit 0adc8f2

Browse files
committed
PB-375: Align video background with embedded video
- add autoplay and support video files
1 parent 855513e commit 0adc8f2

File tree

3 files changed

+98
-2
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

3 files changed

+98
-2
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/video/converter/attribute/videosrc.js

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/video/master.js

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/video/converter/attribute/videosrc.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ export default class VideoSrc implements ConverterInterface {
3737
"(?:\\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\\d+)\/video\/|video\/|)(\\d+)(?:$|\/|\\?)");
3838

3939
if (youtubeRegExp.test(value)) {
40-
return "https://www.youtube.com/embed/" + youtubeRegExp.exec(value)[1] + (data.autoplay === "true" ? "?autoplay=1" : "");
40+
return "https://www.youtube.com/embed/" + youtubeRegExp.exec(value)[1] +
41+
(data.autoplay === "true" ? "?autoplay=1" : "");
4142
} else if (vimeoRegExp.test(value)) {
42-
return "https://player.vimeo.com/video/" + vimeoRegExp.exec(value)[3] + "?title=0&byline=0&portrait=0" + (data.autoplay === "true" ? "&autoplay=1" : "");
43+
return "https://player.vimeo.com/video/" + vimeoRegExp.exec(value)[3] +
44+
"?title=0&byline=0&portrait=0" + (data.autoplay === "true" ? "&autoplay=1" : "");
4345
}
4446

4547
return value;

0 commit comments

Comments
 (0)