Compatibility and Future Support for the Windows Media Player ActiveX Control

 

Jim Travis

Microsoft New Media Platforms Division

Updated November 2004

 

Applies to:

   Windows Media® Player 10

   Windows Media Player 9 Series

   Windows Media Player 6.4 ActiveX® control

 

Summary: Learn about issues and changes in the behavior of the Windows Media Player 6.4 ActiveX control that you might experience after installing Windows Media Player 9 Series or later. The enhancements for Windows Media Player 9 Series and later were made for security and privacy, and for technology improvements. This document discusses the common issues you might encounter and provides information to help you migrate your content from Windows Media Player 6.4 to Windows Media Player 9 Series or later.

 

Contents

Introduction

About the Control Versions

About the Compatibility Layer

Testing Your Web Pages and Applications

Content and Playback Issues

General Web Site Issues

Deploying Windows Media Player 9 Series or Later

For More Information

Introduction

Windows Media® provides a professional-quality end-to-end platform for developing and deploying digital media solutions. Windows Media Player, a key component of the Windows Media platform, enables Internet content providers (ICPs) to offer a rich media experience while delivering unmatched audio and video quality. The Windows Media Player 9 Series or later ActiveX® control, which is included with the Player, enables ICPs to take advantage of Windows Media Player 9 Series or later functionality in Web pages.

Features introduced with Windows Media Player 9 Series and the Player control include:

  • Support for Flash and image file playback.
  • Fast Streaming technology when used with Windows Media Services 9 Series.
  • Ability to use new codecs.
  • Enhancements for user privacy and security.
  • Performance improvements.
  • New Software Development Kit (SDK) features.
  • Improved support for embedding the Player control.
  • Features for customizing Windows Media Player.
  • Support for applications built using the .NET Framework.

With these new features, the Windows Media Player 9 Series or later ActiveX control gives ICPs the best solution for developing Web pages that include digital media, while respecting the privacy and security of the user. Because the Windows Media Player 9 Series or later control uses the same class ID as the version 7.0 or later Player controls, Web pages created using these earlier versions work without modification. Additionally, Web pages that embed these earlier versions can now easily take advantage of new functionality available with the 9 Series or later control.

The Windows Media Player 6.4 ActiveX control (which includes support for the Microsoft ActiveMovie® control) uses a different class ID than the version 7.0 or later Player control. It also exposes an entirely different object model. Because the version 6.4 control is being retired soon, and to allow existing Web pages to benefit from the 9 Series or later control improvements, Microsoft has developed a compatibility layer that emulates the Windows Media Player 6.4 object model while actually using the 9 Series or later Player control.

While the version 6.4 Windows Media Player control is currently distributed as part of Microsoft Windows®, future Windows releases might not include this control. For this reason, you should change your Web pages to use the Windows Media Player 9 Series or later control as soon as possible. For more information about Windows Desktop Product Life-Cycle Guidelines, see Windows Operating System Components. For more information about changing Web pages to use Windows Media Player 9 Series or later, see the Object Model Migration Guide section of the Windows Media Player 10 Software Development Kit (SDK).

Most Web pages created using the version 6.4 Player control will continue to work as expected when the compatibility layer takes over. This is because the primary functions of the control, such as opening and playing digital media content, are directly mapped between the two versions. However, some Web pages (and Player control applications that include Web browser controls) might exhibit changes in behavior when using the compatibility layer. This article discusses the common scenarios you might encounter when using the 9 Series or later control with a Web page designed for the version 6.4 control, suggests modifications you can make to your code, and provides information you can use when developing your strategy for migrating content to take advantage of the new control.

About the Control Versions

The following table lists the relevant digital media playback objects, their class IDs, and whether they are supported by the Windows Media® Player 9 Series or later control.

