Last active
August 29, 2015 14:09
-
-
Save nalipaz/9402cfe208fa44d8d1f0 to your computer and use it in GitHub Desktop.
How to save a media type for the media module, will save new or update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$types['video'] = new stdClass(); | |
$types['video']->name = 'video'; | |
$types['video']->label = "Video"; | |
$types['video']->base = TRUE; | |
$types['video']->type_callback_args = array( | |
'match_type' => 'all', | |
'mimetypes' => array('/^video/'), | |
'extensions' => array('mov', 'mp4', 'avi'), | |
'streams' => array('public', 'private'), | |
); | |
foreach ($types as $name => $type) { | |
media_type_save($type); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment