Share via


Windows Media Player 11 SDK Library Access 

Windows Media Player SDK banner art

Previous Next

Library Access

Properties and methods of the Windows Media Player object model that access the library require either read-only or read/write access to the database. The library contains information that some users want to keep private and that should be accessed or altered only with their consent.

For Windows Media Player 9 Series or later, you can programmatically determine access level. To determine the current level of access granted to your code, retrieve the Settings**.mediaAccessRights** property. That property returns "none", "read", or "full" (read/write). To request specific access rights, call the Settings**.requestMediaAccessRights** method, passing a parameter that specifies the level you are requesting. The method displays a message to the user explaining the requested level of access, and returns a Boolean value indicating whether the access was granted.

Certain access rights are granted automatically depending on where your code is running relative to the user's computer.

  • If your Web page or program is located on the user's computer, full access rights are granted by default.

  • Web pages have read access to Player**.currentMedia**, Player**.currentPlaylist**, and Media**.sourceURL** when the Web page is located in an Internet Explorer security zone that is the same as or less restricted than the security zone of the media item or playlist.

    Ranging from least restricted to most restricted, the security zones are the Trusted zone (including the user's local computer), the Local intranet zone, the Internet zone, and the Restricted zone.

    For example, a Web page in the Local intranet zone has full access rights to Player**.currentMedia** when the corresponding media item is on the local intranet or the Internet, but access rights must be requested for media items located on a user's local computer or on a Web site in the Trusted zone.

You should test your Web-based or Windows-based application in all of the security zones it may encounter. The application should be designed to handle denial of an access request correctly.

Windows Media Player object model versions prior to Windows Media Player 9 Series do not include mediaAccessRights or requestMediaAccessRights. These earlier versions of Windows Media Player enable the user to set access levels using the Options dialog box.

See Also

Previous Next