Drupal 8’s Media module to easily work with media
One of the sure ways of engaging your visitors is using various multimedia on your website. In Drupal 8, great attention has been paid to creating a perfect media management system. Congrats! A novelty of 2017-2018, the brilliant Media module in Drupal core is now one of Drupal 8’s greatest benefits. Let’s do a little overview of what the Media module gives you, how it works, and which Drupal 8 minor versions already have it available.
The Media module in Drupal 8
It is a whole framework for uploading and managing various media (audio, videos, and images), as well as files. This applies both to locally stored media and those from third-party sources (various social media, services, and so on).
The Media module is extensible with add-on contributed modules. They provide additional integration and other features related to Audio, Remote video, Slideshow, Twitter, Facebook, Instagram, Flickr, Spotify, Pinterest, Slideshare, DropzoneJS, GoogleDocs, and many more.
Together with them, the Media module lets your create any desired media handling scenarios.
This includes displaying media in your content exactly the way you want (as plain text, as thumbnail, with image, with author, and so on), uploading media with a drag-and-drop feature, integrating slideshows, cropping images, and much more.
The Media module: media types, fields, and sources
All the above mentioned things are possible thanks to important Drupal 8’s media handling concepts, one of which is media types. Like Drupal content types, media types are part of the site’s structure. Media types are represented by individual media entities (for example, a particular tweet).
It is possible to add fields to media types and manage their display. There is a special Media field available to add to content types so that media can be attached to content.
Field mapping is a truly remarkable feature of the new media system. It lets you pull various types of data from the third-party media and store them as “classic” Drupal fields. For example, you can choose to show the tweet’s author in your content, date of publication, and so on.
When enabled, the Media module immediately offers four built-in media types:
Content editors and site administrators are also free to create their own media types. Each custom media type will be based on a particular “media source” that should be selected once and for all.
The media source adds some special logic to your media type. They include field mapping opportunities, using the provider’s API, generating thumbnails, and many more, according to the media source.
Media sources include the built-in audio, file, image, and video, and there are many others provided by the relevant contributed modules.
The fast-changing Media and Drupal 8 versions
In addition to being an important security practice, regular website updates let you enjoy new features. This has never been as true as when it comes to the Media module in Drupal 8.
The Media is so hot on the Drupal community agenda that its capabilities change incredibly fast. To catch up with them, you need to regularly update your Drupal 8 website to the latest minor version.
The Media module “jumped” into the Drupal 8 core in Drupal 8.4.x. So, Drupal 8.4.x became the first version where the Media module could be seen. Well, not literally — the module itself was hidden from the dashboard. In the meantime, the Media API was ready for developers so they could polish their related contributed modules.
In Drupal 8.4.x, one of the of the ways to “call” the Media module into action was to enable some contributed module responsible for specific areas of media handling (Twitter, Facebook, Instagram etc.). Drupal then asked you to enable the Media module as a dependency.
Despite these difficulties, the functionality was already quite usable and similar in many ways to that in Drupal 8.5.x.
Drupal 8.5.x, the newest stable version of Drupal 8, gave the official start to the Media module as part of the core.
Polished and improved, available on the “Extend” dashboard, the Media module was finally ready to impress content editors and inspire website owners to update to Drupal 8.5.
More great news: the oEmbed feature
There is one more feature actively discussed and expected with impatience. Enthusiastic drupalers have finally added the oEmbed support to the Media module.
OEmbed is an open format that allows you to display content from a third-party provider, when a user inserts an URL. The oEmbed format is supported by Facebook, YouTube, Vimeo, and most other famous providers.
Drupal 8’s got an API for working with oEmbed services. It also now has plugin to support YouTube and Vimeo out-of-box.
The oEmbed feature will be officially available with the release of Drupal 8.6.x. Right now, Drupal 8.6.x is being tested and improved, and is expected to come out in early September.
That’s a just a very brief overview of the Media miracle of Drupal 8 core — the Media module. In connection with this, we have some more great news:
- Our Drupal team is always ready to assist you in creating media entities and fine-tuning the media management processes.
- Of course, regularly updating your site to every new minor Drupal 8 version (Drupal 8.5, Drupal 8.6) is a breeze for us.
- Finally, if you are not yet using Drupal 8, a smooth upgrade is one of our areas of expertise.
If you have any questions, you are welcome to apply. Let your Drupal website be incredibly engaging thanks to the perfect use of multimedia!