IWMSPublishingPointTotalCounters.Advertisements (C#)

banner art

Previous Next

IWMSPublishingPointTotalCounters.Advertisements (C#)

The Advertisements property retrieves the cumulative number of advertisements that have been streamed from playlists since the last reset.

Syntax

  int =
  
  PublishingPointTotalCounters
  .Advertisements;

Property Value

int containing the cumulative number of advertisements that have been streamed.

Remarks

This property is read-only. When the server starts streaming from a playlist in which the role attribute has been set to "Advertisement," the counters should be updated. The value specified for the role attribute can be accessed through the presentation context WMS_PRESENT_PLAYLIST_ENTRY_ROLE property.

Example Code

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

// Declare variables.
WMSServer                            Server;
IWMSPublishingPoints                 PubPoints;
IWMSPublishingPoint                  PubPoint;
IWMSPublishingPointTotalCounters     TotalCounters;

int                                 iValue;

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

    // Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints;

    // Retrieve information about each publishing point.
    for (int i = 0; i < PubPoints.Count; i++)
    {
        PubPoint = PubPoints[i];

        // Retrieve a pointer to a list of total statistics
        // for the publishing point.
        TotalCounters = PubPoint.TotalCounters;

        // Retrieve the total number of advertisements
        // streamed since the start time.
        iValue = TotalCounters.Advertisements;
    }







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