You are here

function template_preprocess_videojs in Video.js (HTML5 Video Player) 6.2

Same name and namespace in other branches
  1. 6 includes/videojs.theme.inc \template_preprocess_videojs()
  2. 7 includes/videojs.theme.inc \template_preprocess_videojs()

Preprocess function for videojs.tpl.php when displaying a view as a playlist.

1 call to template_preprocess_videojs()
videojs_preprocess_videojs_formatter_videojs in includes/videojs.theme.inc
Preprocess function for videojs.tpl.php when using a playlist.

File

includes/videojs.theme.inc, line 85
Theme and preprocess functions for the Video.js module.

Code

function template_preprocess_videojs(&$vars) {
  videojs_add();
  $items = $vars['items'];
  $vars['player_id'] = 'videojs-' . str_replace('_', '-', $vars['player_id']);
  $vars['width'] = intval($vars['attributes']['width']);
  $vars['height'] = intval($vars['attributes']['height']);
  $vars['autoplay'] = !!variable_get('videojs_autoplay', FALSE);
  $vars['items'] = array();
  foreach ($items as $item) {
    $item['videotype'] = _videojs_get_filetype($item['filemime']);
    if ($item['videotype'] == NULL) {
      continue;
    }
    $item['url'] = _videojs_create_url($item);
    $vars['items'][] = $item;
  }
  $vars['poster'] = NULL;
  if (!empty($items['thumbnail'])) {
    $vars['poster'] = _videojs_create_url($items['thumbnail']);
  }
}