You are here

private function Playlist::getMimeType in MediaFront 6

Same name and namespace in other branches
  1. 6.2 players/osmplayer/player/playlist/Playlist.php \Playlist::getMimeType()
  2. 7 players/osmplayer/player/playlist/Playlist.php \Playlist::getMimeType()

Gets the mime type of a file.

Return value

  • The file to get the mime type of.
1 call to Playlist::getMimeType()
Playlist::rssGetTrack in players/osmplayer/player/playlist/Playlist.php
Returns a single track listing in an RSS XML format.

File

players/osmplayer/player/playlist/Playlist.php, line 336

Class

Playlist
Playlist Class

Code

private function getMimeType($file) {
  $extension = $this
    ->get_file_ext($file);
  switch ($extension) {
    case 'flv':
      return 'video/x-flv';
    case 'rtmp':
      return '';
    case 'mp4':
      return 'video/mp4';
    case 'm4v':
      return 'video/mp4';
    case 'mov':
      return 'video/quicktime';
    case '3g2':
      return 'video/3g2';
    case 'mp3':
      return 'audio/mpeg';
    case 'm4a':
      return 'audio/mp4';
    case 'aac':
      return 'audio/aac';
    case 'ogg':
    case 'ogv':
      return 'video/ogg';
    case 'oga':
      return 'audio/ogg';
    case 'wav':
      return 'audio/wav';
    case 'aif':
      return 'audio/aif';
    case 'wma':
      return 'audio/wma';
    case 'jpg':
      return 'image/jpeg';
    case 'gif':
      return 'image/gif';
    case 'png':
      return 'image/png';
  }
}