Share via


IWMSActiveMedia.GetProperty (Visual Basic .NET)

banner art

Previous Next

IWMSActiveMedia.GetProperty (Visual Basic .NET)

The GetProperty method retrieves a specific property from the active media element.

Syntax

  String = IWMSActiveMedia.GetProperty(
  strProperty As String,
  strLanguage As String
)

Parameters

strProperty

[in] String containing the name of the property to retrieve. The properties are stored in a content description context. This parameter can be one of the following values, or a custom value that is defined in the clientData playlist element.

Value Description
title Retrieves the content title from the content file header, if available, or from the value specified by the title attribute in the clientData element of a playlist. The value specified in the clientData element, if present, overrides the header value.
album Retrieves the album name from the content file header, if available, or from the value specified by the value attribute in the clientData element of a playlist. The value specified in the clientData element, if present, overrides the header value.
artist Retrieves the artist name from the content file header, if available, or from the value specified by the artist attribute in the clientData element of a playlist. The value specified in the clientData element, if present, overrides the header value.
author Retrieves the author of the playlist or media file from the content file header, if available, or from the value specified by the author attribute in the clientData element of a playlist. The value specified in the clientData element, if present, overrides the header value.
bannerAbstract Retrieves the text to be displayed as a ToolTip for the Windows Media Player banner graphic identified by the bannerURL property. The text is retrieved from the content file header or from the bannerAbstract attribute of the clientData playlist element. The value specified in the clientData element, if present, overrides the header value.
bannerInfoURL Retrieves the URL of the Web page that a user can access by clicking the Windows Media Player banner graphic identified by the bannerURL property. The URL can be retrieved from the content file header or from the bannerInfoURL attribute of the clientData playlist element. The value specified in the clientData element, if present, overrides the header value.
bannerURL Retrieves the URL of a graphics file that is displayed in Windows Media Player. The URL is retrieved from the content file header or from the bannerURL attribute of the clientData playlist element. The value specified in the clientData element, if present, overrides the header value.
copyright Retrieves copyright information from the content file header, if available, or from the value specified by the copyright attribute in the clientData element of a playlist. The value specified in the clientData element, if present, overrides the header value.
genre Retrieves category information from the content file header, if available, or from the value specified by the genre attribute in the clientData element of a playlist. The value specified in the clientData element, if present, overrides the header value.
logURL Retrieves an URL that can be used to post logging statistics to a server. The URL is retrieved from the content file header or from the logURL attribute of the clientData playlist element. The value specified in the clientData element, if present, overrides the header value.
WMS_CONTENT_DESCRIPTION_DESCRIPTION Retrieves the content description from the content file header, if available.
WMS_CONTENT_DESCRIPTION_PLAYLIST_ENTRY_URL Retrieves the path to a content file. This is equivalent to the src attribute that can be specified in a playlist file.
WMS_CONTENT_DESCRIPTION_RATING Retrieves rating information from the file header, if available.
WMS_CONTENT_DESCRIPTION_ROLE Retrieves the role of a media element in a playlist. This value is specified by the role attribute.

strLanguage

[in] String containing the national language for the property. This must conform to RFC-1766.

Return Value

A String that contains the value associated with the property.

If this method fails, it returns an error number.

Number Description
0x8002000B strProperty does not exist.
0x8007000E There is insufficient memory to complete the function.
0xC00D145CL strLanguage is an invalid language tag or that no context description exists for the language specified.

Remarks

The values that can be specified for the national language are identical to the HTTP language tags.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetMediaProperty()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Players As IWMSPlayers
    Dim Player As IWMSPlayer
    Dim Playlist As IWMSPlaylist
    Dim ActiveMedia As IWMSActiveMedia
    Dim strProperty As String
    Dim strTitle As String
    Dim strLangID As String

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlayers object.
    Players = Server.Players

    ' If players are connected, retrieve first IWMSPlayer object
    ' in the IWMSPlayers collection.
    If Server.Players.Count > 0 Then
        Player = Server.Players.Item(0)
    End If

    ' Retrieve the IWMSPlaylist object for the player.
    ' NOTE: A valid playlist file is not always returned.
    ' This may be the case, for example, if the user requested
    ' a specific content file or if a broadcast
    ' publishing point is being used.
    Playlist = Player.RequestedPlaylist
    If Not Playlist Is Nothing Then

        ' Retrieve the IWMSActiveMedia object.
        ActiveMedia = Playlist.CurrentMediaInformation

        ' Retrieve a name-value pair from the active media element.
        ' NOTE: This is a generic name-value pair. Name-value pairs
        ' are user-defined.
        strTitle = "title"

        strProperty = ActiveMedia.GetProperty(strTitle, "")
    End If

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next