Consent management
The Flowplayer Native consent plugin tells the player whether it is allowed to send analytics and to store data in the browser.
Table of contents
Consent plugin installation
Manual JavaScript setup
Load the consent plugin next to the core player.
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/consent.min.js"></script>
Player and plugins exist in different release versions. Please see the release channel documentation.
OVP managed player
To enable the plugin in an OVP JavaScript (ESM) embed, import the plugin's ESM module after the embed module and register it with flowplayer(consent) before you create the player:
<div id="player-<media id>"></div>
<script type="module">
import flowplayer from "https://embed.flowplayer.com/<player id>/<media id>.js";
import consent from "https://cdn.flowplayer.com/releases/native/3/stable/esm/plugins/consent.min.js";
flowplayer(consent);
flowplayer("#player-<media id>", {});
</script>
Load the plugin from the same release channel or version as the player. In legacy async embeds, add "consent" to the "plugins": [] array instead.
Consent plugin configuration
Without any configuration the player will default to not allowing any tracking or storage when the consent plugin is included.
The consent plugin is configured with the top level configuration property consent. This is a bitmask property where the possible values can be found in flowplayer.consent.tracking and flowplayer.consent.storage enumerations.
Example:
flowplayer("#player", {
src: "my-source.mp4",
consent: flowplayer.consent.tracking.ALL | flowplayer.consent.storage.NONE // Allow all tracking, allow no storage
})
You can use the calculator below to construct the numeric value if you don't want to use the enumerations.
Tracking properties
In order to either turn analytics on or off you can use the flowplayer.consent.tracking enumeration to construct the bitmask value.
Available properties are
-
- property
- description
-
flowplayer.consent.tracking.NONE- No analytics or tracking is allowed to be sent by the player.
-
flowplayer.consent.tracking.ALL- Analytics tracking is allowed.
Storage properties
By default Flowplayer will use localStorage to store data that needs to persist between sessions. This data includes both functional properties (like volume state) and also data that helps us to identify unique devices for both technical and analytics use cases.
You can use the flowplayer.consent.storage enumeration to control the usage of browser storage.
Available properties are
-
- property
- description
-
flowplayer.consent.storage.NONE- No data is allowed to be stored to be used between browser sessions. In other words - setting this value will make the player write into
sessionStorage.
-
flowplayer.consent.storage.ALL- Use of
localStorageis allowed.
Calculator
Consent value:
flowplayer("#player", {
src: "my-source.mp4",
consent: 999999
})