Example 2: playing a camera video (no wait mode)

<< Click to display table of contents >>

Example 2: playing a camera video (no wait mode)

This example shows how to play a video from an IP camera in a "no wait" mode: operations are performed in background threads, without waiting. When an operation is finished, an event is called. This is a recommended mode, you can provide a visual feedback while waiting, and the user can interrupt a long operation.

Example

1. Place RVCamera1:TRVCamera and RVCamView1:TRVCamView on the form. Assign RVCamView.VideoSource = RVCamera1.

2. If you need a separate component for controlling the camera movement, place RVCamControl1: TRVCamControl on the form. Assign RVCamera1.CameraControl = RVCamControl.

3. Assign RVCamera1's properties: the camera address and the user name and password. For example:

CameraHost = 'novatron.dyndns.tv',

CameraPort = 8888

UserName= 'demo15'

UserPassword= 'demo15'

4. Assign RVCamera.CommandMode = rvsmNoWait.

5. Add in TForm1.FormCreate:

RVCamera1.SearchCamera;

6. Create the event handler for RVCamera1.OnSearchComplete event:

procedure Form1.RVCamera1SearchComplete(Sender: TObject;

  Status: Integer);

begin

  if Status = 0 then

    RVCamera1.PlayVideoStream;

end;