This patch creates the required mime types. (It also moves 1 function up, almost all media provider modules have a similar order, minor detail, but nice enough.)

I have it working on the current media 7.x-2.x git version.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

leelooch’s picture

Thanks for the patch !
It worked well for me on media 7.x-2.0-unstable7 though I think it could be difficult for newbies to guess they have to check Dailymotion Stream in admin/structure/file-types/manage/video/edit page.

oystercrackher’s picture

Patch worked great, but I still had to add video/dailymotion mimetype and select Dailymotion stream in admin/structure/file-types/manage/video/edit page. Also had to clear the caches.

Thanks
Melissa

leelooch’s picture

here's a copy of the code added in to the media_youtube.install file, maybe it could be useful to add this to :

/**
* Update media youtube files to the new video file_entity type.
*/
function media_dailymotion_update_N() {
  $video_type = file_type_load('video');
  $video_type->mimetypes[] = 'video/dailymotion';
  // maybe also add stream if is not there already?
  file_type_save($video_type);
 
  // Update existing files
  db_query("UPDATE {file_managed} SET type = 'video' WHERE type = 'undefined' AND filemime = 'video/dailymotion'");
}
Dave Reid’s picture

bacarndiaye’s picture

Thank very mutch, it's helpfull

bacarndiaye’s picture

Status: Needs review » Closed (fixed)
garphy’s picture

Status: Closed (fixed) » Needs review

I'm reopening this as it hasn't got any status/feedback from a maintainer.

garphy’s picture

@Rob_C, your patch doesn't only change function location (hook_media_internet_providers) but also alter what's this hook returns.
I don't think this alterations are mandatory for this particular issue so I would suggest you open another issue for this one.

I rerolled the patch to include only the addition of the required hooks, making it more suitable for inclusion/commit.

(Side Note: why do you removed the 'image' key in hook_media_internet_providers implementation ?)

marvil07’s picture

Status: Needs review » Fixed

@Rob_C, @garphy, thanks for the patches.

@David Reid, thanks for the hint!

I have just followed David suggestion and removed the hook_file_default_types_alter() from the last patch and added to 7.x-1.x.

Status: Fixed » Closed (fixed)

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