playing audio

I would like to implement playing audio within a FORM or a GRID.
Say the record would keep the file location like: /mysite/audio/MyAudioFile.mp3 then I want to put a link or an icon on the form/grid, so when the user click the link it will start playing the audio file. I have something like this implemented on one of my Joomla sites through JSeblod component and it works great.

QUESTION: how can I implement something like that with SC ?

PS>
perhaps implementing the same for video would be great to!

Arthur

Re: playing audio

Hello,

You could try to play mp3 files using html. Try searching for html mp3 player on google.

See this simple implementation to play SWF files.

1 - Store a SWF file on your web root folder (e.j. /usr/local/Zend/apache2/htdocs)

2 - Create a table that has the following schema: ID int, Video varchar (50)

ID - 1
Video - http://myServer:Port/myFile.swf

3 - Create a Grid application, and set Video type to Text

3.1 - On the onRecord event, use the following html tag:

{Video} = ‘<EMBED SRC="’.{video}.’" WIDTH=“600” HEIGHT=“480” AUTOPLAY=“TRUE” LOOP=“true”></EMBED>’;

Now you should be able to play SWF files.

regards,
Bernhard Bernsmann

Re: playing audio

sounds fantastic, but…
I’m a little confused by refering to HTML MP3 PLAYER, can you explain more what do you mean ?

Art

Re: playing audio

Hello,

Take a look at the Google Reader Mp3 Player: http://www.labnol.org/internet/design/html-embed-mp3-songs-podcasts-music-in-blogs-websites/2232/

regards,
Bernhard Bernsmann

Re: playing audio

I tried your sugestion with EMBED but in the place where FilePath it simply displays the code…
Art

Re: playing audio

this is the example code for Google Player:

<embed type=“application/x-shockwave-flash” flashvars=“audioUrl=<strong>MP3_FILE_URL</strong>” src=“http://www.google.com/reader/ui/3523697345-audio-player.swf” width=“400” height=“27” quality=“best”></embed>

but how would I embeed this into SC6 if this is HTML not PHP ?

Arthur

Re: playing audio

Hi,
create a new field of type TEXT, let’s say {player}.
In a form go to the field settings and change “Label Field” to yes.
In the onScriptInit event :

{player}="<embed type=‘application/x-shockwave-flash’ flashvars=‘audioUrl=<strong>
MP3_FILE_URL</strong>’ src=‘http://www.google.com/reader/ui/3523697345-audio-player.swf
width=‘400’ height=‘27’ quality=‘best’></embed>";

Watch the quotes!!

In a grid create a Text field and put the code in the onRecord event.

jsb

Re: playing audio

Thanks
should the field in database for the MP3 file be URL, FILE or TEXT type ?

I still can’t get it to work properly, the object player doesn’t take URL .
The exact string put into {player} variable looks like this:


{player}="<embed type='application/x-shockwave-flash' flashvars='audioUrl=<strong>{AudioURL}</strong>' src='http://www.google.com/reader/ui/3523697345-audio-player.swf' width='300' height='27' quality='best'></embed>";

{AudioURL} is a field in a database

Arthur

SC6_EmbedingAudio.jpg