Project

General

Profile

Revision 70a4c29b

Added by Assos Assos over 9 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/media_youtube/themes/media_youtube.theme.inc
10 10
 * Preprocess function for theme('media_youtube_video').
11 11
 */
12 12
function media_youtube_preprocess_media_youtube_video(&$variables) {
13

  
14 13
  // Build the URI.
15 14
  $wrapper = file_stream_wrapper_get_instance_by_uri($variables['uri']);
16 15
  $parts = $wrapper->get_parameters();
......
39 38
    $query['playerapiid'] = drupal_html_id('media-youtube-' . $variables['video_id']);
40 39
    $variables['api_id_attribute'] = 'id="' . $query['playerapiid'] . '" ';
41 40

  
42
    //Add the origin for improved security
41
    // Add the origin for improved security
43 42
    $variables['options']['origin'] ? $query['origin'] = $variables['options']['origin'] : '';
44 43
  }
45 44
  else {
......
74 73
  if ($variables['options']['autohide'] != '2') {
75 74
    $query['autohide'] = $variables['options']['autohide'];
76 75
  }
76
  if ($variables['options']['captions'] > '0') {
77
    // Add captions parameters to the query.
78
    $query['cc_load_policy'] = '1';
79
    if ($variables['options']['captions'] > '1') {
80
      global $language;
81
      // We can specify a default language for captions.
82
      if ($language->language != LANGUAGE_NONE) {
83
        $query['cc_lang_pref'] = $language->language;
84
      }
85
    }
86
  }
77 87

  
78 88
  // Non-query options.
79 89
  if ($variables['options']['nocookie']) {

Also available in: Unified diff