Contents Index Topic Contents | |
Previous Topic: Architecture Next Topic: Content Formats |
Compatibility Modes
The Microsoft® Windows Media™ Player control is designed to be a universal player for all types of multimedia data. It works equally well rendering content served by Windows Media Services and Microsoft® DirectShow® local playback media types. The Windows Media Player control incorporates many of the attributes supported by the earlier Microsoft® NetShow™ Player version 2.0 control and by the Microsoft® ActiveMovie control, along with new methods, properties, and events. In addition, the Windows Media Player control can operate in one of the following three modes to provide compatibility with the NetShow Player version 2.0 and ActiveMovie controls.
- MediaPlayer modeThe control supports all of the methods, properties, and event notifications documented in this SDK.
- NSPlay modeThe control exposes the methods, properties, and events supported for the NetShow Player version 2.0 control.
- ActiveMovie modeThe control exposes the methods, properties, and events supported for the ActiveMovie control.
All three modes provide the enhanced streaming and playback capabilities of the Windows Media Player; however, each mode supports its own set of attributes.
The class identifier (CLSID) used to create an instance of the control determines the mode of operation. Using one of the CLSIDs previously reserved for NetShow Player control or the ActiveMovie control creates an instance of the Windows Media Player control in that alternate mode. As a result, applications and Web pages created with these controls can use the improved performance of the Windows Media Player with little or no change to their code. In many cases, you can update a Web page simply by changing the CODEBASE attribute to specify the cabinet (.cab) file containing the Windows Media Player control.
Important Installing the NetShow Player version 2.0 control or the ActiveMovie control on your development platform after installing the Windows Media Player control causes unexpected results.
This article contains the following sections.
Forward Compatibility
In addition to the attributes supported when you create an instance of the control in NSPlay or ActiveMovie mode, a new property named MediaPlayer is exposed. This property provides access to the methods and properties supported in MediaPlayer mode. Use the following syntax to access MediaPlayer-mode attributes when the control is operating in NSPlay or ActiveMovie mode.
AlternateMode.MediaPlayer.AttributeAlternateMode is the instance of the player control object ID created by using the NSPlay or ActiveMovie CLSID, and Attribute is any method or property exposed by the control in MediaPlayer mode. For example, if your script embedded the NetShow Player 2.0 control with an ID attribute equal to NSPlay1, you would access the Volume property by using the following code.
NSPlay1.MediaPlayer.VolumeBackward Compatibility
In addition to forward compatibility, the control provides access to NetShow Player 2.0 and ActiveMovie attributes in MediaPlayer mode. Two properties, NSPlay and ActiveMovie, are exposed when an instance of the control is created as usual. Use the following syntax to access NetShow Player or ActiveMovie properties and methods when the control is operating in MediaPlayer mode.
NormalMode.NSPlay.AttributeOr
NormalMode.ActiveMovie.AttributeNormalMode is the instance of the player control created with the Windows Media Player CLSID and Attribute is any method or property exposed by the control in an alternate mode. For example, to access the Author property of the NetShow Player 2.0 control from code written for the Windows Media Player control, use the following:
MediaPlayer1.NSPlay.AuthorCompatibility Considerations
Operating in forward or backward compatibility modes has the following restrictions.
- The control only fires events that are supported for the mode in which an instance of the control is created.
- Many methods and properties exposed by the Windows Media Player control have the same name as properties and methods exposed by the NetShow version 2.0 and ActiveMovie controls. Most of these attributes exhibit the functionality of their predecessors. However, instances of methods with the same name and different behavior always function in the mode in which they are created.
- Mode-switching is only allowed on properties accessed at run time. You cannot set properties for alternate modes at design time.
Control CLSIDs
Following is a list of the CLSIDs used to create an instance of the control in each mode.
Control mode CLSID MediaPlayer 22D6F312-B0F6-11D0-94AB-0080C74C7E95 NSPlay 2179C5D3-EBFF-11cf-B6FD-00AA00B4E220 ActiveMovie 05589FA1-C356-11CE-BF01-00AA0055595A
Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.