Copies the items of the collection to a LiveStreamControl array, starting at the specified array index.
public void CopyTo(
LiveStreamControl[] array,
int arrayIndex
)
array
The one-dimensional, zero-based array that is the destination of the items to be copied from the collection.
arrayIndex
The zero-based index in the destination array at which copying begins.
Exceptions
The following exceptions can be thrown:
Copies the items of the collection to a LiveStreamControl array, starting at the specified array index.
using Leadtools;
using Leadtools.MediaStreaming;
public Server _server = null;
public bool _result = false;
public void LiveStreamControlsCopyToExample()
{
try
{
// create an instance of the server object
_server = new Leadtools.MediaStreaming.Server();
string strPath = "Live/Stream1"; // live stream's path
LiveStreams Streams = _server.GetLiveStreams();
LiveStream stream = Streams.CreateLiveStream();
stream.Path = strPath;
stream.UseDeviceEncoding = false;
// select video device
stream.VideoDevices.Selection = 3;
// select audio device
stream.AudioDevices.Selection = 0;
Streams.AddLiveStream(stream);
_server.SetLiveStreams(Streams);
// retrieve a copy of the Live Stream Controls
LiveStreamControls StreamControls = _server.GetLiveStreamControls();
// allocate a new array for the copied Live Stream Controls
LiveStreamControl[] copiedStreams = new LiveStreamControl[Streams.Count];
// copy them
StreamControls.CopyTo(copiedStreams, 0);
// set the result to what we expect
_result = (copiedStreams.Length == StreamControls.Count);
}
catch (Exception)
{
_result = false;
}
}