You are here

function _video_get_mime_type in Video 6.2

Same name and namespace in other branches
  1. 5 video.module \_video_get_mime_type()
  2. 6 video.module \_video_get_mime_type()

Returns the correct mime-type for the video. Returns false if the mime-type cannot be detected.

1 call to _video_get_mime_type()
video_nodeapi in ./video.module
Implementation of hook_nodeapi(). We use this to append <enclosure> tags to the RSS feeds Drupal generates.

File

./video.module, line 1410
video.module

Code

function _video_get_mime_type($node) {
  switch (_video_get_filetype($node->vidfile)) {
    case 'mov':
      return 'video/quicktime';
    case 'avi':

      // Added
      return 'video/x-msvideo';
    case 'mpg':

    // Added
    case 'mpeg':

      // Added
      return 'video/mpeg';

    // Added
    case 'divx':
      return 'video/vnd.divx';
    case 'rm':
      return 'application/vnd.rn-realmedia';
    case 'flv':
      return 'flv-application/octet-stream';
    case 'asf':
      return 'video/x-ms-asf';
    case 'wmv':
      return 'video/x-ms-wmv';
    case '3gp':
      return 'video/3gpp';
    case 'mp4':
      return 'video/mp4';
    case 'dir':
    case 'dcr':
      return 'application/x-director';

    // We can't support this sources properly, so return false.
    case 'youtube':
    case 'googlevideo':
      return false;
    case 'ogg':
      return 'application/ogg';
    default:

      // We couldn't detect the mime-type, so return false.
      return false;
  }
}