Last updated January 10, 2012. Created by mradcliffe on May 27, 2011.
Edited by Devin Carlson. Log in to edit this page.
Media types is a bundle for media entities.
You can add a new media type via the media_type_save() function.
<?php
$type = new StdClass();
$type->name = 'mymediatype';
$type->label = 'My Media Type';
$type->base = TRUE; // @todo what?
$type->type_callback_args = array(
'match_type' => 'all', // @todo what?
'mimetypes' => array(), // An array of regex patterns e.g. /^audio/
'extensions' => array(), // An array of extensions
'streams' => array() // An array of streams @todo what?
);
$type = media_type_save($type);
?>