Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript & Windows Media Player (capturing keystrokes)

Status
Not open for further replies.

tgw108

Programmer
Aug 2, 2002
2
US
I have an HTML Page with an Windows media player embed. It
is set to autostart and go full screen. I also have an IR
remote control mapped to certain keyboard functions (ie
Ctrl-1). I have written a script to capture those keyboard
functions and perform various WMP functions when they are
presses (ie stop,play,pause). This script doesn't seem to
capture events in full screen mode, however when I uncheck
full screen they work fine. I need this to work in full
screen. My sample function is below. Anyone have any ideas?

ex:


function

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Sub MediaPlayer_KeyDown(iKeyCode, iShiftState)
//Represents Ctrl-1
If iKeyCode == 49 AND iShiftState == 2 Then MediaPlayer.Pause();
End IfEnd Sub
</SCRIPT>

embed
<object id=&quot;MediaPlayer&quot; width=&quot;640&quot; height=&quot;480&quot; classid=&quot;CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95&quot; type=&quot;application/x-oleobject&quot;>
<param name=&quot;FileName&quot; value=&quot;japan4.mpg&quot;>
<PARAM NAME=&quot;autostart&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;showcontrols&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;AllowChangeDisplaySize&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;DisplaySize&quot; VALUE=&quot;3&quot;>
<PARAM NAME=&quot;ShowGotoBar&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;Volume&quot; VALUE=&quot;-250&quot;>
<PARAM NAME=&quot;SendKeyboardEvents&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;SendPlayStateChangeEvents&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;EnableFullScreenControls&quot; VALUE=&quot;1&quot;>
</object>
 
What is with the semicolon and the double equals.

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Sub MediaPlayer_KeyDown(iKeyCode, iShiftState)
//Represents Ctrl-1
If iKeyCode == 49 AND iShiftState == 2 Then MediaPlayer.Pause();
End IfEnd Sub
</SCRIPT>

It looks like you are combining vbscript and Javascript.

cornboy88
[noevil]
 
sorry just leftovers from converting from Jscript. Either way the Windows media player doesn't regonize the script when in full screen mode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top