Object Class ID Supported by 9 Series?
NSPlay 2179C5D3-EBFF-11cf-B6FD-00AA00B4E220 No longer available.
ActiveMovie 05589FA1-C356-11CE-BF01-00AA0055595A Yes, but some features have limited or no support.
Windows Media Player 6.4 22D6F312-B0F6-11D0-94AB-0080C74C7E95 Yes, but some features have limited or no support.
Windows Media Player 7.0 6BF52A52-394A-11d3-B153-00C04F79FAA6 Yes
Windows Media Player 7.1 6BF52A52-394A-11d3-B153-00C04F79FAA6 Yes
Windows Media Player for Windows XP 6BF52A52-394A-11d3-B153-00C04F79FAA6 Yes
Windows Media Player 9 Series 6BF52A52-394A-11d3-B153-00C04F79FAA6 Yes
Windows Media Player 10 6BF52A52-394A-11d3-B153-00C04F79FAA6 Yes

About the Compatibility Layer

When a Web page (and some Windows® applications) that was designed using the Windows Media® Player version 6.4 control class ID is viewed on a computer with Windows Media Player 9 Series or later installed, the 9 Series or later control and the compatibility layer are invoked instead of the version 6.4 control. The compatibility layer then automatically translates the most common 6.4 object model methods, properties, and events to 9 Series or later object model equivalents. For instance, a Web page using the version 6.4 control can play a video file using the following Microsoft JScript® code (assuming that AutoStart is set to true):

Player6.Open("mms://www.proseware.com/intro.wmv");

The compatibility layer translates this method to use the 9 Series or later object model URL property instead, giving the same result as the following code:

Player9.URL = "mms://www.proseware.com/intro.wmv";

In this case, the version 6.4 call maps directly to the 9 Series or later call, and (except for the new user interface) the behavior is unchanged.

Another way a Web page using the version 6.4 control can play a video file is to use the FileName property:

Player6.FileName = "mms://www.proseware.com/intro.wmv";

In this case, the compatibility layer again translates the call to use the 9 Series or later object model URL property. However, the version 6.4 FileName property opens files as a synchronous operation, but the 9 Series or later URL property is asynchronous. Whether this difference presents itself as a behavior change depends on how the adjacent script code is written. If the script code simply plays the file, the behavior is unchanged. If subsequent script code requires that the video file is open before the subsequent code is executed, the code might fail if there is sufficient delay in opening the file.

Testing Your Web Pages and Applications

If you have Web pages or applications that were designed using the version 6.4 control, you should test them on a computer with Windows Media® Player 9 Series or Windows Media Player 10 installed to determine whether any code changes are needed. In general, there are three categories you should consider when you review your code for compatibility issues:

  • General changes in the behavior of the Player control.
  • Features of the version 6.4 object model that map to 9 Series or later features but might exhibit behavior changes. These features might require changing code.
  • Features of version 6.4 that are not supported when Windows Media Player 9 Series or later is installed.

General Behavior Changes

This section discusses general changes in the behavior of the version 6.4 Player control that you might encounter after installing Windows Media Player 9 Series or later.

The User Interface Is Different

The compatibility layer introduces a new user interface that is consistent with the appearance of the version 6.4 Player; however, it does not include the Closed Caption display panel or the Go To bar. The new user interface can introduce changes to the layout of the Web page, and resizing behaviors can be different as well. You should test your Web pages for general changes in the layout and then check to see whether playing video content of varying dimensions affects the appearance of the page.

Some Windows Applications Might Invoke the Compatibility Layer

