Foliovision › Forums › FV Player › How to … › FV Player should only show player if cookie consent is given (Borlabs Cookie)
-
Hi foliovision team,
if I take care about GDPR then I have to ask my website visitors to give their consent to show videos on my website which are not self-hosted. E.g. do I need the consent BEFORE showing a Youtube video on my website – BEFORE my website gets in contact with Youtube.
For this their is an often used WP plugin called Borlabs Cookie. Only if users allows “media cookies”, Youtube and Vimeo videos are shown on the website (embedded per Iframe).
I’m using FV Player Pro on one of my websites. FV Player shows videos from bunny.net Stream. It would be great to have a tutorial how to setup Borlabs Cookie & FV player, so that the player is also only shown, if the visitor has given his consent. I don’t know how yet, because FV Player seems not to generate an IFrame.
Christian
-
-
Hello Christian,
thank you for your question and for using FV Player!
We do not support this yet. However, this is a very interesting suggestion. I will discuss your inquiry with my team and we’ll get back to you.
As of now, FV Player itself only uses the cookies for remembering the video position, sound level, playback speed and preferred video quality.
For YouTube videos embedded in FV Player, we do use the youtube-nocookie.com domain by default.Thanks,
MariaHi Christian,
Thanks for the suggestion.
We are not particularly fussed about preventing people from seeing videos unless they have agreed to cookies. The whole cookie law is horribly abused by large companies (I spend twenty minutes a day customising disagreement with cookies just to browse – I do use three computers and a mobile phone, but it’s crazy nonetheless).
If this feature is important to you and you’d like us to develop this for your website, we’d be happy to do it as custom development. That’s what’s great about FV Player. It’s freestanding code so your site can have exactly the features you need or want.
Hi Alec,
I agree with you – in general: the whole cookie consent noise is ridiculous and makes life harder for small companies like us. So much to read, so much to ask, so much to do. This is also true for whole GDPR stuff.
On the other side we have to do this to avoid conflicts.
I thought there may be a solution/tutorial without extra development afford.
Before thinking about this, I would ask the developers of the Cookie Consent Plugin, if they could integrate FV Player in their defaults.Thank you
Christian
Hi Christian,
Thanks for sharing your thoughts. It seems that you are on the right track having Cookie Consent not show YouTube links
FV Player does play through the YouTube API so I’m not sure we actually do violate the cookie laws as any cookies should be first party and non-marketing – Cookie Consent should be preventing your website from setting first party cookies until consent is agreed.
Another alternative is that you could audit any cookies set by your site and erase those cookie if the reader chooses not to agree to cookies.
The difficulty with FV Player trying to not set cookies until allowed is that there are literally dozens of cookie assent software companies. It could turn into a full-time job just managing cookie assent integration. If you find out that there’s a general standard we can follow which all the cookie assent software developers embrace, we would seriously consider adding that code.
Hello Christian,
I found add that the youtube-nocookie.com domain is used for YouTube only in FV Player Pro Beta currently. Here’s how to switch to that: https://foliovision.com/player/basic-setup/switching-fv-player-pro-to-beta
Please let us know if it helps and then we can make it part of the release version.
Thanks,
MartinHi Christian,
Thanks for your note about YouTube use. The last email still applies:
The difficulty with FV Player trying to not set cookies until allowed is that there are literally dozens of cookie assent software companies. It could turn into a full-time job just managing cookie assent integration. If you find out that there’s a general standard we can follow which all the cookie assent software developers embrace, we would seriously consider adding that code.
Hi Alec,
is it possible to wrap a wordpress shortcode around the player automatically? A shortcode, that can be defined in the plugin settings?
Borlabs Cookie plugin will then avoid showing the code in this shortcode until visitor gives his ok to show it.
Example of such a shortcode:
[borlabs-cookie id=”fvplayer” type=”content-blocker”]…blocks this…[/borlabs-cookie]ID “fvplayer” is set by the user of the Borlabss Cookie plugin.
FV Player would only be shown, if visitor allows it in the cookie settings.
Disadvantage of this solution: User cannot decide: “I want to show video content of bunny, but not of youtube.” Instead all videos – independent from the source – are hidden or shown.
Would be great to implement such a solution to use FV Player according to the GDPR and cookie rules…
Thanks
Christian
Hello Christian,
We did not look into this yet, but I wanted to confirm that what you propose actually works.
I see how you wrap the
[fvplayer]
shortcode with[borlabs-cookie id=”fvplayer” type=”content-blocker”]…[/borlabs-cookie]
.Does it mean that FV Player is not even part of the page HTML code and it only becomes available if the user confirms the cookies? Does the page reload when confirming the cookies?
Or is the content simply hidden with CSS?
Thanks,
MartinHello Martin,
I have setup a testpage: https://www.gluecksknirpse.de/stefans-seite/
Here I have added (below the 2 buttons – please ignore them) the following wp text:
[borlabs-cookie id=”bunny” type=”content-blocker”][fvplayer id="68"][/borlabs-cookie]
The id of borlabs-cookie shortcode can be set to any other id.
If you click on “Inhalt laden” (= load content), FV Player is shown – but with an error message.
Could you have a look in the source code to answer your question? ;-) I don’t think, that player is simply hidden with CSS.
Christian
Hello Christian,
I see it changes the player HTML to base64 encoded string in a script tag. So that Borlabs Cookie plugin would have to provide some JavaScript event when user clicks the button. That way we could run the FV Player initialization on that even and avoid that error message.
Please check with Borlabs Cookie developers to see if they provide such JavaScript event as without it building any kind of integration would be harder.
Thanks,
MartinHi Martin,
thank you very much for having a look on this (again). I have no JS knowledge, so I hope that I have understood your correctly: Borlabs Cookie provides 2 JS fields:
1.) JavaScript stored in the Global field is executed as soon as a blocked content is unlocked by the visitor (i.e. only once per page). For example, use this to load an external JavaScript library.
To execute the JavaScript stored in the Global field before the blocked content is loaded, enable the Execute Global Code First option.
If this option is enabled (status: ON) and a visitor unblocks the content, the JavaScript from the Global field is executed before the blocked content is loaded.
function (contentBlockerData) { / Here is your global code / }
- JavaScript stored in the initialization box is executed each time blocked content is unblocked (that is, as many times as the visitor unblocks content). The code is executed after the JavaScript from the Global Box.
For developers
The code is executed in a function that takes the variable el as a parameter. el contains the unlocked object.function (el, contentBlockerData) { / Here is your initialization code / }
Hi Martin,
I see, that my last response was lost :-( So here a new try:
Thank you very much for this code – it works.
Now I “only” need a mechanism to wrap fv-player shortcode with borlabs cookie shortcode. I can go through all pages where I have added fv-player shortcode – but this is too time consuming.
Is there another way to do this? Would it be possible to add a new wrap field to fv player settings to enter a wrapper shortcode?
Christian
Hello Christian,
It seems to me you can just use the_content filter, like seen in the example here: https://developer.wordpress.org/reference/hooks/the_content/#usage
In the filter, you can do a preg_replace() similar to this:
$content = preg_replace( '~(\[fvplayer.*?\])~', '[borlabs-cookie id="fvplayer" type="content-blocker"]$1[/borlabs-cookie]', content );
If you have a programmer working on your website it should be very easy.
Thanks,
Martin