Floatbox video & GDPR

Page: 1

Author Post
Registered: May 2019
Posts: 2
Hello, first apologise for my english and thank-you very much your amazing JS.
Since several weeks, i try to add tarteaucitron.js for GDPR consent in video floatbox.
Video (youtube or vimeo) iframe embedded player are call with "href=..." but to use the GDPR script tarteaucitron i must call the video in a <div> with a class="youtube_player" and a videoID="video_id" (it creates an iframe as floatbox).
I do it in a hidden div and it works for the GDPR consent request but then the "data-fb-options" not work any more, especialy i'd like to add autoPlayVideo and autoEndVideo.

html code:
<a href="#videobox" class="floatbox"
data-fb-options="type:video autoPlayVideo:true autoEndVideo:true width:854 height:480">
<div id="videobox" class="youtube_player" youtubeid="video_id" style="display:none;"></div>

Do you know how can i have all the fonction of data-fb-options with an hidden div only use to add video? Maybe a code to add in fbOptions.js ?
I also try to use floatbox to call a php page with video content. No more succes, i can manually add autoplay but not autoend.
Thank you for your help.
Registered: Aug 2008
Posts: 3382
If I read this correctly, you want to use a script other than Floatbox to run your videos, but that script lacks some functionality that the Floatbox video player has.

The quickest way to get that missing functionality would be to switch over to using the Floatbox script for your videos. Having said that this can't be done in your context, that leaves adding the desired functionality to the non-Floatbox script and player in use.

Using a php page to show the video is a promising approach. You say that autoplay is working in that context, so that just leaves adding autoend behaviour to that php page. Floatbox uses window.postMessage functionality to communicate from its video player to the Floatbox core code. If you have time and skill, you may perhaps be able to review Floatbox's core.js source and the its video.html file to see how this communication might be implemented in your php player.

Perhaps a quicker approach to try first would be to replace your php video player with Floatbox's video.html file. With luck, this approach would require no more effort than figuring out the src URL and querystring parameters that Floatbox uses when starting the video.html player. I recommend trying to use video.html first before trying to add its functionality to your own php video page.

Since Floatbox is working fine, I can't get involved in the coding of other players or scripts. Hopefully the suggestions here are sufficient to point you in a fruitful direction.
Registered: May 2019
Posts: 2
Thank you very much for your answer.
It's not easy for me to explain you in English. :D I am developing my site in local so I can not send you a concrete example.

The tarteaucitron.js script is not really a player. This is a script that allows a user to accept or decline cookies. It is now mandatory by European law GDPR (RGPD in French). The script allows to display buttons "accept" and "refuse" cookies when opening the site and, in my case, before playing video youtube or Vimeo. For example, if the user accepts cookies for youtube, the script triggers an iframe:

<iframe src = "https://www.youtube-nocookie.com/embed/ &#039;+ video_id +&#039;? &#039;+ ..."></ Iframe> &#039;

If you are interested here is the link of the script:

In any case, your answer gives me good ways to try to do what I want.
I will study the video.html file as you advise me and see if I can adapt it for Youtube or Vimeo.
If someone is interressed, I would return to the forum to share my results.
Thanks again for your help. You're right your Floatbox is working really fine. Personally, I think it's really the best of all.

Page: 1