Most Windows applications will continue to use the version 6.4 control without using the compatibility layer. However, certain applications might be written in a way that causes the compatibility layer to be invoked. You should test your application to see whether this is the case, and watch for any unexpected behavior. If you find that your application invokes the compatibility layer, you have three options:

  • Migrate your application to the Windows Media Player 9 Series or later control. Microsoft recommends this option because it creates a more secure and private experience for end users and allows them (and you) to take advantage of technology improvements.
  • Register your application to bypass the compatibility layer. There are registry keys that you can use to register your application. After it is registered, the compatibility layer will no longer be invoked. If you choose this option, you acknowledge that your application is not taking advantage of the privacy, security, and technology improvements in the 9 Series or later control, that you can un-register your application at any time, and that Microsoft is not responsible for maintaining these registry settings. For more information about registering to bypass the compatibility layer, see the article titled Windows Media Player 9 Series Compatibility Mode Bypass List in the Microsoft Knowledge Base.
  • Do nothing. If you choose this option, you must be aware that users might experience problems after installing Windows Media Player 9 Series or later.

Windows Media Metafiles Might Need to Be Modified

Because of the improved security features in Windows Media Player 9 Series or later, some ASX files might need to be modified. The version 6.4 control did little to validate and verify ASX file structure, parameter usage, and syntax. The 9 Series or later control performs validation and verification of ASX files more strictly. Therefore, ASX files that worked with the version 6.4 control might require changes to work with the 9 Series or later control.

The BANNER and LOGO elements are no longer supported in ASX files when using the compatibility layer. These elements are supported when using the 9 Series or later control. If your Web page requires these elements, you should use the 9 Series or later control.

Support for Urls and File Names Is More Restrictive

For security reasons, Windows Media Player 9 Series or later applies a stringent set of rules when parsing strings that represent Uniform Resource Locators (URLs) and file names. In general, the Player now supports RFC 2396-compliant URLs. For more information, see the Network Working Group Request for Comments: 2396 document at the Internet Engineering Task Force (IETF) Web site.

Use of Relative File Paths Is More Restrictive

Using relative file paths (such as "..\myVideo.wmv") to traverse to parent folders on the user's computer is no longer permitted; this usage is permitted for Web-based file paths. Traversing to child folders is always allowed (such as ".\videos\myVideo.wmv").

Some Behaviors Vary Depending on User Settings

Settings determined by the user through the Player menu system can affect the behavior of the control. For example, changing the settings for Video Size from the View menu affects the sizing behavior in Web pages as well.

Parameters and Properties Have Limited Sizes

For security reasons, very large strings might not be accepted for parameter and property values, such as URLs. In rare cases, this could cause a failure in the Web page. If you encounter this problem, you must form shorter strings.

Custom Protocol Handlers Might Not Work

If you use custom protocols for your content, you might need to register them. For information about registering custom protocols, see the Windows Media Player 10 SDK.

Behavior Changes in the Object Models

There are instances where behavior changes can affect your Web page. This section explains some of these.

AutoSize Property

The AutoSize property is ignored when you specify a value for the width or height of the control. If you require automatic sizing behavior, don't specify a value for width or height.

BaseURL Property

The BaseURL property no longer supports relative paths. You must change values for this property so that they use absolute paths.

Buffering Event

The compatibility layer does not raise the Buffering event for local content. If your application plays content on the user's computer, you must revise your code and use other events like OpenStateChange or PlayStateChange.

ClientID Property

To ensure user privacy, ClientID no longer retrieves a unique identifier for each user. Your code should not depend on the value retrieved by ClientID.

DisplaySize Property

When using the compatibility layer, a limited set of values is supported for DisplaySize. These are: 0 (default size), 3 (full screen), and 4 (fit to size). Your code must not depend on any of the other values.

FileName Property

Specifying a value for FileName when using the version 6.4 control, opened a file as a synchronous operation. File open operations are always asynchronous in the 9 Series or later object model. To correct potential difficulties caused by this new behavior, you can handle events like the Player.OpenStateChange event to determine whether a file is in a particular state.

SAMIFileName Property

The version 6.4 control resolves SAMIFileName values that don't include the full path to the SAMI file by using the path of the Web page that contains the control. When using the compatibility layer, these relative path names are resolved using the path of the digital media content. If your code specifies SAMIFileName without specifying the full path to the SAMI file, you should change your code to specify the full path. Alternatively, you can move your SAMI files to the same location as your digital media files.

