![]() |
Previous | Next |
This topic applies to Windows Media Player version 6.4 only.
Start by positioning and sizing the faceplate window, as shown in the following example.
<HTML>
<HEAD>
<SCRIPT>
var sampleWidth = 297;
var sampleHeight = 292;
window.resizeTo(sampleWidth,sampleHeight);
var screenPosX = screen.availWidth/2 - sampleWidth/2;
var screenPosY = screen.availHeight/2 - sampleHeight/2;
window.moveTo(screenPosX, screenPosY);
</SCRIPT>
<TITLE>Windows Media Player Faceplate</TITLE>
<HTA:APPLICATION
CAPTION="true"
MAXIMIZEBUTTON="no">
</HEAD>
The script included here centers the window in the screen and sets it to the proper size for the Windows Media Player control. The attributes specified for the HTA:APPLICATION tag specify that the window will have a menu bar for repositioning, and disable the Maximize button so that the window size will remain the same.
The following tags lay out the title graphic and the Windows Media Player video display panel.
<BODY SCROLL="no" BGCOLOR="#000000">
<SPAN STYLE="position:absolute;
left:8px;
top:2px;
width:221px;
height:20px;"
>
<IMG src="../art/sample2/title.gif">
</SPAN>
<OBJECT ID="MediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
WIDTH="282"
HEIGHT="200"
STYLE="position:absolute;
left:0px;
top:24px;"
>
<PARAM NAME="FileName" VALUE="../art/media/dove.asf">
<PARAM NAME="AutoStart" VALUE="0">
<PARAM NAME="ShowControls" VALUE="0">
<PARAM NAME="ShowStatusBar" VALUE="0">
<PARAM NAME="ShowDisplay" VALUE="0">
<PARAM NAME="ClickToPlay" VALUE="0">
</OBJECT>
The title graphic is contained in a SPAN tag positioned near the upper left corner of the window. The Windows Media Player video display is positioned below the title and flush to the left of the screen. The PARAM tags set various properties of the Windows Media Player. The AutoStart and ClickToPlay properties are set to false, so that playback will be controlled entirely by the faceplate buttons (added later in the file). Also, note that unlike the Simple Faceplate, this faceplate sets the ShowControls, ShowStatusBar, and ShowDisplay properties to false. Doing so turns off the standard interface controls built in to the Windows Media Player, leaving only the video display panel showing. The custom user interface will take the place of the standard controls.
Previous | Next |