Make Your Packaged Media Available to Customers
Now that the media is packaged, you'll need to make it available to your customers. The sample code contains a store called 'World of Sound' which I recommend installing under the Web application 'DRMStore' on your Web server (see Figure 4
|Figure 4: The 'World of Sound' Sample Store|
The sample uses free tracks to avoid the unnecessary complexity of introducing a payment model. If a user chooses to download a track, the file opens in the preferred player, which should be Media Player by default. When other players (such as WinAmp) are registered to handle Windows Media file types, and you have opted not to support DRM v.1 licensing, problems may arise. I recommend that you demand your customers use Media Player 7, because DRM version.1 has significant drawbacks and the techniques required to bypass its security are widely known. Another noteworthy point is that Windows 95 and NT 4.0 do not support DRM 7.1. It would appear this important share of the market will not be addressed; Microsoft prefers to have its users upgrade to a more multimedia friendly OS such as Windows XP.
When you open a secured track in Media Player 7, the player reads the license acquisition URL to attempt to license its secured content. The request executes an ASP page on the server that forwards the 'challenge' onto our DRMStore component:
' Create the License Object
Set oLicense = Server.CreateObject("DRMStore.License")
' Generate License / Pass the Challenge and Silent details on
sLicense = oLicense.IssueLicense(cStr(sChallenge), cBool(bSilent))
The most significant problem you'll encounter when creating a license programmatically is dealing with the WMRMRights object. The COM definition for any numeric property on the object demands the use of a DWORD, a non-compliant data type for COM. This makes it impossible to late-bind to the Rights object; Visual Basic will not compile and will throw an error (see Figure 5). The only workaround is to use CreateObject. In the example code, I have wrapped the Rights object to avoid some of the object's common pitfalls.
|Figure 5: Windows Media DRM Rights Object Invalid Interface|
WMRMResponse.ReplaceQuotesWith = "\"""
And on the client side, Media Player will detect the new license and allow the media playing operation to proceed:
GetLicenseObj.StoreLicense( '<%= sLicense %>' );
<embed mayscript type="application/x-drm-v2" hidden="true">
If you prefer to distribute silently, you don't have to format and store the license as shown above; however, to avoid a license pop-up window from appearing, you must not render any HTML into the license response (see Figure 6).
|Figure 6: A License Acquisition Pop-up in Windows Media Player|
When the media plays, you'll see the words "Protected Content" rotating on the status bar. (see Figure 7).
|Figure 7: Windows Media Player Playing DRM-secured Media|