Unsupported Version 6.4 Features

Some features of the version 6.4 control that are not supported by the 9 Series control can be replaced by equivalent functionality in another feature of the Windows Media Player 9 Series control. This section lists these version 6.4 features and provides general information about the 9 Series or later equivalents.

AboutBox Method

You can use the versionInfo property of the 9 Series or later control to retrieve this information and display it to the user.

ClickToPlay Property

Using either version 6.4 or 9 Series or later, you can imitate ClickToPlay behavior by using mouse event handlers to start or stop the Player.

DVD Object

If you need to provide DVD playback, you must update your Web page or application to use the 9 Series or later control, which fully supports DVD.

ShowCaptioning Property

The version 6.4 control user interface included an area for displaying closed captions. The 9 Series or later control doesn't contain an equivalent display region; instead it uses the object model to deliver closed captions to an HTML element specified by using the ClosedCaption.captioningID property. When using the compatibility layer, your code must emulate this behavior. To do this, handle the ScriptCommand event for script command type "CAPTION". The compatibility layer will provide the caption text in the sParam parameter, which you can then display using whatever HTML element you choose.

The Windows Media Player 10 SDK includes a sample Web page that demonstrates using the ClosedCaption object.

ShowGotoBar Property

The version 6.4 Go To bar displays a list of markers in the current digital media file. The 9 Series or later Player control does not have an equivalent feature. When using the compatibility layer, you can imitate the behavior of the Go To bar by using the MarkerCount property with the GetMarkerName and GetMarkerTime methods to create your own marker list.

The Windows Media Player 10 SDK includes a sample Web page that demonstrates using markers.

TransparentAtStart Property

You can use the 9 Series or later object model Player.uiMode property with a value of "invisible" to mimic this behavior. Your code should follow these basic steps:

  1. Position your background image on your Web page to be aligned with the Player control.
  2. Set the Player.uiMode property to "invisible".
  3. In script, handle the PlayStateChange event. In the event handler, test the playState property to determine the current state.
  4. When the play state equals 3 (playing), change the value for uiMode to the desired setting.

Unavailable Features

The following properties and methods of the version 6.4 Windows Media Player are not supported when using the compatibility layer and have no Windows Media Player 9 Series or later equivalents. You should not write code that uses the following properties:

  • AnimationAtStart
  • CanPreview
  • CodecCount
  • ConnectionSpeed
  • CursorType
  • DisplayBackColor
  • DisplayForeColor
  • PreviewMode
  • StreamCount
  • VideoBorder3D
  • VideoBorderColor
  • VideoBorderWidth

You should not write code that uses the following methods:

  • GetCodecDescription
  • GetCodecInstalled
  • GetCodecURL
  • GetStream
  • IsSoundCardEnabled
  • StreamSelect

Content and Playback Issues

You might encounter changes in behavior when your Web page or application attempts to play certain content while the compatibility layer is invoked. This section outlines some of these changes.

Codecs

If you experience behavior changes when playing certain files, be sure that the codec required to play the file is installed.

Some Microsoft DirectShow® rendering and source filters that were available by default in Windows Media® Player 6.4 are no longer provided when Windows Media Player 9 Series or later is installed. If your content doesn't play after installing the 9 Series or later Player, there are some steps you can take to enable the content to play. You can:

  • Create a custom source filter that uses the Windows Media Format SDK to decompress the content.
  • Create a DirectX® Media Object (DMO) for codecs.
  • Create a Windows Media Player rendering plug-in to render the content, or create a digital signal processing (DSP) plug-in to convert the content into a format that the Player supports.
  • Codecs and content that are no longer supported include the VivoActive H.723 and H.623 codecs and content created with VivoActive Producer. If your content was created with VivoActive Producer, you should re-create the content using Microsoft Producer for PowerPoint® 2002.

Video Mixing Renderer

