Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Video Poster Error - Feature: Hide Page Elements Until Load Assets Finished #129

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 50 additions & 43 deletions electron/exportFrontend/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,57 @@
window.loadExclusives();
})
}

});
</script>
{{/payment}}
{{/payment.enabled}}
<style>
body.loading {
display: none;
}
{{#meta}}
{{#font_base_rules}}
/* Set a font for the main article - focus on readability. */
body,
h1,
h2,
h3,
h4,
h5,
h6,
.slideshow,
.slideshow-horizontal {
{{{font_base_rules}}}
}

{{/font_base_rules}}

{{#font_headers_rules}}

/* Set a special font just for item headers. */
.header h1,
.header h2,
.header-fullpage h1,
.header-fullpage h2,
header {
{{{font_headers_rules}}}
}

{{/font_headers_rules}}

{{/meta}}
</style>

{{#meta}}
{{#custom_css}}
<style>
{{{custom_css}}}
</style>
{{/custom_css}}
{{/meta}}
</head>

<body class="longform frozen" name="top">
<body class="longform frozen loading" name="top">
<div id="loading_overlay" class="loading" {{#meta}}{{#splash_screen_img}}
style="background-image:url('{{splash_screen_img}}');background-position:center center;background-size:cover;"
{{/splash_screen_img}}{{/meta}}>
Expand Down Expand Up @@ -591,47 +634,11 @@ <h3>{{{title}}}</h3>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<!-- <script>Hls = {}; // remove me if you use the script above.</script> -->
<script type="text/javascript" src="./bundle.js"></script>
<style>
{{#meta}}
{{#font_base_rules}}
/* Set a font for the main article - focus on readability. */
body,
h1,
h2,
h3,
h4,
h5,
h6,
.slideshow,
.slideshow-horizontal {
{{{font_base_rules}}}
}

{{/font_base_rules}}

{{#font_headers_rules}}

/* Set a special font just for item headers. */
.header h1,
.header h2,
.header-fullpage h1,
.header-fullpage h2,
header {
{{{font_headers_rules}}}
}

{{/font_headers_rules}}

{{/meta}}
</style>

{{#meta}}
{{#custom_css}}
<style>
{{{custom_css}}}
</style>
{{/custom_css}}
{{/meta}}
<script>
window.addEventListener('load', () => {
$('body').removeClass('loading');
})
</script>

</body>

Expand Down
4 changes: 3 additions & 1 deletion frontend-assets/js/media/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down
2 changes: 1 addition & 1 deletion frontend-assets/js/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down