You are here

public static function video_utility::getMimeType in Video 7.2

Video-specific replacement for file_get_mimetype()

The Drupal file_get_mimetype() function lacks support for some video formats.

1 call to video_utility::getMimeType()
Transcoder::executeConversion in includes/Transcoder.inc
This helper function will help to execute video conversion job by loading job from the database and once it completed saving its data in to the database.

File

./video.utility.inc, line 296
This file will be used to keep all utility functions data structures.

Class

video_utility
Helper functions for the Video module.

Code

public static function getMimeType($uri) {
  $extension = self::getExtension($uri);
  switch ($extension) {

    // Work-around for missing WebM support in file_get_mimetype().
    // See http://drupal.org/node/1347624
    case 'webm':
      return 'video/webm';
    case 'm3u8':

      // Could also be application/x-mpegurl
      return 'application/vnd.apple.mpegurl';
    case 'ts':

      // RFC3555
      return 'video/MP2T';
    default:
      return file_get_mimetype($uri);
  }
}