September 16, 2011
We've been testing different contributed Drupal 7 modules to assess the readiness of the ecosystem for production sites. The Media module is an ambitious and promising solution for managing and deploying a variety of media assets. It promises to be the successor to the very successful Embedded Media Field
After reading the extensive documentation it occurred to me there was a need for a tutorial in this area.
This tutorial will focus on creating a gallery of YouTube videos using the Media and Media YouTube modules. This is the end product we will be building:
In completing this tutorial I used Drupal 7.8 with the following contributed modules:
Install and enable these modules as usual.
Next we'll create a field to hold our video. Click on the Manage Fields tab and add a new field 'video' of type 'Multimedia asset' with a widget of 'Media file selector'. Click Save.
Click on Save field settings button on the next page. You will now be on the settings screen for the new video field. Under 'Allowed media types' check the Video checkbox. In 'Allowed URI schemes' check the youtube:// URI box. The click on the Save settings button.
Now click on the Manage Display tab and select Media for the video format. Click Save. Now click on the gear icon in the Video row. Select the Default file view mode and click on the Update button.
This next part is what trips people up and has caused confusion. We need to enable the displays for the Youtube video 'files'. To do this go to Configuration -> Media -> File types. Make sure the Default tab is select in the upper right. Check the YouTube Video and YouTube Preview Image checkboxes. Then check the YouTube Video Display setting and enter the width and height of your video. In the YouTube Preview Image tab enter the preview image style. Save the configuration.