Share via


IWMSPlaylist.CueStream (Visual Basic .NET)

banner art

Previous Next

IWMSPlaylist.CueStream (Visual Basic .NET)

The CueStream method prepares the next stream in the queue.

Syntax

  Playlist
  .CueStream(
  
  pPlaylistEntry
  
  As IXMLDOMElement
  
  )

Parameters

pPlaylistEntry

[in] IXMLDOMElement object containing a playlist element.

Return Values

If this method succeeds, it does not return a value. If this method it fails, it returns an error number.

Number Description
0xC00D14B4L pPlaylistEntry is already playing.
0xC00D14B7L pPlaylistEntry is not a media element.

Remarks

The IWMSPlaylist.IsStreamCued property can be used to determine whether the stream was successfully cued. The IsStreamCued property retrieves a Boolean value indicating whether a specific playlist element has been initialized and is ready to stream. This method is asynchronous, so an immediate call to get_IsStreamCued may return false even though CueStream returned S_OK. To be notified when the stream is actually cued, the application can catch the WMS_EVENT_PLAYLIST_CUE event.

Example Code

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

Private Sub GetNextStream()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Players As IWMSPlayers
    Dim Player As IWMSPlayer
    Dim Playlist As IWMSPlaylist
    Dim PlaylistEntry As MSXML.IXMLDOMElement
    Dim bVal As Boolean

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

    ' Retrieve the IWMSPlayers object.
    Players = Server.Players

    ' Retrieve information about each requested playlist.
    For Each Player In Players

        ' Retrieve the playlist requested by the client
        ' if one exists.
        Playlist = Player.RequestedPlaylist

        ' Retrieve information about the current playlist entry.
        PlaylistEntry = Playlist.CurrentPlaylistEntry

        ' Retrieve the next playlist entry.
        PlaylistEntry = Playlist.CallerEntry(PlaylistEntry)

        ' Retrieve information about each playlist entry.
        While Not PlaylistEntry Is Nothing

            ' Retrieve a Boolean value indicating whether this
            ' playlist entry is cued.
            bVal = Playlist.IsStreamCued(PlaylistEntry)

            ' Cue the playlist entry if it is not yet cued.
            If bVal = False Then
                Playlist.CueStream(PlaylistEntry)
            End If

            PlaylistEntry = Playlist.CallerEntry(PlaylistEntry)

        End While

    Next










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