Share via


Windows Media Player 11 SDK Detecting the Player 

Windows Media Player SDK banner art

Previous Next

Detecting the Player

When creating a Web page for your online store, you may decide that you want users to be able to view the page in a Web browser or in Windows Media Player. You can use an ASP script to determine whether your Web page is hosted in the Player.

The following example code retrieves the version parameter from the URL query string to determine whether the page is hosted in Windows Media Player:

<%
    Dim sVersion

    sVersion = Trim(Request.QueryString("version")) 
 
    If sVersion = "" Then   
        Response.Write "Not hosted in Windows Media Player"
    Else 
        Response.Write "Hosted in Windows Media Player<BR>"
        Response.Write "Version is " & sVersion
    End If
%>

Note that the preceding code assumes that the version parameter exists in the query string when hosted in Windows Media Player. This is true for pages opened by the user, but may not be true for pages opened by using External.NavigateTaskPaneURL. For the version query string to exist when navigating programmatically, you must add the version parameter to the method call or dynamically append the version to the base URL of the Navigate element of your ServiceInfo document.

See Also

Previous Next