Forcing the player to only set approved cookies

Last Updated 4 months ago

If you have integrated Screen9 player using Javascript API or IFrame Player API on empty div or iframe element, then you can make sure the player is storing only cookies that were allowed by end user in a cookie consent manager. First, enable cookieless player on your account by going to Settings -> Player and switch Disable all cookies to ON. Then set the allowedCookies option in the configuration:

var options = {
    mediaid: "AAABBBCCC",
    containerid: "video_HTML_container_ID",
    allowedCookies: ["marketing", "preferences", "statistics"]
};
new screen9.Player(options);

Read more about different cookie types in the Cookies, the GDPR, and the ePrivacy Directive document.

Read more about this configuration setting in IFrame Player API.

Klaro example

If you are using Klaro to manage cookie consent, here is a code extract that checks the currently allowed cookies and passes them to the Screen9 Player:

<script src="klaro.js"></script>


<script type="text/javascript" src="https://cdn.screen9.com/players/iframe-api.js"></script>


<div id="iframe"></div>


<script>
    var klaroConfig = {
        services: [
            {
                translations: {
                    zz: {
                        title: 'Screen9 Player preferences',
                        description: 'Player will store user preferences in local storage like volume level or selected captions language.'
                    }
                },
                purposes: ['Preferences'],
                name: 'screen9-player-preferences'
            },
            {
                translations: {
                    zz: {
                        title: 'Screen9 Player statistics',
                        description: 'Player will store a unique ID for the individual user that will be used across user sessions.'
                    }
                },
                purposes: ['Statistics'],
                name: 'screen9-player-statistics'
            },
            {
                translations: {
                    zz: {
                        title: 'Screen9 Player marketing',
                        description: 'Player will show personalized ads.'
                    }
                },
                purposes: ['Marketing'],
                name: 'screen9-player-marketing'
            },
        ]
    }
</script>


<script type='text/javascript'>
    var iframe = document.querySelector('#iframe');
    var allowedCookies = [];
    if (klaro.getManager().getConsent('screen9-player-preferences')) {
        allowedCookies.push('preferences');
    }
    if (klaro.getManager().getConsent('screen9-player-statistics')) {
        allowedCookies.push('statistics');
    }
    if (klaro.getManager().getConsent('screen9-player-marketing')) {
        allowedCookies.push('marketing');
    }

    var options = {
        mediaid: '0L7JALosbzJu8Pi2VSYM3Q',
        containerid: iframe,
        allowedCookies: allowedCookies
    };
    var player = new screen9.Player(options);
</script>

This will produce a popup like this:

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

Loading ...