You are here

function _video_common_get_player in Video 6.2

Same name and namespace in other branches
  1. 5 includes/common.inc \_video_common_get_player()
  2. 6 includes/common.inc \_video_common_get_player()
  3. 6.3 includes/common.inc \_video_common_get_player()

Get the object for the suitable player for the parameter resource

3 calls to _video_common_get_player()
video_upload_v_play in types/video_upload/video_upload.module
Implementation of hook_v_play
video_url_v_play in types/video_url/video_url.module
Implementation of hook_v_play
video_youtube_v_play in types/video_youtube/video_youtube.module
Implementation of hook_v_play

File

includes/common.inc, line 15
Add some common functions for the various video types supported

Code

function _video_common_get_player($node) {
  $op = $node->vtype == "upload" ? _video_get_filetype($node->vidfile) : $node->vtype;
  switch ($op) {
    case 'divx':
      return theme('video_play_divx', $node);
    case 'mov':
    case '3gp':
    case '3g2':
    case 'mp4':
      return theme('video_play_quicktime', $node);
    case 'rm':
      return theme('video_play_realmedia', $node);
    case 'f4v':
    case 'flv':

      // flowplayer also supprts MP4, H.264 (.extension?)
      return theme('video_play_flash', $node);
    case 'swf':
      return theme('video_play_swf', $node);
    case 'dir':
    case 'dcr':
      return theme('video_play_dcr', $node);
    case 'asf':
    case 'wmv':
    case 'avi':
    case 'mpg':
    case 'mpeg':
      return theme('video_play_windowsmedia', $node);
    case 'ogg':
      return theme('video_play_ogg_theora', $node);
    case 'youtube':
      return theme('video_play_youtube', $node);
    case 'googlevideo':
      return theme('video_play_googlevideo', $node);
    default:
      drupal_set_message('Video type not supported', 'error');
      break;
  }
}