Contents Index Topic Contents | |
Previous Topic: Playback Methods and Properties Next Topic: Using Playlists |
Customizing the User Interface
You can control the way the Microsoft® Windows Media™ Player control looks when it is embedded in a Web page. You can make it look just like the Windows Media Player application, complete with standard control buttons, a trackbar, and text display for the media file information. You can enable just the video display panel and control buttons of the Windows Media Player, so that the video playback takes up the least amount of space on a page. For audio-only playback, you can even disable all display of the Windows Media Player control, and create your own control buttons and text displays in HTML.
The display element of the Windows Media Player control is determined by a number of properties that are set when the control is created on the Web page. This article is a guide of how the value of those properties affect the way the Windows Media Player control is displayed.
This article contains the following sections.
- User Interface Elements
- Sizing the Windows Media Player Control
- Additional User Interface Attributes
- Faceplates
User Interface Elements
The Windows Media Player control also exposes properties that determine which elements of the user interface are enabled and displayed to the end user. The following figure depicts the elements of the Windows Media Player user interface.
The following properties determine which user interface elements are displayed.
- The ShowControls property specifies whether the control bar is displayed. The control bar contains playback controls. Optionally, it has audio and position controls as well.
- The ShowAudioControls property specifies whether the mute button (speaker icon) and volume slider control are displayed on the control bar.
- The ShowPositionControls property specifies whether the fast forward, fast rewind, skip ahead, skip previous, and preview buttons are displayed on the control bar.
- The ShowTracker property specifies whether the trackbar is displayed. The trackbar indicates the progress of the current clip. End users can seek to any position in the clip by clicking and dragging the progress indicator on the trackbar. The trackbar is only visible when the control bar is enabled.
- The ShowDisplay property specifies whether the display panel is displayed. The display panel provides show and clip information.
- The ShowCaptioning property specifies whether the closed captioning display panel is displayed.
- The ShowGotoBar property specifies whether the Go To bar is displayed.
- The ShowStatusBar property specifies whether the status bar is displayed.
Sizing the Windows Media Player Control
One powerful feature of the Windows Media Player is its ability to stretch or shrink a clip from its original dimensions. Changing clip dimensions can be done programmatically by changing the value of the DisplaySize property. This property can be set to a wide range of values, from one half the size of the source image to full-screen display. It can only be set when the value of the AllowChangeDisplaySize property is true.
For Windows-based applications, the initial dimensions of the Windows Media Player control are determined at design time. For example, in Microsoft® Visual Basic® you select the control from the toolbox and use the mouse to draw the Windows Media Player object on the form. On a Web page with an embedded control, the HEIGHT and WIDTH parameters of the OBJECT tag determine the initial size of the control. If the height and width are specified, and the value of the AutoSize property is false, media clips conform to the dimensions of the Windows Media Player.
Specifying the size is an ideal way to tailor the Windows Media Player to specific media content. However, because clips can be stored and streamed in a variety of shapes and sizes, it is often advantageous to have the Windows Media Player conform to the dimensions of the clip. Setting the AutoSize property to true allows the Windows Media Player to stretch or shrink to accommodate the clip played at the specified display size.
When the AutoSize and ShowControls properties are both true, the control bar might determine the minimum width of the Windows Media Player. The Windows Media Player can resize itself no smaller than the control bar with all of its buttons displayed. Adding position and audio controls increases the width of the control bar. The following table describes the different widths of the control bar.
Width ShowAudioControls ShowPositionControls Narrowest False False Wide True False Wider False True Widest True True If the AutoSize property is false, the HEIGHT and WIDTH parameters specify the dimensions of the entire control, including the control panel, display panel, status bar, and so forth. If the specified height is insufficient for both the controls and the video display, the video shrinks to fill the available space. If the specified width is insufficient to accommodate the control bar, buttons on the right side of the control bar are cut off.
If the Windows Media Player control is embedded in a Web page, using HEIGHT and WIDTH parameters has the following effects:
- The DisplaySize property defaults to mpFitToSize. Clips are sized to fit into the specified dimensions.
- The AutoSize property defaults to false.
Embedding the Windows Media Player control without specifying HEIGHT and WIDTH parameters has the following effects:
- The DisplaySize property defaults to mpDefaultSize. Clips are sized to the dimensions of the source image.
- The AutoSize property defaults to true.
Additional User Interface Attributes
You can add a colored video border around the display area to tailor the appearance of the Windows Media Player to your Web site. The following properties determine how the video border looks:
- The VideoBorderWidth property indicates the width in pixels of the video border.
- The VideoBorderColor property specifies the color of the video border.
- The VideoBorder3D property specifies whether a three-dimensional border effect is enabled.
The following properties determine the appearance of the control before a title starts playing.
- The TransparentAtStart property determines whether the Windows Media Player control is visible before it begins rendering data.
- The AnimationAtStart property determines whether animation displays while the Windows Media Player control is buffering data.
Faceplates
A faceplate is an HTML application that uses a customized user interface to the Windows Media Player control. It generally uses just the video display panel for video output, or no display at all for audio output. The user interface is typically written in dynamic HTML (DHTML), and uses Web scripts to control the Media Player playback. It enables you to customize the look and feel of the Media Player to the content it is presenting.
For more information about creating Media Player faceplates, see the Faceplate Authoring Guide.
Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.