i'd like to add an input filter that takes tags like [audio:123] to link to a node or [audio:http://example.com/foo.mp3] to link to a remote file and creates a flash player link.
i've run into a couple of problems:
- linking to audio nodes requires the audio module. not really a big deal but the remote stuff might be better if it didn't require the audio module.
- we know nothing about the remote files, they might not be compatible formats or bit rates.
- the flash players require that the files exist and be configured to point to a url. this sort of duplicates some of the audio module's functionality.
i'm kind of thinking the filter should be part of an audio_player module... the player module could allow the user to select the flash player... thoughts?
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | audio_filter.zip | 1.8 KB | zengenuity |
| #16 | audio_filter.zip | 2.46 KB | joachim |
| audio_filter.module | 1.31 KB | drewish |
Comments
Comment #1
zirafa commented"- linking to audio nodes requires the audio module. not really a big deal but the remote stuff might be better if it didn't require the audio module. "
The filter could just output nothing if the audio module is not installed and the user types in something like [audio:123].
"- we know nothing about the remote files, they might not be compatible formats or bit rates."
Check the extension to see if it's compatible with the flash player. If it's not compatible, just provide a link with a little download link music icon. If it is compatible, embed the flash player next to the icon. If the user realizes the flash player doesn't work with the file, provide an option to suppress the flash player: [audio:no-player:http://file.mp3] or something like that. Or vice versa, have an option to show the player but don't show it by default. Just have the music icon download link always though since that won't fail.
"- the flash players require that the files exist and be configured to point to a url. this sort of duplicates some of the audio module's functionality."
Not sure I understand this.
"i'm kind of thinking the filter should be part of an audio_player module... the player module could allow the user to select the flash player... thoughts?"
Maybe audio_inline.module would make more sense for a name? What do you envision the audio_player module doing by itself without a flash player? Maybe I don't fully understand the vision for this filter.
Comment #2
sunIMHO, this should be handled by inline module. Inline already provides file mime type icons (with a patch). There are already thoughts to let inline.module work with other nodes by creating a inline API.
Comment #3
drewish commentedinline would be a good place to do it. i'd like to see that plugin api/hook to do so.
Comment #4
solipsist commented+1 to this idea!
Has any work been done? I have a client who needs this feature. I am prepared to develop it and contribute it back unless someone is already working on it.
Comment #5
drewish commentedsolipsist, i haven't done anything other than what's attached. feel free to update it. if it looks useful we can add it to contrib.
Comment #6
solipsist commentedThanks for sharing! I'm gonna look at it!
Comment #7
drewish commentedmarked http://drupal.org/node/120182 as a duplicate of this.
Comment #8
yngens commentedHi All,
I achieve this task by putting a code of a player, but this way you can only play local audio files, not remote ones. Anyway, let me repeat my question in http://drupal.org/node/120182:
Users of my website sometimes devote songs from audio archive of the website to each other, for instance when congratulating each other with birthdays. To do that they have to copy the following code by changing nid with id of the audio-file node.
But it is not very convenient since only users with html access can do that. Is it possible to somehow put this code into some kind of filter and enable users to include in their posts any song from archive? For example, users could post something like [audio:nid] and filter automatically would put the code for the player? Or maybe there is other and easier way of including audio files to user postings?
Comment #9
yngens commentedi have audio module installed and when trying suggested audio_filter.module it gives the following error when linking to audio node:
Fatal error: Call to undefined function: audio_get_player() in /home/site/public_html/sites/all/modules/audio/contrib/filter/audio_filter.module on line 48
Comment #10
drewish commentedyeah that's some hella old code. i'm curious how sun's inline api has progressed. it might be a better framework to use for this now. i know he's a maintainer of the module now... maybe he'll chime in?
Comment #11
trond7 commentedWhat is the status of making this as a working patch working for the Audio mudule?
Or, do anyone have another way of embedding audio from an audio node into another node?
(My context is making multimedia learning content. e.g. a student reading a text instructed assignment while listening to a audio file. )
It is possible to copy and passed the HTML from an audio node into another node (e.g. a book node), but the problem then is that does not support the feature of changing the media player on existing content due to that the URL to the player is hard coded.
Comment #12
joachim commentedIn reply to #9: replace the call to the bad function with audio_get_node_player instead -- just change the function name, same parameters.
Also -- any news on inline.module working with audio module?
Comment #13
sunRegarding Inline: The API is evolving and still in development, but there is still much to do. Image Assist will probably be the first module that will depend on it, beginning with 3.x series (hint: to get an idea about the envisioned timeframe: 2.x will be released soon).
Comment #14
joachim commentedIn other words, it would be good for users if we included this handy little module in a new release of audio module so they've got this functionality right now :)
I've tested it with the change detailed in comment #12 and it works fine.
Comment #15
kade. commentedGreetings,
in which section we will upload this code that has been prepared? and what should we do to make this code work?
Comment #16
joachim commentedHere's a zipfile of the complete module, with the change described in comment #12.
Tested and ready to go :)
Comment #17
drewish commentedthis needs to be updated to 6.x first, i'm not going to commit any 5.x only features.
Comment #18
drewish commentedComment #19
sagannotcarl commentedI'm a little confused about the code in #16. What exactly is var_dump($url); supposed to do here? It just printed the url to the screen for me.
I just changed the code to the following for now. I know it's probably a hack but I'm not sure how to pass the url to the module to build the player.
This is working fine for me but I'd rather it be cleaner.
Comment #20
mrfelton commentedStill no Drupal 6 version of this module yet? If not, I may port the above code myself...
Comment #21
zengenuity commentedThis version works and is compatible with Drupal 6.
Note: I made a few changes to suit my purposes, so feel free to change these to your liking.
[audio: NID]to[audio: node:NID]. I did this because I have a video filter for use with FlashVideo that works this way, and I'm trying to keep it consistent for my users. You will likely want to change that back.[audio: node:NID info:TRUE], then the metadata will show up.