diff --git a/video_embed_field.handlers.inc b/video_embed_field.handlers.inc
index 1962008..8dd7c53 100644
--- a/video_embed_field.handlers.inc
+++ b/video_embed_field.handlers.inc
@@ -39,6 +39,7 @@ function video_embed_field_video_embed_handler_info() {
'theme' => 'dark',
'iv_load_policy' => 1,
'class' => '',
+ 'privacy' => 0,
),
);
@@ -197,7 +198,12 @@ function video_embed_field_handle_youtube($url, $settings) {
$settings['wmode'] = 'opaque';
$settings_str = urlencode(_video_embed_code_get_settings_str($settings));
- $output['#markup'] = '';
+ // Check if privacy mode is enabled.
+ if($settings['privacy'] == 1) {
+ $output['#markup'] = '';
+ } else {
+ $output['#markup'] = '';
+ }
return $output;
}
@@ -426,6 +432,13 @@ function video_embed_field_handler_youtube_form($defaults) {
'#description' => t('CSS class to add to the player'),
'#default_value' => $defaults['class'],
);
+
+ $form['privacy'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Privacy-enhanced mode'),
+ '#description' => t('Enable privacy enhanced mode so YouTube won\'t set cookies until after a video is started.'),
+ '#default_value' => $defaults['privacy'],
+ );
return $form;
}