Preventing player to show until cookie consent is given

Last Updated 5 months ago

If you are using a cookie consent manager you can block the embed code iframe from running until user accepts marketing cookies which are set by Screen9 player and Google Analytics and Ads (if enabled on the account).

Below is an example of how to do it with a Klaro tool.

Copy and paste the embed code as described in the embed code article.

<iframe src="" width="800" height="342" allowfullscreen allow="autoplay; encrypted-media" style="border:0;"></iframe>

Replace the src attribute with data-src and add a data-name attribute.

<iframe data-src="" width="800" height="342" allowfullscreen allow="autoplay; encrypted-media" data-name="demo-screen9" style="border:0;"></iframe>

Create a service with the same name in the Klaro config file.

var klaroConfig = {
    acceptAll: true,
    services: [
            purposes: ['marketing'],
            name: "demo-screen9",
            contextualConsentOnly: true,

The player will not be shown then and instead a placeholder will be shown.


This could also be configured in the cookie consent panel.


Once the consent is made, the player shows the video.

This website relies on cookies to function, but no personal data is ever stored in the cookies.

Loading ...