Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
See the related youtube version of this issue at: #1812976: Register video/youtube mimetype and provide an upgrade path
Basically Vimeo videos use a mimetype of video/vimeo and that isn't registered by the file entity module. We need an mapping for that with something like:
/**
* Implements hook_file_mimetype_mapping_alter().
*/
function media_vimeo_file_mimetype_mapping_alter(&$mapping) {
$mapping['mimetypes'][] = 'video/vimeo';
}
however this currently means the user has to manually enter this mapping into the allowed filtypes. It should automaticlaly be accepted if Vimeo is chosen as a stream type when configuring the Video file type.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1823078-1x-fix.patch | 812 bytes | populist |
#9 | 1823078.9-media_vimeo-filetype-update-hook.patch | 810 bytes | mrfelton |
#3 | media_vimeo-define_mimetypes-1823078-3.patch | 698 bytes | Rob_Feature |
#2 | media_vimeo-define_mimetypes-1823078-2.patch | 700 bytes | Rob_Feature |
Comments
Comment #1
BenK CreditAttribution: BenK commentedI can confirm that the solution proposed by Rob_Feature works great. I just added the code to the .module file and then manually added video/vimeo to the allowed file types for video.
Rob_Feature, can you roll this as patch so that we can get this committed ASAP? (Otherwise, the module isn't usable.) And maybe the others have a suggestion to make this process a little more automated....
Thanks,
Ben
Comment #2
Rob_Feature CreditAttribution: Rob_Feature commentedHere's a patch. It defines the mimetype video/vimeo and sets it as a default video type. I basically just pulled this from: #1812976: Register video/youtube mimetype and provide an upgrade path
Comment #3
Rob_Feature CreditAttribution: Rob_Feature commentedoops, removing youtube from the comment....
Comment #4
RobW CreditAttribution: RobW commentedCommitted (http://drupalcode.org/project/media_vimeo.git/commit/980464a), but be aware that if a user or module has updated the allowed mimetypes this code won't insert video/vimeo -- you'll have to do it manually. At least that's what I've found while testing Media: YouTube. There's more info and discussion in #1812976: Register video/youtube mimetype and provide an upgrade path.
Comment #5
Rob_Feature CreditAttribution: Rob_Feature commentedComment #6
Rob_Feature CreditAttribution: Rob_Feature commentedComment #7
RobW CreditAttribution: RobW commentedThis is still needs work because we need an update hook to add the mimetype if the allowed mimetypes have been altered from default (in which case the hook default file types alter won't work), and some more testing. The current commit should help most people, but we've seen in the YouTube thread that there are still some bumps that need to be smoothed over.
Comment #8
jacobpov CreditAttribution: jacobpov commentedOk works just needed to resubmit all my nodes
Comment #9
mrfelton CreditAttribution: mrfelton commentedHere is the needed update hook, based on the one from #1812976: Register video/youtube mimetype and provide an upgrade path. This got my Vimeo videos working again following Media module upgrade.
Comment #10
populist CreditAttribution: populist commentedHere is a version of the same patch to the update hook for the 1.x branch. Similar to #36 in #1812976: Register video/youtube mimetype and provide an upgrade path.
Comment #11
ParisLiakos CreditAttribution: ParisLiakos commentedclosed as duplicate #1848022: Cannot insert video from Vimeo URL after upgrade
Comment #12
sondes CreditAttribution: sondes commentedAre both of these threads meant to be closed as duplicates of each other?
https://drupal.org/node/1823078#comment-6820276
and
https://drupal.org/node/1848022#comment-6820272
Comment #13
RobW CreditAttribution: RobW commentedWording is a little confusing, but this is the open thread. #11 is letting this thread know that they closed {thread X} as a duplicate.
Comment #14
nodecode CreditAttribution: nodecode commentedI applied the patch manually and it worked. Video thumbnails now display properly and everything works as expected once again.
Since I had never looked at the file type editor before, I also visited admin/structure/file-types/manage/video/edit and confirmed that "video/vimeo" had indeed been added to the list of Mimetypes.
It all looks good to me.
Comment #15
ParisLiakos CreditAttribution: ParisLiakos commentedlets get this in
Comment #16
RobW CreditAttribution: RobW commentedCommitted: http://drupalcode.org/project/media_vimeo.git/commit/204cc5f. Thanks for the code and review, all.
[edit] Sorry mrfelton, missed you in the commit message. If I see you at any Drupal events, I owe you a beer.
Comment #17
RobW CreditAttribution: RobW commentedComment #18
oystercrackher CreditAttribution: oystercrackher commentedUsing 7.x-2.x-dev, I still had to add video/vimeo as mimetype and had to clear caches.
Thanks
Comment #19
RobW CreditAttribution: RobW commentedDid you run update.php?