quick_start-8.x-1.0-beta10/modules/quick_features/quick_v_heroslider_media/quick_v_heroslider_media.module
modules/quick_features/quick_v_heroslider_media/quick_v_heroslider_media.module
<?php
/**
* @file
* The quick_v_heroslider_media module.
*/
/**
* Implements hook_page_attachments().
*/
function quick_v_heroslider_media_page_attachments(array &$attachments) {
$attachments['#attached']['library'][] = 'quick_v_heroslider_media/general-styling';
$attachments['#attached']['library'][] = 'quick_v_heroslider_media/vimeo-player';
$attachments['#attached']['library'][] = 'quick_v_heroslider_media/youtube-player';
$attachments['#attached']['library'][] = 'quick_v_heroslider_media/general-scripts';
}
/**
* Implements hook_preprocess_video_embed_iframe__youtube().
*/
function quick_v_heroslider_media_preprocess_video_embed_iframe__youtube(&$variables) {
// Hide youtube logo and controls.
$variables['attributes']['id'] = "youtubeVideo";
$variables['query']['modestbranding'] = '0';
$variables['query']['enablejsapi'] = '1';
$variables['query']['showinfo'] = '0';
$variables['query']['controls'] = '0';
}
/**
* Implements hook_preprocess_video_embed_iframe__youtube_playlist().
*/
function quick_v_heroslider_media_preprocess_video_embed_iframe__youtube_playlist(&$variables) {
// Hide youtube logo and controls if playlist url is choose.
$variables['attributes']['id'] = "youtubeVideo";
$variables['query']['modestbranding'] = '0';
$variables['query']['enablejsapi'] = '1';
$variables['query']['showinfo'] = '0';
$variables['query']['controls'] = '0';
}
/**
* Implements hook_preprocess_video_embed_iframe__vimeo().
*/
function quick_v_heroslider_media_preprocess_video_embed_iframe__vimeo(&$variables) {
// Hide Vimeo play control.
$variables['query']['background'] = 1;
// Prevent vedio autoplay.
$variables['query']['autoplay'] = 0;
// Stop Vimeo vedio from looping.
$variables['query']['loop'] = 0;
}
