IWMSPlaylist.ElapsedSimpleTime (C#)

banner art

Previous Next

IWMSPlaylist.ElapsedSimpleTime (C#)

The ElapsedSimpleTime property retrieves the simple duration of the active playlist element.

Syntax

  int =
  
  Playlist
  .ElapsedSimpleTime;

Property Value

int containing the duration.

If this property fails, it throws an exception.

Number Meaning
0x80070057 Indicates that no media element is active.

Remarks

This property is read-only. The simple duration is defined by the explicit begin and duration attributes, if any. If there is no explicit begin or duration defined, the simple duration is defined by the implicit duration of the element. The simple duration does not include the repetition of elements.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer          Server;
IWMSPlayers        Players;
IWMSPlayer         Player;
IWMSPlaylist       Playlist;

int               iValue;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlayers object.
    Players = Server.Players;

    // Retrieve information about each client connection.
    for (int i = 0; i < Players.Count; i++)
    {
        Player = Players[i];

        // Retrieve the playlist that was requested
        // by the client, if one exists.
        Playlist = Player.RequestedPlaylist;

        // Retrieve the elapsed time of the current
        // playlist entry.
        iValue = Playlist.ElapsedSimpleTime;
    }







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