A Introduction to the Drupal 7 Media Module
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.
Thank you Steve, it’s a good intro.
Just a couple of days ago, I was making a presentation about Drupal 7 Media module, too; if anybody is interested, it’s available via SlideShare:
[url][url=http://www.slideshare.net/G_N/drupal-7-media-modules]http://www.slideshare.net/G…[/url][/url]
Is it possible to control access to the media that gets uploaded to the media library? For example, I would like one role type to see certain files and another role type to see others. If I have thousands of images I would like to display only certain ones to specific roles.
Thanks for the tutorial and cutting to the chase. The multimedia asset field is deprecated in the latest releases of Media. Use core file field instead. Also, I find that the MediaFront Module works well with the Media module. The Media Module primarily provides organization and storage. MediaFront provides for flexible presentation of all media types.
Thanks Reggie
I actually saw that deprecated label last week and wondered what the new, recommended alternative was. Thanks for the tip about the core file field.
Hello!
Thanks for this article. It gives a really good introduction to newbies.
Hi,great article, question about choice ”Multimedia asset“, I can’t find it in field manager part. only have file can be choice, any suggestion about this? I use last dev version for media modules, how do you setting to get ”Multimedia asset“? please help thanks.
Hi Nathan. See comment #3. Use the File field instead.
Hi,thanks for help, i change to last version for media module, but also get strange, can you tell me where can find this settings, for media? “As you choose the settings, make sure to check both the Video and youtube boxes.” i check couple times can’t find it. thanks
Great overview. Thank-you.
I have a couple of questions, though.
1) How do I integrate the Plupload module for multiple image uploads, and can I only do this for one specific content type, or can I just upload x number of images for later use by content types later?
2) Can I upload images directly into the folders I have created with Media on my web host’s server and expect to see them in the Media library?
3) How to I position images within text blocks in a content type? What module(s) do I need for this?
Thank-you for any assistance.
As of Mar 30th, 2015, “Multimedia asset” field is deprecated. Anyone in OSTraining knows what the new way is or can update this training please? Thanks.
in this filed how to add alter text like image field