Windows Media Player 9 Series or later uses the DirectShow video mixing renderer (VMR) by default. For this to work, the display driver on the user's computer must support the VMR. If it does not, the user might experience video playback problems or get no video at all. To remedy this, users should upgrade the display driver to the latest version. Alternatively, users can turn off video acceleration. To do so, click the Tools menu in Windows Media Player, click Options, then click the Performance tab, and move the Video acceleration slider to "None". Turning off the VMR in the Player might reduce playback performance and introduce problems with maintaining aspect ratios.

Executing Code in Script Commands

For security reasons, Windows Media Player 9 Series or later does not permit script code within URLs or URL type script commands (javascript:). If your application relies on executing code when a script command is received, you should not execute the code from a URL. Instead, create a custom script command type that executes script code in a Web page or a JScript® file.

General Web Site Issues

This section explains some general issues your Web site might encounter with the Windows Media® Player 9 Series or later control.

Using Undocumented Functionality

If your Web page relies on undocumented behavior or features of the version 6.4 control, you might need to change your code to work with the compatibility layer. Test your Web page to check for unexpected behavior.

Detection Code

If you have included code that determines the Windows Media Player version, you will need to update your code to handle the new version number. For example, the version number for Windows Media Player 10 (and the compatibility layer) takes the form "10.0.0.YYYY", where YYYY represents the build number.

The Windows Media Player 10 Software Development Kit (SDK) includes a sample that demonstrates how to determine the Windows Media Player version.

User-Agent String Identifier

The user-agent string identifier has changed for Windows Media Player 9 Series. If your Web page uses this value, you must update the code to support the new value. The new value is "Windows Media Player/9.0.0.2899(WMPDXM)".

HTML+TIME/SMIL

Using HTML+TIME/SMIL is not supported when Windows Media Player 9 Series or later is installed. SMIL/HTML+TIME Web pages that do not specify a Player control class ID explicitly are not affected.

Deploying Windows Media Player 9 Series or Later

This section discusses some of the things you should consider when migrating your content to use the latest Player versions.

Content Type

Content created using Windows Media® 9 Series or later works with Windows Media Player 7.0 or later. The Windows Media Audio 9 codec also works with Windows Media Player 6.4 for Mac and Windows Media Player 7 for Mac. The Windows Media Audio 9 Professional codec, which supports 5.1 surround sound, requires Windows Media Player 9 Series or later.

Supported Operating Systems

Windows Media Player 9 Series is supported by the following Microsoft operating systems:

  • Windows® 98 Second Edition
  • Windows Millennium Edition
  • Windows 2000
  • Windows XP

Windows Media Player 10 is supported by Microsoft® Windows XP only.

Windows Media Player Version

Because there are multiple versions of Windows Media Player in use, you might choose to continue supporting multiple versions. The Windows Media Player 10 Software Development Kit (SDK) includes a sample that demonstrates how to detect which Player (and Web browser) the user has and then provide a Web page tailored for that user. If you choose this approach, you can be sure to provide the best experience for every user while getting the benefits of migrating your content to the latest platform.

Supported Web Browsers

Windows Media Player 9 Series or later is supported by the following Web browsers:

  • Microsoft Internet Explorer 5.1 or later
  • Netscape Navigator 4.7, 6.2, and 7.0. Netscape Navigator versions 6.2 and 7.0 also require the Java 2 Runtime Engine (J2RE) version 1.3.x.

For More Information

To learn more about Windows Media® Player 10, see Windows Media Player 10 Help. Windows Media Player 10 can be downloaded from the Windows Media page.

To learn more about the Windows Media Player 9 Series or later ActiveX® control, see the Windows Media Player 10 SDK. The Windows Media Player 10 SDK can be downloaded from the Windows Media page.

Related documentation:

This software is based in part on the work of the Independent JPEG Group.

GIF decompression code, copyright 1990, David Koblas. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.