Page 1 of 1
Video as Background in LayoutGrid
Posted: Sat Aug 12, 2023 7:26 pm
by sieweb
Hi, I have set a video as Background in a LayoutGrid.
Is it possible somehow to let the video play just once without repeating?
horst
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 6:32 am
by Pablo
There is no option for this, but if you use a YouTube video then you can try to add
&loop=0
in the video URL.
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 7:38 am
by sieweb
Pity, it is no yt video but a local graphic design one not suited for a yt upload. As a looping video distracts too much from the actual content I will not do.
horst
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 7:56 am
by wwonderfull
sieweb wrote: Sun Aug 13, 2023 7:38 am
Pity, it is no yt video but a local graphic design one not suited for a yt upload. As a looping video distracts too much from the actual content I will not do.
horst
I think other than default features custom scripts maybe needed. If you need any scripts then you can contact if needed. It has been tested and I think already possible.
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 8:38 am
by sieweb
wwonderfull wrote: Sun Aug 13, 2023 7:56 am
... then you can contact if needed. ...
Thank you. I have to discuss with the customer, it is his decision
horst
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 8:47 am
by BaconFries
@sieweb are you using any other object on the page that is using jquery? if so you can try the following insert this using Page HTML Between the head <head></head> tags* Note you will also need to change #video to the id of you video for it to work. As mentioned you will need jquery on page to work.
Code: Select all
<script>
$(document).ready(function() {
// set this variable to the number of times you like to loop the video
var loop = 1;
// this event will be invoked when the media has reached the end
$('#video').on('ended', function() {
// check if we should replay the media
if(loop--) {
// replay the video
this.play();
}
});
});
</script>
If you aren't using jquery from within the program then it is possible to call it directly from jquery CDN I can give you the url if required...
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 9:04 am
by sieweb
Another learning curve

:
I am using a third party cookie alert that is using jquery. So, ist should do.
I have tried to use animation so far, but seem not to be very elegant.
horst, and a big thank you.
Re: Video as Background in LayoutGrid
Posted: Sun Aug 13, 2023 9:14 am
by sieweb
BaconFries wrote: Sun Aug 13, 2023 8:47 am
... you will also need to change #video to the id of you video ...
Problem: the Background (video) of the Lyoutgrid has no ID of it's own.
Re: Video as Background in LayoutGrid
Posted: Wed Aug 16, 2023 7:17 am
by BaconFries
Sorry for not getting back sooner. Without a id for the video then this will not work. It may be that it is not possible see the following reply from Pablo on a similar question. Perhaps wwonderfull can share his solution
here to that it will benefit
all who have this requirement for a video.
viewtopic.php?p=470245