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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | oembed-text-mimetype.patch | 487 bytes | dixon_ |
| #5 | Audio link field.png | 31.25 KB | mefisto75 |
| #5 | Audio link field view mode.png | 34.96 KB | mefisto75 |
| #4 | image 1.png | 18.04 KB | mefisto75 |
| #4 | image 2.png | 15.98 KB | mefisto75 |
Comments
Comment #1
mefisto75 commentedWhen testing oembed module it works, please see attached image.
Comment #2
dave reidSo 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.
Comment #3
dave reidMoving to the oEmbed issue queue. Not sure what else we can do better in Media but I figured we could discuss.
Comment #4
mefisto75 commentedI 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.
Comment #5
mefisto75 commentedUpdate.
If add a Link field and set display to Oembed it works. Screenshots attached.
Comment #6
dave reidThis 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.
Comment #7
Anonymous (not verified) commentedAs 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.
Comment #8
mefisto75 commented@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.
Comment #9
mefisto75 commentedComment #10
dixon_As @bangpound mentions there's no way, with the oEmbed protocol, to determine if an embedded text represents 'audio'.
oEmbed has a
typeproperty and sets that tovideoandphotofor video and photo embeds. But others embed will have the type property set torich.So, currently we map videos to the
video/oembedMIME-type and photos to theimage/oembedMIME-type. Using Media 2.x and File Entity, those maps nicely to thevideoandimagefile 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/oembedor eventext/htmlfor other "rich" embeds. This is closer to any form of standard (text/html,text/javascript,text/cssetc...).This will also make rich oEmbed fall under the
textfile entity bundle, and not get mixed with the default or "Other" wierd file entities.Attached a patch that fixes this.
Comment #11
dixon_Actually, it might be closer to the truth to actually set the MIME-type to
text/htmlsince that's what it really contains... The patch above maps it totext/oembed...Comment #12
dave reidYeah 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.
Comment #13
dave reidComment #14
arthurf commentedConfirmed that this fixes issues with oembed
Comment #15
dave reidCommitted #10 to Git. http://drupalcode.org/project/oembed.git/commit/243cb32