OK, I have just moved over to using the JW WMV player (plays WMA also, which is exactly what I needed). I have my menu structure working well with this new player. For posterity (incase anyone else is looking for the same solution) I have outlined my solution below.
If you don't care to read this then please skip to the part below the green text because I still have an issue that I would like to resolve.
This is the script I am using in the header when I change radio stations:
Code:
<script type="text/javascript">
function radioswitch(station){
var elm = document.getElementById('radioplayer');
var src = '/ssrp/embed/wmvplayer.xaml';
var cfg = {
file: station,
width:'250',
height:'20',
autostart:'true',
volume:'25'
};
var ply = new jeroenwijering.Player(elm,src,cfg);
}
</script>
The player (and initially empty file source just to populate the div with a player) is stored here:
Code:
<div style="position: relative;top: 0px;left: 175px; width:250px;"> <!-- Open Player -->
<div id="radioplayer">the player will be placed here</div>
<script type="text/javascript">
var elm = document.getElementById("radioplayer");
var src = '/ssrp/embed/wmvplayer.xaml';
var cfg = {
file:'',
width:'250',
height:'20',
volume:'10'
};
var ply = new jeroenwijering.Player(elm,src,cfg);
</script>
<br>Now Playing: <span id="radionowplaying">--</span>
</div> <!-- Close Player -->
Then my menu appears in a <ul> with menu items grouped into genre categories. Individual stations are listed like this:
Code:
<li><input id="rock5" onclick="highlight(rock5);radionowplaying(rock5);radioswitch('http://player.cumulusstreaming.com/Stations/WXKR-FM/PubPoint.asx?PubPtASXStrng');" type="button" name="music" value="94.5 WXKR (Toledo, Rock)" /></li>
Basically I am rewriting the entire player with each station change because with 71+ stations in my menu I don't want to use the default tracklist with an XML directory of the stations. That would be a pain to find the right station in a straight scroll-through menu.
When a station is played the end result looks something like the thumbnail below. There is also a video player, but this is on a separate setup with <div id="videoplayer">...
Anyway, the problem I am having now is that
I would like to preserve the player's current volume level in between station changes. Is there a way to capture this in a variable on each call of radioswitch at the very beginning so that I don't have to default back to 25% every time? I know how to implement the preserved volume once it has been determined but I don't how how to actually grab it from the player. I imagine there has to be a way to do it but I can't even begin to guess what it would be.
Any thoughts or experience with this?