Through a little trial and error I recently discovered how to add a YouTube video to a Drupal 7 site using a combination of the Media and Media: YouTube modules. I could not find any documentation or posts that documented the configuration and steps necessary to get these two modules to work together, so I've created this post in hopes of saving others a little time.

After you've installed both modules:

  1. Go to configuration > media > files types > manage file displays and select YouTube Video and YouTube Preview Image.
  2. Click Save configuration.
  3. Add the Multimedia Asset field to a content type (make sure you select Video and youtube:// YouTube videos).
  4. Ensure the format is set to Media under Manage Display.
  5. Create a node.
  6. Click Select media and make sure you select the Web tab.
  7. Paste in your YouTube URL.
  8. Save the node and enjoy.

Comments

halmsx’s picture

thanks for this! really need it.

shannoninman’s picture

I'm working on this tonight. Thank you for taking the time, I'll let you know how mine turns out.

esod’s picture

Thanks for posting these directions. Saved me a lot of time.

Fanaile’s picture

Excellent.

Travist also gave a presentation in Dallas last Fall about how to manage and present media (including YouTube videos) on a Drupal 7 site. I know it's posted at a couple of different places, but this one is a little more detailed :)

hedley’s picture

I recently found I had to enable the 'Full Content' view mode as well, otherwise the field was not rendered.

drupalsammy’s picture

Hello hedley,

I was able to have the video show up in fields instead of 'full content' mode.

n8j1s’s picture

Does anyone have any suggestions on the best way to do this since the Multimedia Asset field is being deprecated in Media 2.x? http://drupal.org/node/1436292#mediafieldOrFilefield

Steven Brown’s picture

Subscribe

mikeprinsloo’s picture

also subscribing

scotwith1t’s picture

sub - never realized there was no way to "follow" a post that's not in the issue queue! wonder why that is?

scotwith1t’s picture

Success. After some more digging in the Media issue queue, found this post, #25 was particularly helpful, but many links to videos here too.

druvision’s picture

@n8j1s, the reason it's deprected is because you either use MediaFront which allows for a video embed field, or use the filefield directly if it's a video stored on the site. That's what I think from my research up to now.

jamieshek’s picture

Does anyone have a solution that will pass the w3c validation test. None of the methods I've come across will validate with a youtube iFrame.

Any help would be great.

hockey2112’s picture

This is an excellent guide!

I was curious... has anyone successfully used the Media module(s) to post a gallery of youtube and image thumbnails, all mixed up amongst each other, on a content item's page? Ideally, images or youtube videos would both open up in lightbox when the thumbnail is clicked.

Is that possible with the Media modules?

Bertjuh’s picture

Thanks for posting this! This really saved me a couple of hours :)