You are here

function mediafront_is_media in MediaFront 6.2

Same name and namespace in other branches
  1. 6 mediafront.module \mediafront_is_media()
  2. 7 mediafront.module \mediafront_is_media()

Checks to see if a file is a media file.

1 call to mediafront_is_media()
mediafront_get_media_file in ./mediafront.module
Given a Drupal file object, this function returns the media player file object.

File

./mediafront.module, line 647

Code

function mediafront_is_media($mimetype, $extension) {
  if (in_array(substr($mimetype, 0, 5), array(
    'video',
    'audio',
  ))) {
    return true;
  }
  $media = in_array($extension, array(
    'swf',
    'mov',
    'mp4',
    'mp3',
    'm4v',
    'flv',
    'f4v',
    'ogg',
    'oga',
    'ogv',
    '3g2',
    'wav',
    'aif',
    'm4a',
    'aac',
    'wma',
    'webm',
  ));
  return $media;
}