Share via


Windows Media Player 11 SDK Type 2 Online Store Plug-inĀ 

Windows Media Player SDK banner art

Previous Next

Type 2 Online Store Plug-in

You can create a COM component that implements the IWMPSubscriptionService and IWMPSubscriptionService2 interfaces, and then install and register the component on the user's computer. Windows Media Player 10 or later creates an instance of the object and calls the methods when required. Windows Media Player uses the object in the following scenarios:

  • The user attempts to copy online store content for which a license to copy does not exist. This includes writing content to a CD or copying it to a device. In this case, Windows Media Player inspects the ContentDistributor attribute in either the file header or the DRM header. If a value exists that matches the key name of an online store, Windows Media Player checks the registry for the corresponding COM component. If the component exists, Windows Media Player invokes the component and calls IWMPSubscriptionService::allowCDBurn or IWMPSubscriptionService::allowPDATransfer, passing a pointer to a playlist as a parameter. The playlist contains the digital media objects that the user is attempting to copy. The COM object implements the two methods to apply whatever business rules the online store requires, and deletes any items from the playlist that are not allowed.

    If the object returns a valid playlist and also sets the flag parameter to TRUE, then the copy (or transfer) proceeds. If the object sets the flag to FALSE, then Windows Media Player will not copy the content.

  • The user attempts to play online store content. When this happens, Windows Media Player locates the COM component using the same mechanism outlined previously. If the component exists, Windows Media Player calls IWMPSubscriptionService::allowPlay, passing a pointer to the digital media item the user is attempting to play. The online store can use this as an opportunity to update the user's license to play the content or to disallow playback of licensed content. If the flag parameter is set to TRUE before returning from allowPlay, then Windows Media Player attempts to play the content. Playback will still fail if a valid license does not exist; this process does not circumvent digital rights management (DRM).

  • The user clicks a button to activate an online store in Windows Media Player. When this occurs, Windows Media Player calls IWMPSubscriptionService2::serviceEvent. Windows Media Player also calls this method when the user switches to another service.

    During idle time, Windows Media Player calls IWMPSubscriptionService::startBackgroundProcessing. The online store can use this method to initiate any background processing tasks it requires, such as renewing expired licenses or compiling play-count data. When Windows Media Player requires the online store component to become idle, it calls IWMPSubscriptionService2::stopBackgroundProcessing.

  • Windows Media Player synchronizes premium content with a device. Before this happens, Windows Media Player calls IWMPSubscriptionService2::prepareForSync to alert the online store that premium content with a matching ContentDistributor attribute value is being synchronized. Windows Media Player provides a callback method, IWMPSubscriptionServiceCallback::onComplete, which the service can use to disallow synchronization, if desired.

  • A device becomes available for background processing. When a device is connected, Windows Media Player alerts the online store that the device is available and idle by calling IWMPSubscriptionService2::deviceAvailable.

Windows Media Player releases the online store component when the Player session ends. Upon release, the component must interrupt any background processing in progress and then shut down.

See Also

Previous Next