• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty

FV Player should only show player if cookie consent is given (Borlabs Cookie)

[Solved]

Foliovision › Forums › FV Player › How to … › FV Player should only show player if cookie consent is given (Borlabs Cookie)

  • Christian 3 years, 11 months ago

    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

Viewing 16 replies - 1 through 16 (of 16 total)
  • Mária Stašová 4 years ago
    Avatar photo

    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,
    Maria

    Alec Kinnear 4 years ago
    Avatar photo

    Hi 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.

    Christian 4 years ago

    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

    Alec Kinnear 4 years ago
    Avatar photo

    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.

    Martin 4 years ago

    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,
    Martin

    Christian 4 years ago

    Hi Martin,

    I do not embed youtube videos with FV Player right now – I do only embed videos hosted on bunny.net with FV Player.

    Christian

    Alec Kinnear 4 years ago
    Avatar photo

    Hi 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.

    Christian 4 years ago

    Hi Alec,

    unfortunately I do not know such a general standard. I only recognize, that plugin Borlabs Cookie seems to be a very often used solution to manage cookie consents in WordPress. Even lawyers use it.

    Christian

    Christian 2 years ago

    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

    Martin 2 years ago

    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,
    Martin

    Christian 2 years ago

    Hello 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

    Martin 2 years ago

    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,
    Martin

    Christian 2 years ago

    Hi 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 / }

    1. 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 / }

    Martin 2 years ago

    Hello Christian,

    It seems to me if you put this to that global field FV Player should start to work:

    if ( window.fv_player_load ) {
      fv_player_load();
    }

    Thanks,
    Martin

    Christian 2 years ago

    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

    Martin 2 years ago

    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

Viewing 16 replies - 1 through 16 (of 16 total)
Reply To: FV Player should only show player if cookie consent is given (Borlabs Cookie)



Please Sign in or Register to upload files.

Related Posts

  1. Play video or show image, after live HLS video stream

    Play video or show image, after live HLS video stream

  2. FV Player Pro and Bunny.net Stream

    FV Player Pro and Bunny.net Stream

  3. Problem playing Bunny Stream in FV Player

    Problem playing Bunny Stream in FV Player

Primary Sidebar

Sign in Register
FV Player Docs Post New Topic

Welcome

to Foliovision support forums! We'll be happy to provide free support to resolve all the reported bugs. You always can start by specifying your OS and browser and steps to reproduce the bug.

If you need help with the installation on your site, please submit a request for a Pro Support Incident. We'll have you up and running in no time, with detailed instructions on how to resolve your issue yourself in the future.

Facing a hard to solve WordPress problem? On a tight deadline?

Let us take care of it for you
right now.

Pro Support Buy FV Player

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2025 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. ‭+421 2/5292 0086‬

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary Cookies

Strictly Necessary Cookie allow you to log in and download your software or post to forums.

We use the WordPress login cookie and the session cookie.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Support Cookies

Foliovision.com uses self-hosted Rocket.chat and self-hosted Freescout support desk to provide support for FV Player users. These cookies allow our visitors to chat with us and/or submit support tickets.

We are delighted to recommend self-hosted Rocket.chat and especially Freescout to other privacy-conscious independent publishers who would prefer to self-host support.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

3rd Party Cookies

This website uses Google Analytics and Statcounter to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

We reluctantly use Google Analytics as it helps us to test FV Player against popular Google Analytics features. Feel free to turn off these cookies if they make you feel uncomfortable.

Statcounter is an independent Irish stats service which we have been using since the beginning of recorded time, sixteen years ago.

Please enable Strictly Necessary Cookies first so that we can save your preferences!