I've defined custom file types aside from Video, Audio, Document, Image and I wasn't able to display the rendered youtube video when I assigned the video/youtube mimetype to the other file types. In media_youtube.formatters.inc the file type is explicitly stated as video. I patched it to look through the defined file types for the video/youtube mimetype and assign those to $formatters['media_youtube_video']['file types'].

I've had to do this with other media embed modules (soundcloud and vimeo), so I'm not sure if there's somewhere upstream to these that can fix this more globally, but I'm submitting this for now if it has any value to others looking for this same functionality.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

raytiley’s picture

I just ran into this same issue tonight and worked around it by altering the formatters_info(). I looked through your patch and the one thing I might add is support for the video/* mime type just in case the filetype doesn't have video/youtube specifically called out.

I'll try testing this patch tomorrow.

Thanks for submitting it :)

Devin Carlson’s picture

Dave Reid’s picture

Status: Active » Closed (duplicate)

Why don't we use 'mime types' => array('video/youtube') instead of the file type restriction?

Dave Reid’s picture

@Devin: You marked this issue as a duplicate of itself?

Dave Reid’s picture

Devin Carlson’s picture

Title: Support for custom file types » YouTube formatters should declare supported MIME types
Category: feature » task
Status: Closed (duplicate) » Needs review
FileSize
863 bytes

After talking to Dave, Media: YouTube should declare an array of MIME types that its formatter's support.

Devin Carlson’s picture

Status: Needs review » Fixed

With #2098921: Decide if formatters restricted to specific file types should be available to custom file types fixed I'm seeing the expected results when testing #6.

Committed to Media: YouTube 7.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.