-
AuthorPosts
-
November 26, 2021 at 10:33 pm #1330638
Hello Kriesi Team
I have a background video in a colour section. The video is a link from Vimeo. Unfortunately, the video keeps looping. I tried to disable it via the Vimeo link loop=0 but that does not seem to work. Also tried to add it via a grid section and insert the video element. But there the autoplay does not work.
link to the website below. It is the first section on the homepage that comes up.
Appreciate any help.
Thank you.
CorinaNovember 28, 2021 at 8:39 pm #1330754Hey Corina,
Thanks for the link to your site, my research finds that this is a known, and argued expected behavior for the Vimeo player when a video is a background video.
I tested your video in a color section background & in a video element and found this a reasonable explanation and do not believe that it is a result of the Enfold element.
I did come up with a possible solution that works on my test site and also seems to work on your site.
The following script rewrites the iframe url after the video starts and breaks the loop, thus ending with the video on the first frame.
If you would to try this, add this code to the end of your functions.php file in Appearance ▸ Editor:function custom_script() { ?> <script> (function($){ setTimeout(function(){ $("#top.home #av_section_1 iframe").attr("src", "//player.vimeo.com/video/650191459?portrait=0&byline=0&title=0&badge=0&loop=0&autopause=0&api=1&rel=0&player_id=player_5394_254066182_1922605071&color=ef5e95"); },800); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
The only other solution I can recommend would be to embed your video in a code block so that it is not a background video.
Best regards,
MikeNovember 29, 2021 at 11:23 am #1330822Hi Mike
Thank you so much for that.
—Custom Function
Tried this, but the frame it stops on is wrong. It should stop when the full word is shown. Not sure how to do that as I can’t code. I tried to change the 800 to a lesser value but that did not change anything.—Code Block
I tried the code block but that adds a play control in the middle of the ‘video’. I disabled all controls at the vimeo end and had a look at the iframe but could not find anything.Is there a way to control when the video stops in the custom function?
Thanks so much.
Corina- This reply was modified 2 years, 11 months ago by cd2s.
November 29, 2021 at 1:51 pm #1330833 -
AuthorPosts
- You must be logged in to reply to this topic.