[GDPR] Add option to show a consent block before actually embedding the video
Hi Ryan and the team :),
this may be a german-only thing, but recently we had some discussions with clients' lawyers regarding the direct embed of videos and the GDPR. It seems that a very strict view is that one cannot/should not allow for communication with the external services prior to the user's explicit consent. I've seen these kind of in-place infos/blockers on several sites now, (in addition to the general "cookie consent" stuff), so I decided to give it a go and expand the GDPR options of this nice module (btw @BernhardBaumrock thank you for this!).
In the module's config section, there is now an additional checkbox for "Video Consent"
which on select reveals some more settings to tweak the info shown in the front end

If selected, the front end will show this info in the place where the video will be displayed:

and if the button is clicked, the video will be embedded without reload (via JS). If the "remember" checkbox is checked, a session cookie is stored so that the consent block will not be shown for this video again during the visitor's session.

For styling, the are video-consent-xxx css classes,
.video-consent-wrap {}
.video-consent-info {}
.video-consent-checkbox {}
.video-consent-button {}
I think this is a helpful expansion of the module, and since these options are totally, well, optional, this should not affect installations already using this.
I have the modified module in place on my guitar site: https://offset.guitars and it seems to run fine.
It would be nice if there'd be a way to add preview images, but since the whole idea is to deny outbound traffic to external services prior to user-consent, I have no idea how to get to the cover image. Perhaps after the consent was given and the video/embed is cached, one could somehow store the cover locally and show that to users who see the consent info for the first time.
I hope this is not too far from the original intend of your module. If so, I'd happily discuss if/how I can make this a "bolt-on" module on top of your module :-)
cheers, thanks for all the good work y'all, Tom
Hey @iamwebrocker thx, that's great!!
I've recently discovered that my gdpr checkbox is unfortunately not enough to fully comply with GDPR so your addition is very welcome. It looks like you did a lot of work on this!! But the great thing is that all the work does not need to be done over and over again :)
On your website you seem to have some display issues with the preview though:

It would be nice if there'd be a way to add preview images, but since the whole idea is to deny outbound traffic to external services prior to user-consent, I have no idea how to get to the cover image.
We can get the preview image via the server using WireHttp - then the server requests the image from google and not the user's browser. We could store that images in a cache folder or something. Should not be too hard I guess.
PS: Also a "allow all videos on this site" checkbox would be nice :) PPS: Are the texts translatable?
Hi @BernhardBaumrock ,
thank you for the input :-)
Good idea for a "don't nag me again for all videos" checbox, I'll add that.
jup, there's display issue in the small video placeholder and my basic css styling, I'll have a look.
I think the texts are translatable, I've wrapped them in the _() function, so this should work with the translation files.
I'm not sure if/how it'll work if the backend input text fields were multilanguage, because not every site has the languageSupport enabled, so maybe using the strings in the translation files is better, albeit a bit more clunky than having input tabs for the language version right in the module config…
cheers, Tom
hey @iamwebrocker it's easy to make them multilanguage: https://github.com/baumrock/RockAnalytics/blob/e162878971162d1729dbdd7ce80846c5976bc9f9/RockAnalytics.module.php#L92
up, there's display issue in the small video placeholder and my basic css styling, I'll have a look.
fixed… :-)
hey @iamwebrocker it's easy to make them multilanguage: https://github.com/baumrock/RockAnalytics/blob/e162878971162d1729dbdd7ce80846c5976bc9f9/RockAnalytics.module.php#L92
'useLanguages' => true,
woot, it is that easy? I <3 ProcessWire just a bit more now.
PS: Also a "allow all videos on this site" checkbox would be nice :)
Added. :-) https://github.com/ryancramerdesign/TextformatterVideoEmbed/pull/22/commits/c0b4cee5bc27035eaa15dc965ab9a6db4fe305c1
Dang, there seems to be an issue with the caching. Once a video has been displayed after the consent was given, it will be displayed after revisiting the site, even when the cookie has been deleted. If I then delete the cached videos via the module settings, the consent is shown again. 🤔
no, wait, there's something going wrong with the js setting the cookies. d'oh. (fixed: fbf5039)
We can get the preview image via the server using WireHttp - then the server requests the image from google and not the user's browser. We could store that images in a cache folder or something. Should not be too hard I guess.
I now have a working version for that. This is a bit rough around the edges, but it works.