I am having an issue uploading audio files. Well, I can't upload them.
It always gives error - Only the following types of files are allowed to be uploaded: audio.
No matter what provider i choose.
Works fine with video.
Using drupal.org/project/oembed and media browser plus.
Sample embeded link: http://soundcloud.com/tmilliron/gods-gonna-cut-you-down
I am not using media_soundcloud thinking that oembed should suffice.
Field configuration attached.

Comments

mefisto75’s picture

StatusFileSize
new36.97 KB

When testing oembed module it works, please see attached image.

dave reid’s picture

So the problem here is that the oEmbed module is returning a file mime type of 'html/eombed' for http://soundcloud.com/tmilliron/gods-gonna-cut-you-down, which does not match the accepted mime type of 'audio/*'.

Short term solution: Enable the 'Other' type in the 'Allowed remote file types' checkboxes in the field configuration.

Long term solution: Transfer issue to oEmbed to return a more specific or valid mime type for soundcloud.

dave reid’s picture

Project: D7 Media » oEmbed
Version: 7.x-2.0-unstable2 » 7.x-0.x-dev
Component: Media field » Code

Moving to the oEmbed issue queue. Not sure what else we can do better in Media but I figured we could discuss.

mefisto75’s picture

StatusFileSize
new15.98 KB
new18.04 KB

I tried adding 'Other' type.
initially it doesn't show errors, shows nothing. Attached image 1.
But when I hit save - 'media_fid_illegal_value' and doesn't save. Attached image 2.
Thank you for the support.

mefisto75’s picture

StatusFileSize
new34.96 KB
new31.25 KB

Update.
If add a Link field and set display to Oembed it works. Screenshots attached.

dave reid’s picture

This is also likely a root problem from oEmbed as it doesn't provide support for an 'audio' type: http://groups.google.com/group/oembed/browse_thread/thread/e0fdc1bc9470b1df. That's extremely sad that it would support photo and video, but not audio.

Anonymous’s picture

Status: Active » Closed (works as designed)

As oEmbed audio providers like Soundcloud send a HTML blob with the audio player itself, there's no way to distinguish based on the oEmbed response whether something is audio or something else.

For the oEmbed response to be "audio" the response would have to include URLs for audio files. Embed.ly may "overload" the response with this information, but I don't know.

The oEmbed standard is pre-HTML5, and it's in desperate need of updates. Definitely get involved in the oEmbed google group if you're interested in that.

If we want to trick Drupal into believing that an oembed response with a HTML blob is in fact an audio file, we need to rewrite the response. Please open a feature request on oEmbed if this is important to you.

mefisto75’s picture

@bangpound Can I use oembed with media module to upload and present 3rd party audio tracks? I have no problems having default audio players of soundcloud, as example.

mefisto75’s picture

Status: Closed (works as designed) » Active
dixon_’s picture

Title: Uploading audio » Map the 'rich' oEmbed type to 'text' file entities
Category: support » feature
Status: Active » Needs review
StatusFileSize
new487 bytes

As @bangpound mentions there's no way, with the oEmbed protocol, to determine if an embedded text represents 'audio'.

oEmbed has a type property and sets that to video and photo for video and photo embeds. But others embed will have the type property set to rich.

So, currently we map videos to the video/oembed MIME-type and photos to the image/oembed MIME-type. Using Media 2.x and File Entity, those maps nicely to the video and image file entity bundles, since File Entity module determines the file type on the first part of the MIME-type.

But for other oEmbed types we set the MIME-type to html/oembed. And since there's no "html" file entity bundle, those are mapped to the "default" (or "Other") bundle type.

Personally I think we should use the a MIME-type like text/oembed or even text/html for other "rich" embeds. This is closer to any form of standard (text/html, text/javascript, text/css etc...).
This will also make rich oEmbed fall under the text file entity bundle, and not get mixed with the default or "Other" wierd file entities.

Attached a patch that fixes this.

dixon_’s picture

Actually, it might be closer to the truth to actually set the MIME-type to text/html since that's what it really contains... The patch above maps it to text/oembed...

dave reid’s picture

Yeah it would be an improvement to change this to text/oembed for now so that we're not using a type that doesn't match up with the standard IANA media types.

dave reid’s picture

Status: Needs review » Reviewed & tested by the community
arthurf’s picture

Confirmed that this fixes issues with oembed

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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