Nov. 14, 2008Paulus
Hi,
When playing an mp3 file the preview image remains displayed.
However, when one selects an mp3 stream (e.g. for shoutcast) the preview image disappears (screen becomes black).
I would like to setup the JW Player such that the user initially sees a picture with a play button on it,
and when the user hits the play button, the player starts to play the mp3 stream and keeps the picture.
Like said above, this works for a mp3 file but not for a mp3 stream.
How can I easily achieve this?
-Paul.
Here is an example, the html file (all js/swf files are standard files put in the same directory as this html file):
<head>
<title>Player Testpage</title>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<body>
<div class="media" id="preview">You need Flash Player 9 and a browser with javascript to use this test!</div>
<script type="text/javascript">
var s1 = new SWFObject("player.swf","player","470","470","9");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addParam("wmode","opaque");
s1.addParam("flashvars","file=mybunnies.xml&skin=overlay.swf&lightcolor=ff9900&frontcolor=ffffff&=&backcolor=000000&controlbar=over&playlist=bottom");
s1.write("preview");
</script>
</body>
And the playlist "mybunnies.html" containig one mp3 and one shoutcast stream:
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<item>
<title>Big Buck Bunny - MP3 audio</title>
<media:content url="http://www.jeroenwijering.com/upload/bunny.mp3" type="audio/mpeg" duration="33" />
<media:thumbnail url="http://www.jeroenwijering.com/upload/bunny.jpg" />
<media:credit>Blender Foundation</media:credit>
<description>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</description>
<link>http://www.bigbuckbunny.org</link>
</item>
<item>
<title>Test Stream</title>
<media:content url="http://broadband.eve-radio.com:8000/;stream.nsv" type="audio/mpeg"/>
<media:thumbnail url="http://www.jeroenwijering.com/upload/bunny.jpg" />
<media:credit>Blender Foundation</media:credit>
<description>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</description>
<link>http://www.bigbuckbunny.org</link>
</item>
</channel>
</rss>
Nov. 14, 2008Paulus
(In my posting above, the playlist should of course be called "mybunnies.xml" and not "mybunnies.html")
Nov. 14, 2008kLink
You can trick the player into thinking it's playing an MP3 by appending "?mp3" to the stream URI:
<media:content url="http://broadband.eve-radio.com:8000/;stream.nsv?mp3" type="audio/mpeg"/>
Nov. 14, 2008Paulus
Hi kLink,
That indeed did the trick. Thanks!
-Paul.
Nov. 14, 2008kLink
@Paulus,
You're welcome. Good Luck!
Click here to download a sleek player that plays any AAC, FLV, MP3 or MP4 on your PC -- all without opening a browser!
The free JW Desktop Player is the most entertaining app you’ll download all year.
Clicking the download link starts InstallIQTM, which manages your installation. Learn more.
Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!
If you don’t buy a commercial license, you cannot use a JW Player on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.