Hiding the Windows Media Player Control

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Windows Media Player ActiveX object is embedded in a webpage using the OBJECT element. Unlike earlier versions, the OBJECT element that defines Windows Media Player must be placed in the BODY section of a webpage, between the <BODY> and tags. Placing the Windows Media Player ActiveX object in the HEAD section of a webpage to hide the user interface can produce unexpected results.

If you put the Windows Media Player ActiveX control in the BODY section of a webpage, the control user interface will be displayed. If you do not want it to be displayed, and wish to create your own user interface, set the height and width attributes of the OBJECT element to zero.

The control can also be made invisible by setting the Player.uiMode property to "invisible". This can be done using a PARAM tag as discussed in the next section. In this case, space is reserved for the control using height and width, but nothing is displayed in the reserved space until uiMode is changed to something other than "invisible".

Using the Windows Media Player Control in a Web Page