Who love to Drupal

A Introduction to the Drupal 7 Media Module

Posted by drupallovers on March 30, 2012

The Media Module is one of the most hyped new modules for Drupal 7. It is often talked about as the best option for handling images, video and audio files in Drupal 7.

However, available information about the Media Module is long on 90 minute conference presentations and short on quick, practical guides. So, in this tutorial we’re going to get right to the point. We’re going show you how to set up the Media Module, what it does and how to use it to add YouTube videos to your content. Let’s go ….

Install the Media Module

Head over to http://drupal.org/project/media and download the Media Module. You will also need the latest version of the CTools module from http://drupal.org/project/ctools.


Understand the Media Module

Go to Structure > Content types > click Manage fields next to a content type.

You’ll see that a new field option called “Multimedia asset” is now available.


This field type will allow you to upload a variety of file types. Click Save and you can decide that those file types are:


If you create a “Multimedia asset” field for you content, the image below shows what it will look like when you go to add content.


Click on “Select media” and you can upload new files.


Most importantly, you can also browse a Library of all the files that you’ve uploaded.


This Library feature is the real reason for using Media. As explained on the Media FAQ page: http://groups.drupal.org/node/19746

“The Media module provides an engine that can be used to manage files and metadata. Individual Media module plugins, as well as the modules they integrate with, will handle media display.”

So the only thing this field can do at the moment is upload files to the library. If you want to actually show the files, you’ll need to rely on extra modules. Let’s see how that works.

Go to Structure > Content types > click Manage fields next to a content type. If you choose to add a File field you’ll now have a Media file selector option.


If you choose to add a Image field you’ll now have a Media file selector option.


Here’s what the Image field will look like when you go to add content.


You’ll be able to browse your new media library and insert an image just as you would do normally.


Adding Video to Content via the Media Module

Adding external videos to the Media module relies on the Embedded Media Field module: http://drupal.org/project/emfield.

That module allows you to hook into all sorts of external sites, provided you have the appropriate module. In this example, we’ll use YouTube so install this module as well: http://drupal.org/project/media_youtube.

Install and enable both of those modules.


Go to Structure > Content types and add a Multimedia asset field.


As you choose the settings, make sure to check both the Video and youtube boxes.


Save that new field.

There is one important thing you must now do to make sure that the videos display. Click on Manage Display at the top of the page.


Normally settings for the video field would be available but in this case I had to click Save before they appeared. Then you can click the cog on the right-hand side, next to the video field.


Set the File view mode to Small, Large or Original and click Update.


Click Save so that your changes aren’t lost.

Now you can go to Add content and use the new video field.


Once you’ve inserted the YouTube URL and clicked Submit, you should see a video thumbnail as in the image below.


Save the content and your video will be showing on the page.


YouTube is a simple and popular example. If you want to use other sources for video or audio, head to http://drupal.org/project/emfield and you’ll see a list of all the options and the modules that they require.


A note of caution: Media is under heavy development. There isn’t yet a stable version of Media. As of mid-February, there is a Release Candidate 3 but not yet a stable version.


9 Responses to “A Introduction to the Drupal 7 Media Module”

  1. This piece of writing provides clear idea designed for the new people of blogging, that actually how to do blogging.

  2. Greate post. Keep posting such kind of information on
    your page. Im really impressed by your site.
    Hello there, You’ve performed a great job. I’ll certainly
    digg it and in my view recommend to my friends. I’m confident they will be benefited from this website.

  3. Spot on with this write-up, I absolutely feel this site
    needs far more attention. I’ll probably be back again to read
    through more, thanks for the information!streetdirectory

  4. WOW just what I was looking for. Came here by searching for
    oral sex

  5. I love to disseminate understanding that will I have accumulated through the yr to assist improve team performance.

  6. Hello! I just want to give a huge thumbs up for the great information you could have right here on this post.

    I will probably be coming back to your weblog for
    extra soon.

  7. I love to share understanding that will I’ve built up through the yr to assist improve team performance.

  8. great submit, very informative. I wonder why the opposite specialists of this sector do not understand this.
    You must proceed your writing. I am sure, you’ve a huge readers’ base already!

  9. Melinda said

    You’re so interesting! I don’t think I’ve truly read through anything like that before.
    So good to find somebody with a few original thoughts on this topic.
    Seriously.. thanks for starting this up. This web site is something that’s
    needed on the web, someone with some originality!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: