Drupal has got new media management functionality in 8.6. In the above video, I’ll demonstrate what new media functionality we have in Drupal 8.6.
Thanks to the Media in Drupal 8 Initiative, media handling in Drupal has improved with every new release. In 8.4 we got the experimental core Media module. Then in 8.5, the module moved from experimental to stable and now it’s the recommended way for storing media assets. Now in Drupal 8.6 we get a few extra goodies such as oEmbed support, a Remote video media type and a media library.
Grab our FREE course on using core Media in Drupal 8.
(While you’re at it check out our list of free courses)
New Remote Video Media Type
When you install the Media module you get four media types by default: Audio, File, Image and Video. Now you get Remote video which can be used to embed YouTube and Vimeo videos.
Currently only YouTube and Vimeo are supported. If you need to support other video platforms look at using Video Embed Field.
Learn how to configure Video Embed Field with core Media module.
oEmbed Support
To handle the new Remote video media type, Drupal 8.6 also got oEmbed support (Drupal change record).
Media Library
The new Media library module is by far the most exciting new functionality. You’ll need to install the experimental module called Media library. Don’t forget this is experimental for now; use at your own risk.
The first change you’ll notice is that the Media page looks different. You get to switch between a Grid and Table view.
The module also comes with a new widget for the Media field called “Media library”. This will allow you to browse media assets from the edit screen.
To use this widget make sure “Media library” is selected as the widget on the “Manage form display” page.
Here it is in action and watch how you can bulk upload images.
Can this module replace Entity browser? At this point I’d say no. Entity browser gives you more flexibility in how you build these types of browse pages. But I hope in the future Media library will be the standard way of creating these browse pages.
Want to learn how to use Entity browser? Check out “How to Browse Media Assets using Entity Browser“.
Summary
Slowly and steadily media handling in Drupal core is improving and becoming more powerful. It’s good to see this continued momentum. But if you need to create bespoke media functionality I still think the combination of Entity embed/Entity browser is the winner for now.
Check out our epic “Managing Media Assets using Core Media in Drupal 8” tutorial where you’ll learn how to use Entity embed, Entity browser, DropzoneJS and more.
It would be great to be able to add remote videos in the same way you can add images straight from the node create page. Is there an issue for this?
I don’t know if there’s an issue for that.
That type of functionality can be done by using Entity Browser and Inline Entity Form.
Thank for this tutorial
I have enbaled the Core Media Module on a Drupal 8.6.1 site, but when I go to /admin/structure/media no Media types are available. The four media types (Audio, File, Image and Video) you mentioned are missing.
Any ideas why?
Hi Stéhane,
Not sure what the problem could be. I tested 8.6.1 on https://simplytest.me and the 5 media types (audio, file, image, video and remote video) appear.
– Try clearing the site cache
– Make sure you have admin access to the site
Cheers,
Ivan
Hi Ivan,
thanks you for the prompt feedback. It seems to be related to installation profile I’m using (Open Social 3.1).
Thanks,
Stéphane
Hi!
How to include media field to custom form?
Hi,
Fields can only be attached to fieldable entities, not forms.
I don’t know of a way to attach them to basic forms.
Cheers,
Ivan
Hi,
I add to Node content some media items from one media type. when someone clicks the link media item appears one media item full. Αnd I would like to show below one media item the other media items to that node content I have added. is that possible?
Thank you a lot!
Hi Serkan,
Is this functionality offered out-of-the-box, probably not.
But it’ll be possible with custom code.
This type of comment is hard to answer because you need custom functionality. But with custom code anything is possible. 🙂
Cheers,
Ivan
Hi Ivan,
I understand, but I dont know to make a custom code. I dont have the knowledge for code 🙁