Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1206592

    Hi.

    On this page:

    I have a video background set to not loop but adding this to child themes functions php:

    add_action(‘wp_footer’, ‘ava_custom_script’, 10);
    function ava_custom_script(){
    ?>
    <script>
    (function($){
    var video = document.getElementsByTagName(‘video’)[0];

    video.addEventListener(“timeupdate”, function() {
    if (video.currentTime >= 8) {
    video.pause();
    console.log(‘paused’);
    }}, false);

    }(jQuery));
    </script>
    <?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;
    }

    and in the section php in the child theme new shortcodes folder the loop is set to false.

    However, it still reverts back to the first frame after playing and then stops there. I saw the solution to this behavior as being adding the action to the functions php, but I gather that may have been old info.

    How can I make the video stop on the last frame?

    Thanks

    #1208088

    Hey tonyiatridis,

    Thank you for the inquiry.

    We didn’t find the video in the page that you provided above or anywhere in the home page. Where can we see the slider? Please note that the snippet above will only work for mp4 or html5 videos — not for youtube or vimeo.

    Best regards,
    Ismael

    #1208238

    Hi Ismael,

    On this page:

    That video is a mp4 loading on the site itself and which stops instead of looping, but then reverts to the first frame each time.

    Thanks

    #1209970

    Hi,

    We can’t reproduce the issue on our end. The video pauses after 8 seconds but it doesn’t revert back to the first frame. Please check the screenshot below showing the current video time and when it actually stops.

    Screenshot: https://imgur.com/a/8tTd02Z

    Best regards,
    Ismael

    #1210018

    Have a look on a Mac using Safari. On both our Macs the issue occurs. It does work properly in Chrome it seems.

    #1211783

    Hi,

    Thank you for the update. We’ll have the team check the page on Safari. Please wait for their response.

    Best regards,
    Ismael

    #1233603

    We’re having the same issue. Are there any updates?

    #1234045

    Hey!


    @schoolnewspaper
    : We did a quick test on it previously and was not able to reproduce the issue, but not on Safari because the OP forgot to include that particular detail on his initial reply. Could you provide a link to the page containing the video so that we can test it further?

    I’ll add a note in the thread so that other moderators can check it on Safari.

    Note: Requires Safari Test

    Cheers!
    Ismael

    #1269685

    Any resolution to this issue? I’m having the same problem – I would like my MP4 to end and stop on the last frame, but it jumps back to the beginning and stops on the first frame. I’m using a mac, tested on Safari, Firefox and Chrome – it appears on all of them.

    #1269845

    Hi,

    @ellephillip: Did you remove the pause snippet from the site? We cannot find it in the document. Please create a new thread and provide the site details in the private field so that we could test the script. We will close this one for now.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Video background in color section when set to not loop reverts to first frame’ is closed to new replies.