Multimedia Support in Drupal 7 with the Media Module


Before Drupal 7, managing media files often turned into a nightmare, both to implement and then use on the production website. There are countless of modules, especially for Drupal 6, trying to solve the problem. Many of these modules are good for what they where intended to do, but they often lack features or are not flexibility enough to be deployed on different websites. Often you are forced to use more than one solution, ending up with a different user interfaces depending on the media file and so on.

The main problems are with storage, organisation and management of existing media files. Lets face it, before Drupal 7 digital media management is pretty bad (to say it kindly).

For Drupal 7 this have been addressed and the much needed API additions to core is very welcomed and shows great promise to finally provide Drupal with a flexible and extensible foundation to build upon.

Stream Wrappers

Support for PHP stream wrappers in the File API is one of the most important inclusions to the Drupal core for many releases. Simply explained they act as a layer between the source and Drupal. This means that for Drupal it doesn't matter if the file is stored in the local file system or somewhere else Drupal can reach it using a URI call.

For each media type, document format, image format, videos, etc, it will be a matter of implementing a media wrapper to handle that media type, such as the YouTube video module for the Media module. The wrapper takes care of understanding the YouTube video and hooks into the Media module making the videos available though it.

More information about stream wrappers can be found in the handbook page at drupal.org.

The Media Module

The Media module is not part of the Drupal 7 Core, but the team, with Aaron Winborn and Jacob Singh as leaders, behind it have been very much involved in the work of adding the stream wrapper support to core. Plus numerous other enhancement to provide great support for multimedia management. The whole Drupal community owes a lot of gratitude to them both, as well as all the others that are working so hard to make this a reality.

Some of the important features the Media module will provide are:

  • A unified interface for managing multimedia files and resources.
  • API's to make it easy to extend the core features as well as support for any digital format.
  • Integration with rich text editors to easily upload, browse and include media files in the content.
  • Extend the File API and replace the default upload of files.
  • Support for the Field API.
  • Keep track on where each individual media file is used.

In the video below, Jacob Singh gives you a quick demonstration of the current features. I'm sure you will be as excited as I am about this after watching it.

 

Pretty amazing stuff isn't it?

Personally I can't wait until the Media module is ready enough to be tested by us mere mortals. Every time I see a new video or read a post about the progress I just get more excited about it. It is going to fundamentally change the way we manage digital media in Drupal.

Finally we will get a solid foundation that is flexible enough to suite almost any website project.

Comments

Re: Multimedia Support in Drupal 7 with the Media Module

What about permissions?

Will it be able to handle different sets of media which different groups of users should be allowed to access and stuff like that?

How will it integrate with the Group module?

Re: Multimedia Support in Drupal 7 with the Media Module

One major change in Drupal 7 is that you can have both public and private files. In Drupal 6 you could only chose one of them and all files would be either public or private. The project page lists "Fine grained access control for viewing / editing media" as a planned feature.

Since it is using stream wrappers it will be possible write a plugin to use a CDN (Content Delivery Network) to for example manage access to media files.

As far as I know, the media module itself will not include any special integration features for groups. The goal with the core module is to create a foundation to uniform media management in Drupal 7 as well as API's that can be used by other modules to add features to it.

I am sure that as soon as the media module is available we will see a lot of modules starting to use it, adding new features to it and so on. As you mention groups, someone can write a module that adds features to how media files are managed in a website using the groups module or managing how different users on a website can use media files uploaded by other users.

Personally I wouldn't like to have groups integration directly in the media module itself. That kind of features belongs in separate modules that can be installed on sites that actually use the groups module.

/thomas

Re: Multimedia Support in Drupal 7 with the Media Module

Ok, thanks for the explanation!