New Commons Media Integration
by Ezra Barnett Gildesgame
Drupal is known for providing a broad range of functionality with its extensible core and the tens of thousands of free contributed modules which add or extend functionality. One challenge for people who are building applications on top of Drupal is taking advantage of this flexibility and broad range of available functionality without compromising the usability of their applications for end users, and even for themselves as site maintainers.
This pattern holds true around media integration for Drupal. Drupal’s Media module powers over 150,000 instances of Drupal and abstracts away commonly needed media-management tasks, such as stream wrappers for working with image and video files. As you can imagine, there are a range of different end user experiences with those 150,000 websites, and in order to support them, the Media module is mostly abstracted. But what if you just want to embed photos or videos in a post?
Drupal Commons 3 now includes enhanced media integration out of the box, making it easy for contributors to your Commons community to embed images and video in their posts, either from uploaded image files or by referencing images and videos across the web from a variety of providers such as YouTube and Vimeo.
It’s easy to add media from the Commons “short form” as well as the full post creation form, even from a touch devices such as a phone or tablet. Images and video are optimized for display based on device screen size through the use of media queries to avoid wasting bandwidth. Site administrators users permission to re-use previously uploaded media assets through the media browser. We’ve tested this integration internally within Acquia and via the Applause service (formerly UTest) and we look forward to receiving your feedback through the Commons issue queue on Drupal.org.
Commons "short form" with the option to attach media.
The Commons "full form" with media embedding integrated into the WYSIWYG editor.
The post and video thumbnail are transmitted and displayed at a device-appropriate size.
Making these enhancements to Drupal Commons afforded us the opportunity to make significant improvements to Drupal’s Media module, Drupal Core and several other key Drupal modules, benefiting hundreds of thousands to millions of individual sites, whether or not those sites are running Drupal Commons.