Challenge
A cookie audit revealed YouTube cookies being set on page load before any user consent, a clear GDPR violation. The root cause was a jQuery Backstretch vendor library that initialised video embeds unconditionally. Vimeo and Video.js embeds had the same problem. A simple overlay was not enough; the entire video loading pipeline needed to be consent-aware from the first JavaScript execution.
What Was Built
Custom GDPR-compatible rewrites for youtube-video.js and vimeo-video.js, replacing unconditional init with a consent-gated init. Cookie consent overlay injected over all video embeds on page load when no consent is present; removed and video initialised only after the relevant cookie category is accepted. Edge case handled: if consent was already given in a previous session, the page reload correctly initialises the video without displaying the overlay and without triggering a JS error. Integration tested against the Civic cookie consent manager already in use. YouTube embeds inside content teasers brought under the same consent umbrella.
Outcome
Zero third-party video cookies set before consent. Cookie overlay shows consistently on all video placements. Videos play correctly in all tested consent scenarios including cold load, consent grant during session, and return visit with existing consent.
Have a similar challenge?
Get in touch - no sales pitch, just a straightforward conversation.