I love this mod and would find it useful if it could work with other formats as well as image for the file field. Would it be possible to make video & audio files work also?

I think users would find this very useful

Thanks for all your hardwork :)

Members fund testing for the Drupal project. Drupal Association Learn more


hefox’s picture

This is actually rather simple patch, as far as I can tell, if one is assuming what someone wants to embed is an HTML 5 tag (else theirs some sort of outside depedency on x y z video player). e.g. for audio files, it could insert an audio tag, and video files could do video.

I believe there's some js scripts out there to change video tags to hosted video player in older browsers, may be the same for audio.

hefox’s picture

Status: Active » Needs review
3.41 KB

Here's a patch that adds the audio tag

Note that filtered HTML doesn't allow audio tag by default :/

Note: it's missing other file formats, need to look up which ones are (commonly?) supported by audio tag.

quicksketch’s picture

Hm interesting. This seems like a good start, but I'm not sure if <audio> is widely supported enough yet to make it the only approach for an inline insertion. Same problem with <video>.

quicksketch’s picture

For example, it looks like Firefox (still) doesn't support MP3 audio tags: http://stackoverflow.com/questions/4923136/why-doesnt-firefox-support-mp...

hefox’s picture

Perhaps auto should have settings on what tags it applies per field? That way those that want it to automatically do audio for audio can, but others don't.

arrubiu’s picture

It could be useful also a simple "insert" button that adds a link to the file

quicksketch’s picture

Title: Working with other media formats » Working with other media formats (insert <video> and <audio> tags)
Status: Needs review » Needs work

It could be useful also a simple "insert" button that adds a link to the file

Insert module already provides an option to insert as a link to the file.

arrubiu’s picture

Yes, but, as I remember, it doesn't work if I have a file with "Media selector" widget.

mori’s picture

A solution for this is this module which also supports images: https://drupal.org/project/insert_video
The disadvantage is that it is a little buggy (insert button appears after saving node or pressing "add another item") and that the insert-presets are based on "view-modes".

grahl’s picture

Issue summary: View changes
4.43 KB

I needed video support for this and adapted hefox's solution to do so. It only supports mp4 and no configuration, though that could of course be added.

mcruzvcn’s picture

6.44 KB

Both patches are wrong implemented.
I have tried to apply them and they failed.

I removed both files and build a new patch using your code.

hacioglu’s picture


I applied the patch in 11, but can still not upload files beside png, gif, jpg and jpeg. In the field settings I added mp4, but it didn't work.

What am I missing?