-
AuthorPosts
-
February 4, 2022 at 1:01 pm #1338891
Hi
I am trying to get a color section background video to not auto loop. I have followed the instructions here
https://kriesi.at/support/topic/how-to-stop-background-video-in-color-section-from-auto-looping/Putting section.php file into the child theme and changing video_loop to false but it is still looping, as you can see in the link below.
many thanks
Peter
February 5, 2022 at 7:09 pm #1339082Hey envapk2,
Thank you for the link to your site, I tested this solution on my demo site and it does work correctly, please check that you followed the solution correctly:
First ensure that this function is in your child theme functions.php:add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
then ensure that your child theme directory structure is: /shortcodes/section/section.php
and ensure that you edited the section.php correctly
I have linked to my test page below.Best regards,
MikeFebruary 5, 2022 at 8:19 pm #1339089Hi Mike
Thanks for that. I had the directory structure wrong – it’s working fine now.
One other thing though, is it possible to freeze the video on the final frame rather than it going back to the first frame?many thanks
Peter
February 5, 2022 at 8:50 pm #1339094Hi,
Glad this helped, unfortunately, you can not freeze the video on the final frame, the only solution I can think of is to change the video’s first frame and then enable the preloader spinner so the video will already be playing when the preloader is done and won’t show a flash of the first frame.Best regards,
MikeFebruary 5, 2022 at 9:02 pm #1339096Hi Mike
Thanks for that idea but I notice that if I use the same video as a background on a Layerslider, and disable the loop, it freezes on the final frame. So I’m thinking that must be doable outside of Layerslider too.
many thanks
PeterFebruary 5, 2022 at 10:20 pm #1339108Hi,
We don’t have a way to do that, but you can use the layerslider if you wish.Best regards,
MikeFebruary 5, 2022 at 11:04 pm #1339119is it a youtube video ?
February 5, 2022 at 11:07 pm #1339120No, it’s self-hosted video.
Peter
February 7, 2022 at 6:11 am #1339271Hi,
You should be able to use the property and function to retrieve the duration of the video and pause it on a specific time.
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/duration
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/pauseFull documentation for the html5 video API is located here.
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
Best regards,
IsmaelFebruary 8, 2022 at 11:46 am #1339568Hi Ismael
I think in this case it would be easier to use Layerslider to achieve what I want but it would be great if an option to freeze a background video in a color section was integrated into future updates.many thanks
peter
February 9, 2022 at 8:18 am #1339714Hi,
but it would be great if an option to freeze a background video
That sounds cool but unfortunately, that option is not yet included in the list of upcoming features. You might have to use the layer slider for now or create a script using the HTML media element API that we linked above.
If you would like to check the current playback time, listen for the timeupdate event.
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.