Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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

    #1339082

    Hey 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
    2022-02-05_007.jpg
    and ensure that you edited the section.php correctly
    I have linked to my test page below.

    Best regards,
    Mike

    #1339089

    Hi 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

    #1339094

    Hi,
    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,
    Mike

    #1339096

    Hi 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
    Peter

    #1339108

    Hi,
    We don’t have a way to do that, but you can use the layerslider if you wish.

    Best regards,
    Mike

    #1339119

    is it a youtube video ?

    #1339120

    No, it’s self-hosted video.

    Peter

    #1339271

    Hi,

    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/pause

    Full documentation for the html5 video API is located here.

    // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement

    Best regards,
    Ismael

    #1339568

    Hi 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

    #1339714

    Hi,

    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

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.