Hi there,
I’m using the vimeo() and youtube() functions in my Kirby 2 site, but am trying to make it compliant with the GDPR cookies law, so I need to change the output iframe code from e.g.
Alternatively you could use something like LazyFrame which defers the loading of the video until a user interacts with it, so the Cookies don’t drop until that point. You could fire it from the cookie acceptance script i think, so it won’t work until they accept cookies. However, you would still need modify the tag described by @texnixe above to add the data attributes.
I’m afraid I’m still a little lost… sorry - I don’t suppose you’d be able to give me an example of where I’d edit that code to change e.g. ‘src’ to ‘data-src’ or add in the ‘data-categories’ attribute.
needs to be replaced. The second part of what I posted above is the code that generates the iframe.
So instead of using this method, you would create your own myYoutube (or whatever you want to call it) function in a plugin that basically takes the original code, then make the relevant changes.