如何使用 jQuery 滑块更新 Flash 播放器的歌曲音量

How to update the song's volume for a flash player using jQuery slider?

本文关键字:播放器 Flash jQuery 何使用 更新      更新时间:2023-09-26

我在下面的代码上遇到了一些问题。 Flash 播放器有一个默认的音量滑块,但我想使用 jQuery 滑块来更改音量。 当我移动滑块时,音量值 (NR) 正在更改,但歌曲的音量没有。

感谢您的输入。

<!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='&amp;showslider=0&amp;width=25&amp;autoplay=1&amp;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'>

您是否有权访问闪存源或源是否公开外部接口?如果没有,不要费心尝试你不能。

编辑:只需检查您正在使用的播放器的文档,花了我5秒钟:

http://flash-mp3-player.net/players/js/documentation/