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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BenK’s picture

I 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

Rob_Feature’s picture

Status: Active » Needs review
FileSize
700 bytes

Here'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

Rob_Feature’s picture

oops, removing youtube from the comment....

RobW’s picture

Status: Needs review » Needs work

Committed (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.

Rob_Feature’s picture

Status: Needs work » Closed (fixed)
Rob_Feature’s picture

Status: Closed (fixed) » Fixed
RobW’s picture

Status: Fixed » Needs work

This 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.

jacobpov’s picture

Ok works just needed to resubmit all my nodes

mrfelton’s picture

Status: Needs work » Needs review
FileSize
810 bytes

Here 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.

populist’s picture

FileSize
812 bytes

Here 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.

ParisLiakos’s picture

sondes’s picture

Are 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

RobW’s picture

Wording is a little confusing, but this is the open thread. #11 is letting this thread know that they closed {thread X} as a duplicate.

nodecode’s picture

I 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.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

lets get this in

RobW’s picture

Committed: 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.

RobW’s picture

Status: Reviewed & tested by the community » Fixed
oystercrackher’s picture

Using 7.x-2.x-dev, I still had to add video/vimeo as mimetype and had to clear caches.

Thanks

RobW’s picture

Did you run update.php?

Status: Fixed » Closed (fixed)

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