Hi,
I have a windows media player object embedded in my html code.
Along with the regular start/stop/forward/rewind buttons, I need to have a volume balancer. (A left / right Audio channel slider)
When dragged to the left, the audio should be heard only the in the left earpiece and viceversa.
Found a piece of code, but its not quite working:
[code]
function doChangeVolume (e)
{
var lineVal = document.all[“line”];
var scrupVal = document.all[“scrub”];
scrupVal.style.width = (e.x – parseInt(lineVal.style.left))+”px”;
var balPercent = (e.x – parseInt(lineVal.style.left)) / parseInt(lineVal.style.width) *100;
var balanceValue = -100+(2*balPercent);
document.wmtPlayer.settings.balance = balanceValue;
}
<table>
<tr>
<td colspan=”2″ width=”20%” vAlign=top>
<OBJECT ID=”wmtPlayer” width=”512″ height=”457″ classid=”CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6″>
<PARAM name = “URL” value = “C:Flashmob04Movie.wmv”>
<PARAM NAME=”AutoStart” VALUE=”True”>
<PARAM NAME=”ShowControls” VALUE=”True”>
<PARAM NAME=”ShowStatusBar” VALUE=”True”>
<PARAM NAME=”ShowDisplay” VALUE=”False”>
<PARAM NAME=”AutoRewind” VALUE=”True”>
<embed type=”application/x-mplayer2″ name=”wmtPlayer” src=”C:/Flashmob04Movie.wmv” showstatusbar=”true” autoplay=”true” loop=”false” controller=”true” playeveryframe=”false” width=”512″ height=”457″ pluginspage=”http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/”>
</embed>
</OBJECT>
</td>
</tr>
<td>
<div id=”line” style=”position:absolute; width:5px; BACKGROUND: #b9cdd2; height:11px; VISIBILITY:display; z-index:5; left: 0px; top: 500px;”><img onClick=”javascript:doChangeVolume(event)” id =”line_img” src=”images/line_final.gif” width=”80″ height=”7″ border=”0″ class=’handCursor’></div>
<div id=”scrub” style=”position:absolute; width:0px; BACKGROUND: #b9cdd2; height: 12px; VISIBILITY:display; z-index: 6; left: 0px; top: 500px;”>
<img id=”scrub_img” src=”images/scrup.gif” width=”20″ height=”13″ border=”0″ ></div>
</td>
Does anybody know about this? Please help ! ?