-
AuthorPosts
-
April 23, 2020 at 7:01 pm #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
April 29, 2020 at 9:22 am #1208088Hey 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,
IsmaelApril 29, 2020 at 6:21 pm #1208238Hi 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
May 5, 2020 at 2:27 pm #1209970Hi,
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,
IsmaelMay 5, 2020 at 4:55 pm #1210018Have a look on a Mac using Safari. On both our Macs the issue occurs. It does work properly in Chrome it seems.
May 11, 2020 at 10:20 am #1211783Hi,
Thank you for the update. We’ll have the team check the page on Safari. Please wait for their response.
Best regards,
IsmaelJuly 27, 2020 at 10:35 pm #1233603We’re having the same issue. Are there any updates?
July 30, 2020 at 4:32 am #1234045Hey!
@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!
IsmaelDecember 24, 2020 at 12:12 am #1269685Any 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.
December 27, 2020 at 3:30 am #1269845 -
AuthorPosts
- The topic ‘Video background in color section when set to not loop reverts to first frame’ is closed to new replies.