Gets the total number of available live stream controls.
public int Count { get; } Public ReadOnly Property Count() As IntegerGet
public:property Int32 Count{Int32 get()}
An integer value indicating the total count of live stream controls.
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 ControlsLiveStreamControls Streams = _server.GetLiveStreamControls();strLiveStreams += string.Format("--- Live Stream Controls (count = {0}) ---\n\n", Streams.Count.ToString());// print the all live streams properties to a stringfor (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");elsestrLiveStreams += string.Format("Enable = \"false\".\n");if (stream.ActivateOnDemand)strLiveStreams += string.Format("ActivateOnDemand = \"true\".\n");elsestrLiveStreams += 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 stringMessageBox.Show(strLiveStreams, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);_result = true;}catch (Exception){_result = false;}}
Imports LeadtoolsImports Leadtools.MediaStreamingPublic _server As Server = NothingPublic _result As Boolean = FalsePublic Sub PrintLiveStreamControlsExample()TryDim strLiveStreams As String = ""' create an instance of the server object_server = New Leadtools.MediaStreaming.Server()' retrieve a copy of the Live Stream ControlsDim Streams As LiveStreamControls = _server.GetLiveStreamControls()strLiveStreams += String.Format("--- Live Stream Controls (count = {0}) ---" & vbLf & vbLf, Streams.Count.ToString())' print the all live streams properties to a stringFor nIndex As Integer = 0 To Streams.Count - 1Dim stream As LiveStreamControl = Streams(nIndex)strLiveStreams += String.Format("Live Stream Control[{0}]: Path = ""{1}""." & vbLf, nIndex.ToString(), stream.Path)Dim s As String = ""strLiveStreams += String.Format("Handle = ""0x{0:X8}""." & vbLf, stream.Handle)Select Case stream.StateCase LiveStreamState.Stoppeds = "Stopped"Exit SelectCase LiveStreamState.Activatings = "Activating"Exit SelectCase LiveStreamState.Actives = "Active"Exit SelectCase LiveStreamState.Inactives = "Inactive"Exit SelectCase LiveStreamState.[Error]s = "Error"Exit SelectEnd SelectstrLiveStreams += String.Format("State = ""{0}""." & vbLf, s)If stream.Enable ThenstrLiveStreams += String.Format("Enable = ""true""." & vbLf)ElsestrLiveStreams += String.Format("Enable = ""false""." & vbLf)End IfIf stream.ActivateOnDemand ThenstrLiveStreams += String.Format("ActivateOnDemand = ""true""." & vbLf)ElsestrLiveStreams += String.Format("ActivateOnDemand = ""false""." & vbLf)End IfstrLiveStreams += String.Format("IdleTime = ""{0}""." & vbLf, stream.IdleTime.ToString())strLiveStreams += String.Format("IdleTimeOut = ""{0}""." & vbLf, stream.IdleTimeOut.ToString())Select Case stream.VideoEncodingCase LiveStreamVideoEncoding.Nones = "None"Exit SelectCase LiveStreamVideoEncoding.H264_Sources = "Source"Exit SelectCase LiveStreamVideoEncoding.H264_Softwares = "Software"Exit SelectCase LiveStreamVideoEncoding.H264_QSVs = "QSV"Exit SelectCase LiveStreamVideoEncoding.H264_CUDAs = "CUDA"Exit SelectEnd SelectstrLiveStreams += String.Format("VideoEncoding = ""{0}""." & vbLf, s)Select Case stream.AudioEncodingCase LiveStreamAudioEncoding.Nones = "None"Exit SelectCase LiveStreamAudioEncoding.AAC_Sources = "Source"Exit SelectCase LiveStreamAudioEncoding.AAC_Softwares = "Software"Exit SelectEnd SelectstrLiveStreams += String.Format("AudioEncoding = ""{0}""." & vbLf, s)Next' display a message contains the Live Streams information stringMessageBox.Show(strLiveStreams, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information)_result = TrueCatch generatedExceptionName As Exception_result = FalseEnd TryEnd Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
