Hi, folks,
I am struggling to get images to do what I want in a player with xml playlist that streams both mp3s and flvs.
I'd like the image in the player window to load and continue to display while an mp3 is playing. Currently, once the mp3 begins streaming, the preview image disappears, leaving a big empty player window.
Also, in the case when a video is played and then followed with the playing of an audio clip, the last loaded frame of video previously streamed remains in the player, even though another stream (the mp3) is now playing. This is not desirable. I suspect that if I can fix the first issue, this second one will become moot, but maybe they are separate issues.
Is there a way to do achieve my goals without getting into the Flash player code itself?
Also, I can only get the preview thumbnails to load from a remote URL by http, and not from the RTMP server where the media content (mp3, flv) is coming from. Is it possible to do the latter?
Here's my code:
<script type="text/javascript">
createHomeMediaPlayer( '/mjf/web/data/playlists/home.xml' );
</script>
function createHomeMediaPlayer( playlist ) {
var so = new SWFObject( '/mjf/web/media/jw_flv_player/mediaplayer.swf', 'mediaplayer', '500', '240', '8' );
so.addParam( 'allowscriptaccess', 'always' );
so.addParam( 'allowfullscreen', 'true' );
so.addVariable( 'file', playlist );
so.addVariable( 'width', '500' );
so.addVariable( 'height', '240' );
so.addVariable( 'displaywidth', '300' );
so.addVariable( 'backcolor', '0xe3d098' );
so.addVariable( 'frontcolor', '0x565347' );
so.addVariable( 'lightcolor', '0x990000' );
so.addVariable( 'screencolor', '0x000000' );
so.addVariable( 'autostart', 'false' );
so.write( 'media_player' );
}
And here is the playlist:
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>Rhythm-a-ning (1964)</title>
<creator>Thelonious Monk</creator>
<image>http://blahblah/images/1964poster_detail.png</image>
<location>rtmp://sul-streaming.stanford.edu/simplevideostreaming</location>
<identifier>mp3:mjf/hp_monk_0055</identifier>
<info/>
</track>
<track>
<title>Meditations on Integration (1964)</title>
<creator>Charles Mingus</creator>
<image>http://blahblah/images/1964poster_detail.png</image>
<location>rtmp://sul-streaming.stanford.edu/simplevideostreaming</location>
<identifier>mp3:mjf/hp_mingus_0054</identifier>
<info/>
</track>
...
</trackList>
</playlist>
On this site, I'm using an older version of JW Player (not sure which one, unfortunately; it was downloaded installed about 9 months ago).
I've trolled through recent forum posts and understand that the latest, not yet released version of the player (4.4.xxx, available in the Subversion repository) addresses some audio issues. I'd prefer not to use the newest version on this site, but will upgrade if someone can assure me that the functionality I desire is possible in the latest version, and not possible in earlier releases.
Thanks for any help!
Salt Girl
Images have to be served using the HTTP protocol. If your RTMP server can also serve via HTTP (like Red5 does), then you can serve the images, HTML, XML, etc. from the same server.
The v4.4.162 player seems to show the preview image while playing MP3s. Switching back and forth from MP3s to FLVs doesn't seem to break this functionality.
You can see a demo here: http://willswonders.myip.org:8082/Two%20Playlists%20SC.html
The players, playlists, and image are served by nginx via HTTP although they could be coming from my Red5 server. The MP3s and the FLV are served via RTMP from my Red5 server.
(My upstream is slow, so the video may not play smoothly.)