←Select platform

Item Property

Summary

Gets the LiveStreamControl item at the specified index.

Syntax
C#
C++/CLI
public LiveStreamControl Item( 
   int index 
) { get; } 
public:  
   property LiveStreamControl^ default [Int32 ] 
   { 
      LiveStreamControl^ get(Int32 index) 
   } 

Parameters

index
The zero-based index of the item to get.

Property Value

The LiveStreamControl item at the specified index.

Example
C#
using Leadtools; 
using Leadtools.MediaStreaming; 
 
 
 
public Server _server = null; 
public bool _result = false; 
 
public void PrintLiveStreamControlsExample() 
{ 
   try 
   { 
      string strLiveStreams = ""; 
 
      // create an instance of the server object 
      _server = new Leadtools.MediaStreaming.Server(); 
 
      // retrieve a copy of the Live Stream Controls 
      LiveStreamControls Streams = _server.GetLiveStreamControls(); 
 
      strLiveStreams += string.Format("--- Live Stream Controls (count = {0}) ---\n\n", Streams.Count.ToString()); 
 
      // print the all live streams properties to a string 
 
      for (int nIndex = 0; nIndex < Streams.Count; nIndex++) 
      { 
         LiveStreamControl stream = Streams[nIndex]; 
 
         strLiveStreams += string.Format("Live Stream Control[{0}]: Path = \"{1}\".\n", nIndex.ToString(), stream.Path); 
 
         string s = ""; 
 
         strLiveStreams += string.Format("Handle = \"0x{0:X8}\".\n", stream.Handle); 
 
 
         switch (stream.State) 
         { 
            case LiveStreamState.Stopped: 
               s = "Stopped"; 
               break; 
            case LiveStreamState.Activating: 
               s = "Activating"; 
               break; 
            case LiveStreamState.Active: 
               s = "Active"; 
               break; 
            case LiveStreamState.Inactive: 
               s = "Inactive"; 
               break; 
            case LiveStreamState.Error: 
               s = "Error"; 
               break; 
         } 
         strLiveStreams += string.Format("State = \"{0}\".\n", s); 
 
         if (stream.Enable) 
            strLiveStreams += string.Format("Enable = \"true\".\n"); 
         else 
            strLiveStreams += string.Format("Enable = \"false\".\n"); 
 
         if (stream.ActivateOnDemand) 
            strLiveStreams += string.Format("ActivateOnDemand = \"true\".\n"); 
         else 
            strLiveStreams += string.Format("ActivateOnDemand = \"false\".\n"); 
 
         strLiveStreams += string.Format("IdleTime = \"{0}\".\n", stream.IdleTime.ToString()); 
 
         strLiveStreams += string.Format("IdleTimeOut = \"{0}\".\n", stream.IdleTimeOut.ToString()); 
 
         switch (stream.VideoEncoding) 
         { 
            case LiveStreamVideoEncoding.None: 
               s = "None"; 
               break; 
            case LiveStreamVideoEncoding.H264_Source: 
               s = "Source"; 
               break; 
            case LiveStreamVideoEncoding.H264_Software: 
               s = "Software"; 
               break; 
            case LiveStreamVideoEncoding.H264_QSV: 
               s = "QSV"; 
               break; 
            case LiveStreamVideoEncoding.H264_CUDA: 
               s = "CUDA"; 
               break; 
         } 
 
         strLiveStreams += string.Format("VideoEncoding = \"{0}\".\n", s); 
 
 
         switch (stream.AudioEncoding) 
         { 
            case LiveStreamAudioEncoding.None: 
               s = "None"; 
               break; 
            case LiveStreamAudioEncoding.AAC_Source: 
               s = "Source"; 
               break; 
            case LiveStreamAudioEncoding.AAC_Software: 
               s = "Software"; 
               break; 
         } 
 
         strLiveStreams += string.Format("AudioEncoding = \"{0}\".\n", s); 
 
      } 
 
      // display a message contains the Live Streams information string 
      MessageBox.Show(strLiveStreams, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information); 
 
      _result = true; 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.MediaStreaming Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.