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.
Comment | File | Size | Author |
---|---|---|---|
#6 | declare-supported-mime-types-2087067-6.patch | 863 bytes | Devin Carlson |
media_youtube-fix-for-custom-file-types.patch | 1.47 KB | hart0554 | |
Comments
Comment #1
raytiley CreditAttribution: raytiley commentedI 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 :)
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commentedThis is a duplicate of #2098921: Decide if formatters restricted to specific file types should be available to custom file types.
Comment #3
Dave ReidWhy don't we use 'mime types' => array('video/youtube') instead of the file type restriction?
Comment #4
Dave Reid@Devin: You marked this issue as a duplicate of itself?
Comment #5
Dave ReidFor reference, this feature was added in #2067939: Restrict certain file formatters (audio and video) to only file types that have mime types that match wildcards
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedAfter talking to Dave, Media: YouTube should declare an array of MIME types that its formatter's support.
Comment #7
Devin Carlson CreditAttribution: Devin Carlson commentedWith #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.