Closed (fixed)
Project:
Insert
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Feb 2012 at 12:39 UTC
Updated:
11 Oct 2018 at 19:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hefox commentedThis 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.
Comment #2
hefox commentedHere'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.
Comment #3
quicksketchHm 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>.Comment #4
quicksketchFor example, it looks like Firefox (still) doesn't support MP3 audio tags: http://stackoverflow.com/questions/4923136/why-doesnt-firefox-support-mp...
Comment #5
hefox commentedPerhaps 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.
Comment #6
arrubiu commentedIt could be useful also a simple "insert" button that adds a link to the file
Comment #7
quicksketchInsert module already provides an option to insert as a link to the file.
Comment #8
arrubiu commentedYes, but, as I remember, it doesn't work if I have a file with "Media selector" widget.
Comment #9
drupa11y commentedA 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".
Comment #10
grahlI 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.
Comment #11
mcruzvcn commentedBoth 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.
Comment #12
hacioglu commentedHi,
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?
Comment #13
snater commentedI am browsing through old issues while working on the module's D8 version. There is also an issue regarding the D8 version: #2987311: Allow embedding audio/video
Audio and video tag seem to be pretty common by now. Yet, arguments that I mentioned in the D8 ticket, apply here as well.
Apart from that, It does not seem to be hard to implement and I attached a change set that should support embedding audio and video on generic file fields. This functionality could also be implemented in separate/custom module instead of directly in Insert by using hooks.
I will leave the change set here for a while and then decide on it. Please feel free to test and comment.
Comment #14
drupalgideonI had a cursory glance and noticed you're using short array syntax in this patch #13, which sadly shouldn't be used on D7.
https://www.drupal.org/docs/develop/standards/coding-standards#array
Comment #15
snater commentedI guess I have been in D8 mode. ;) I will touch the code again before merging anyway, because it's probably not a good idea to figure out auto-detection by the mime type, as not all images and videos are rendered by all browsers. Maybe this should be a config option, as it would be a solution to #2918451: Add Support for inserting SVGs as images. as well.
Comment #16
snater commentedThe updated change adds a global configuration page to configure audio and video file type detection.
Comment #18
snater commentedApart from some slight improvements, the committed change does not set default file extensions that should be detected as audio/video files, as the change in behaviour of the "Automatic" Insert style would require tagging a new major version of the module.