Without a reader


  • The *.mp3 file must be completely loaded into the local computer. The sound is then played with the local reader associated with *.mp3 files



With a reader


  • This allow to read the *.mp3 file like a stream. The sound is played as soon (few seconds) after reading.
    • Security restrictions for cross-domain. The *.mp3 file must be in the same domain as the swf file
    • The user don't wait
    • Listen O Fortuna, Carl Orff, Carmina Burana




Upload the reader - dewplayer


  • I use dewplayer, a light (4K) flash player. This player is free
  • Upload into your site, the dewplayer.swf from alsacreations



Using <object> to embed dewplayer



  • Type this code, data and value must be typed within one line :

<object type="application/x-shockwave-flash"

data="http://YOURSITE/dewplayer.swf?
mp3=http://YOURSITE/YOURFILE.mp3
&amp;showtime=1
&amp;bgcolor=c3d9ff
&amp;volume=80"
width="200" height="20">

<param name="movie"
value="http://YOURSITE/dewplayer.swf?
mp3=http://YOURSITE/YOURFILE.mp3
&amp;showtime=1
&amp;bgcolor=c3d9ff
&amp;volume=80" />

</object>

  • We can cConfigure your player, adding these optional values :

&amp;autoplay=1 Start play when the page is loaded

&amp;autoreplay=1 Continuous reading

  • Other values :

&amp;showtime=1 Show duration

&amp;bgcolor=rrggbb Color code (htm) without #

&amp;volume=xx 0 no sound, 100 higher volume



Remove the tool-tip Click to activate ...



  • For some version of IE, we must click 2 times on the object to play the sound. This is an ActiveX control security warning, due to a change on IE.
  • To remove this Click to activate and use this control tool-tip, Adobe give a turnaround, which mainly, call the flash player with a special javascript
  • Upload Ac_RunActiveContent into GPC from Adobe.
  • Loda the script : 



<script type="text/javascript
src="http://YOURSITE/AC_RunActiveContent.js"">
</script>

  • Finally, call the reader within a javascript
  • Note, src must be typed within one line, and, there is no extension to the player name :



<script type="text/javascript">

AC_FL_RunContent('width','200'
,'height','20'
,'wmode','transparent'
,'align','middle'
,'type','application/x-shockwave-flash'
,'src','http://YOURSITE/dewplayer?
mp3=http://YOURSITE/YOURFILE.mp3
&amp;volume=80
&amp;showtime=1
&bgcolor=c3d9ff'
,'allowScriptAccess','sameDomain'
,'quality','high'
,'bgcolor','#c3d9ff');

</script>

  • Listen Mozart, Requiem, Dies Irae :




Using dewplayer-multi


  • You need to use the pipe character inside the data and value attributes (again, within one line) :
  • Pipe character can by typed with alt+0124



"http://YOURSITE/dewplayer-multi.swf?
mp3=YOURFILE1.mp3|YOURFILE2.mp3... "
  • But, with dewplayer-multi, the pipe character must be URL encoded with %7C

"http://YOURSITE/dewplayer-multi.swf?
mp3=YOURFILE1.mp3%7CYOURFILE2.mp3... "



Google Gadget with the dewplayer Reader


  • I create a Google Gadget containing the dewplayer reader, to play MP3 sounds : 

flash_dewplayer.xml
 



flash_dewplayer-multi.xml
 



Using a Playlist with XSPF Web Music Player


  • XSPF Web Music Player is a flash-based web application that uses xspf playlist format to play mp3 songs. XSPF is the XML Shareable Playlist Format
  • I use the Extended version
  • Upload into your site the xspf_player.swf
  • The Playlist and the Player must be hosted in the same Domain



Creating a Playlist


  • Technical specification can be found in XSPF (spiff) site
  • The basic structure of the .xspf file is as follows :


<?xml version="1.0" encoding="UTF-8"?>
<playlist version="0" xmlns = "http://xspf.org/ns/0/">

<title>My Playlist</title>

<trackList>

<track>
<location>URL/name1.mp3</location>
<image>URL/name1_pic.jpg</image>
<annotation>info text for name1</annotation>
<info>URL for more info about name1</info>
</track>

<track>
...
</track>
</trackList>
</playlist>
  • Save the file with the extension .xspf and upload it into your site


Using <object> to embed XSPF player


  • Type this code, data and value must be typed within one line, with same content :

<object type="application/x-shockwave-flash"
data="http://YOURSITE/xspf_player.swf?
autoload=true
&playlist_url=http://YOURSITE/tracklist.xspf"
width="400" height="170">

<param name="movie"
value="http://YOURSITE/xspf_player.swf?
autoload=true
&playlist_url=http://YOURSITE/tracklist.xspf">
<param name="allowScriptAccess" value="always'>
<param name="quality" value="high">
<param name="bgcolor" value="#c3d9ff">

</object>

  • To configure the player, use these parameters :


&playlist_url : the url of the xspf file to load

&autoplay : true/false, to start playing without click

&autoload : true/false to load the playlist without click


  • Listen my Playlist :




Removing the <object> tag



  • AS for dewplayer, we can call the player with a javascript :


<script type="text/javascript">

AC_FL_RunContent('width','440'
,'height','180'
,'type','application/x-shockwave-flash'
,'src','http://YOURSITE/xspf_player?
playlist_url=http://YOURSITE/tracklist.xspf'
,'allowScriptAccess','always'
,'quality','high'
,'bgcolor','#c3d9ff');

</script>


  • Listen my Playlist, calling the player without <object> tag :




A Google Gadget with a Flash Reader



flash_playlist.xml
 
  



More Informations










One Day - One Label - One Wine



Add this gadget to Google