Using JAVASCRIPT to control MEDIA PLAYER
Last Update:2018-12-08
Source: Internet
Author: User
<Script language = javascript defer>
Var volv = phx. settings. volume;
SetInterval ("if (phx. playState = 3) {time. innerText = phx. controls. currentPositionString + \ '| \' +
Phx. currentMedia. durationString} ", 1000 );
SetInterval ("if (phx. playState = 3) {itcn. style. width = parseInt (245 * (phx. controls. currentPosition/phx. currentMedia. duration)} ", 1000 );
Function volup (){
If (volv <100 ){
Volv + = 5;
Phx. settings. volume = volv;
Time. innerText = volv ;}
Else {time. innerText = \ 'maximum \';}
}
Function voldown (){
If (volv> 0 ){
Volv-= 5;
Phx. settings. volume = volv;
Time. innerText = volv ;}
Else {time. innerText = \ 'minimum \';}
}
</Script>
<P>
<Object classid = "clsid: 6BF52A52-394A-11D3-B153-00C04F79FAA6" id = "phx" width = "245" height = "240">
<Param name = "URL" value = "http://www.wfzx.net/wf-phx/music/she_superstar.wmv">
<Param name = "rate" value = "1">
<Param name = "balance" value = "0">
<Param name = "currentPosition" value = "0">
<Param name = "defaultFrame" value>
<Param name = "playCount" value = "1">
<Param name = "autoStart" value = "-1">
<Param name = "currentMarker" value = "0">
<Param name = "invokeURLs" value = "-1">
<Param name = "baseURL" value>
<Param name = "volume" value = "50">
<Param name = "mute" value = "0">
<Param name = "uiMode" value = "full">
<Param name = "stretchToFit" value = "0">
<Param name = "windowlessVideo" value = "0">
<Param name = "enabled" value = "-1">
<Param name = "enableContextMenu" value = "-1">
<Param name = "fullScreen" value = "0">
<Param name = "SAMIStyle" value>
<Param name = "SAMILang" value>
<Param name = "SAMIFilename" value>
<Param name = "captioningID" value>
<Param name = "enableErrorDialogs" value = "0">
<Param name = "_ cx" value = "6482">
<Param name = "_ cy" value = "6350">
</Object>
</P>
<Input type = button value = mute onclick = phx. settings. mute = phx. settings. mute = true? False: true; time. innerText = phx. settings. mute = true? \ 'Mute \ ': \ 'Disable mute \';>
<Input type = button value = play onclick = phx. controls. play (); time. innerText = \ 'play \ ';>
<Input type = button value = pause onclick = phx. controls. pause (); time. innerText = \ 'suspend \ ';>
<Input type = button value = stop onclick = phx. controls. stop (); time. innerText = \ 'Stop \ ';>
<Input type = button value = mode onclick = phx. settings. balance = phx. settings. balance = \ '2017 \'? \ '-100 \': \ '000000'; time. innerText = phx. settings. balance = \ '000000 \'? \ 'Right channel \ ': \ 'left channel \';>
<Input type = button value = vol ++ onclick = volup ();>
<Input type = button value = vol -- onclick = voldown ();>
<Input type = button value = fullscreen onclick = "if (phx. playState = 3) phx. fullscreen = 1;">
<Br>
<Div id = "time" style = "background: # f2f3f7; width: 245"> loading media... </Div>
<Table id = bar style = "width: 245; height: 10px; border: 1px black solid;">
<Tr>
<Td id = itcn bgcolor = # f70968 style = "width: 0"> </td>
<Td id = bar2 style = "width: 245"> </td>
</Tr>
</Table>