From 6ba1eb467025d574cdd8f028ab8ee5bbf4e70475 Mon Sep 17 00:00:00 2001 From: Flowdeeps Date: Thu, 16 Dec 2021 15:25:44 +0100 Subject: [PATCH] Moved preview CSS to head of the document so that it loads before the content. Added class to hide all body content which is then removed when the body has loaded at which point the story elements have attached to their intended styles. Check to see if the video being loaded has a poster in the data object before trying to fill it as it fires an error otherwise. --- electron/exportFrontend/preview.html | 93 +++++++++++++++------------- frontend-assets/js/media/video.js | 4 +- frontend-assets/js/story.js | 2 +- 3 files changed, 54 insertions(+), 45 deletions(-) diff --git a/electron/exportFrontend/preview.html b/electron/exportFrontend/preview.html index 4c254b39..4382c560 100644 --- a/electron/exportFrontend/preview.html +++ b/electron/exportFrontend/preview.html @@ -131,14 +131,57 @@ window.loadExclusives(); }) } - }); {{/payment}} {{/payment.enabled}} + + + {{#meta}} + {{#custom_css}} + + {{/custom_css}} + {{/meta}} - +
@@ -591,47 +634,11 @@

{{{title}}}

- - - {{#meta}} - {{#custom_css}} - - {{/custom_css}} - {{/meta}} + diff --git a/frontend-assets/js/media/video.js b/frontend-assets/js/media/video.js index 5c3b9c6d..ca297796 100644 --- a/frontend-assets/js/media/video.js +++ b/frontend-assets/js/media/video.js @@ -56,7 +56,9 @@ function fixBackgroundVideo($el) { function prepareVideo(scrollStory, $el, id, srcs, attrs) { let video = scrollStory.MURAL_VIDEO[id] - video.poster = attrs.poster + if (attrs.poster) { + video.poster = attrs.poster + } video.muted = attrs.muted video.preload = 'auto' video.setAttribute('webkit-playsinline', '') diff --git a/frontend-assets/js/story.js b/frontend-assets/js/story.js index 6206eca3..da7312ca 100644 --- a/frontend-assets/js/story.js +++ b/frontend-assets/js/story.js @@ -217,7 +217,7 @@ function setItemStart(item) { function setItemStop(item) { if (item.data && item.data.youtubeId) { - youtubeMedia.remove(item) + // youtubeMedia.remove(item) } if (item.data && item.data.vimeoVideoId) {