Skip to content

Does this plugin help with privacy?

Mark Wilkinson edited this page Jan 18, 2023 · 1 revision

A number of users have indicated that this plugin is great because it has helped them with GDPR and privacy laws. This is because the plugin swaps out Youtube URLs for their no cookie version, which I believe is slightly better in terms of GDPR etc. as it doesn't use cookies in the users browser.

However the plugin also grabs the thumbnails of the Youtube videos on the front end and these are themselves pulled from Youtube. To be better, in terms of GDPR and privacy, this would have to be prevented until the user consents.

Should you want to, you could get around this by using the same image for all the video thumbnails and hence not loading the thumbnail images from Youtube, Vimeo or Daily Motion (the other supported platforms).

To do this, add the following code to your either your theme functions.php or in a pluing.

<?php
/**
 * Sets a standard thumbnail image for all videos output via BCVE.
 *
 * @param string $image_url The URL of the image you want to use as the thubnail.
 * @param string $video_id  The ID of the video - set my the video service.
 *
 * @return string           The URL of the image.
 */
function hd_standard_video_thumbnail( $image_url, $video_id ) {

	// return a standard thumbnail url.
	// this could be stored in your theme or grabbed from the media library etc.
	return 'https://domain.com/thumbnail.jpg';

}

add_filter( 'hd_bcve_youtube_video_thumbnail_url', 'hd_standard_video_thumbnail', 10, 2 );
add_filter( 'hd_bcve_vimeo_video_thumbnail_url', 'hd_standard_video_thumbnail', 10, 2 );
add_filter( 'hd_bcve_daily_motion_video_thumbnail_url', 'hd_standard_video_thumbnail', 10, 2 );
Clone this wiki locally