Reputation: 437
I'm having some trouble with the code below. the flash player has a default volume slider, but I want to use the jQuery slider to change the volume. the volume value(nr) is changing while I move the slider, but the volume of the song doesn't.
thx for your input.
<!DOCTYPE html>
<script type='text/javascript'>
$(document).ready(function(){
DefVol=$('#ArVol').val();
PlayPt1='<object type="application/x-shockwave-flash" data="http://flash-mp3- player.net/medias/player_mp3_maxi.swf" width="25" height="25"><param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" /><param name="FlashVars" value="mp3='
PlayPt2='&showslider=0&width=25&autoplay=1&volume='+DefVol+'" /> </object>'
$("#RegVol").slider({orientation:'horizontal', range:'min', value:DefVol,min:0, max:200, slide:function(event,ui){DefVol=parseInt(ui.value/200), $( "#ArVol" ).val(ui.value );}
})
$( "#ArVol" ).val($( "#RegVol" ).slider( "value" ) );
$('#PlayMp3').click(function(){
IaSrc='song.mp3'
$('#showPlay').html(PlayPt1+IaSrc+PlayPt2)
})
})
</script>
<table><tr>
<th><div id='RegVol' style='width:150px;margin:0px 10px'></div></th>
<th><input id='ArVol' size='1' value='55'></th>
<th><div id='showPlay'></th>
</tr></table>
<input type='button' value='Play' id='PlayMp3'>
Upvotes: 0
Views: 909
Reputation: 20155
Do you have access to the flash source or does the source exposes an external interface ? if not , dont bother trying you cant.
EDIT : just check the documentation of the player you are using ,took me 5 seconds :
http://flash-mp3-player.net/players/js/documentation/
Upvotes: 1