You are here

function theme_video_html5 in Video 6.5

Same name and namespace in other branches
  1. 6.4 video_formatter.inc \theme_video_html5()
  2. 7.2 video.theme.inc \theme_video_html5()
  3. 7 video.theme.inc \theme_video_html5()

Play HTML5 videos

1 theme call to theme_video_html5()
video_get_player in ./video_formatter.inc
Get the object for the suitable player for the parameter resource

File

./video_formatter.inc, line 233
Video formatter hooks and callbacks.

Code

function theme_video_html5($video, $node) {
  $themed_output = NULL;
  $video->html5_player = variable_get('video_extension_' . $video->player . '_html5_player', '');
  switch ($video->html5_player) {
    case 'video':
      return theme('video_play_html5', $video, $node, $themed_output);
    case 'videojs':
      $items = _video_object_to_array($video->files);
      $items['thumbnail'] = (array) $video->thumbnail;
      $attributes = array(
        'width' => $video->player_width,
        'height' => $video->player_height,
      );
      return theme('videojs', $items, 'video-' . $video->fid, $attributes);
    default:
      return t('No HTML5 player has been setup. ' . l(t('Please select a player to play HTML5 videos.'), 'admin/settings/video/players'));
  }
}