I am creating a portfolio website for a design company.
They are dropping images and videos in the order they are to appear using kirbytext tags. I am able to position the element that is created by (video: ) kirbytext in the position I want at the size I want, but I don’t know how to add autoplay to it. In another thread I saw something about editing the config to change the way Kirby writes the embed code, but I don’t know which config file this should go into.
The post linked above looks like it should help me, but I am at a loss on how to implement this.
I want the video source to show up with the following attached:
?autoplay=1&loop=1&muted=1
I have been staring at the above linked post and trying to figure out where to begin. I created a config.php, put the following code to no avail, but I’m pretty sure I’m missing something significant:
I even tried going to the source and fiddling with the helpers or the tags file. I was able to get the class to change, but I can’t figure out how to modify the urls.
I tried it as below, which is exactly what you had posted in the other thread, except changing youtube to vimeo. Is this supposed to go in config.php? Or somewhere else? there’s a bunch of other code in the other thread that it looks like the attached code is supposed to modify, but I don’t know where that is.
I haven’t been able to get any results out of the config method. However, if anyone finds this in the future, I was able to solve my problem with a few lines of javascript, which are then called alongside any other $(document).ready() stuff.
function vimeo_funtimes() {
$('iframe').each(function( index ) {
var vimeosrc = $(this).attr('src') + '?background=1&autoplay=1&loop=1&muted=1';
$(this).attr('src', vimeosrc);
});
}