Note: This implementation will work only for YouTube and Vimeo videos.
For other video players, you can use this article: https://support.cookieinformation.com/hc/en-us/articles/360014351140-3-13-Provide-placeholder-for-blocked-page-elements
If you are using the Cookie Control SDK to control cookies set by Youtube or Vimeo videos.
The result will be that the video is invisible until the user gives consent.
You can give the user a placeholder consent-text to let them know that there is a video placed on the page and by renewing their consent, they can watch it.
Youtube implementation example:
<iframe width="560" height="315" src="" data-category-consent="cookie_cat_statistic" data-consent-src="https://www.youtube.com/embed/3EeY_7ujsew" frameborder="0" allow="autoplay;"></iframe>
How to enable consent-text
Use this JS-variable to enable the consent-text
window.CookieInformation.enableYoutubeNotVisibleDescription = true;
Setup the category
You need to specify the cookie category you used to block the videoes by, in order for the function to work.
window.CookieInformation.youtubeCategorySdk = 'cookie_cat_statistic';
Setup description for consent-text
You can provide your own custom consent-text for this function and will be placed on the page in the spot where the video should be. They will be removed again once the user has consented to the category.
window.CookieInformation.youtubeNotVisibleDescription = 'You have to consent to statistic cookies to see this content.<br /><span>Click here to renew consent</span>';
You can set up a class-name for the consent-text to target CSS-styling.
window.CookieInformation.youtubeBlockedCSSClassName = 'youtube-consent-text';
How to set this up
Navigate to your consent solution and then go to the POP-UP tab.
Go and click the "Advanced settings" to fold out the three code fields.