CCTV


The CCTV widget plays a camera video stream on a dashboard page and supports both live monitoring and history playback. The video address can be entered directly, or retrieved per asset.

Difference from the Video widget: one CCTV widget plays a single stream, but it supports the HLS, FLV, WebRTC, and MP4 stream types, its address can be entered manually or queried by asset ID, and it can play back recordings for a given period. The Video widget plays several streams side by side in one widget, but its addresses can only come from a REST API data source and only the Hikvision format is supported.


For the common configuration of the Basic and Filter tabs, see Common Configurations for Charts.

Data of CCTV


The CCTV widget uses 1 measurement field, named streamUrl by default, which holds the video stream address. The widget uses neither dimension nor comparison fields.

For general information about data sources and data fields, see Common Configurations for Charts > Configuring Data.


Note

The value of the measurement field takes precedence over the address entered manually in Video service URL. The manual address is used only when the measurement field is unbound or returns no value.

Style of CCTV


The Style tab lists the items below in the order video source, playback area, and playback behavior.

Stream source


Stream source determines how the widget obtains the video stream. Stream URL by default:

  • Stream URL: Loads the video from the address in the measurement field or in Video service URL directly. This suits a fixed address, or a data source that provides the complete stream address.

  • Video service URL: Treats the address as the interface address of the EnOS video service. The widget sends a request to that interface with the asset ID and other parameters, then plays the address the interface returns, with EnOS handling authentication and address resolution.

Video type


Shown only when Stream source is Video service URL. Live monitoring by default:

  • Live monitoring: Plays the current live view of the camera.

  • History playback: Plays the recording for a given period, which additionally requires a start time and an end time.

Video service URL


Enter the video address. With Stream source set to Stream URL, enter the address of the video stream itself; with Video service URL, enter the interface address of the video service.

The address supports @{parameter_name} to reference a data source query parameter and ${parameter_name} to reference a page parameter. For more information, see Configuring Dynamic Parameters.

Asset ID


Shown only when Stream source is Video service URL. Enter the asset ID to query, which the widget appends to the request address of the video service as a parameter. Parameter placeholders are supported here too. For more information, see Configuring Dynamic Parameters.

Start time / End time


Shown only when Stream source is Video service URL and Video type is History playback. Enter the start and end of the recording segment. Parameter placeholders are supported, so the playback interval can be controlled dynamically by a global filter.

A time range filter may pass the start and end as a single comma-separated value. The widget splits it automatically: the start time takes the part to the left of the comma and the end time the part to the right, so you can bind that filter to Start time alone.

Enable UTC time


Shown only when Stream source is Video service URL and Video type is History playback. Cleared by default.

When selected, start and end times without time zone information are interpreted as UTC; when cleared, they are interpreted in the time zone of the browser. In both cases the value is converted to a millisecond timestamp before it is sent to the video service.

Stream type


Specifies the protocol of the video stream, which must match the format the video source actually provides. HLS by default:

  • HLS: HTTP-based segmented streaming with good compatibility, which suits most scenarios.

  • FLV: Lower latency, commonly used for live streaming.

  • WebRTC: The lowest latency, which suits scenarios with very high real-time requirements.

  • MP4: A standard video file format, which suits recording playback.

Poster


Enter the address of an image to show as a placeholder before the video finishes loading, which avoids a blank area while loading. Empty by default.

Aspect ratio


Controls the aspect ratio of the playback area. Options are 16:9 (default), 4:3, and Auto. With Auto selected, the playback area stretches freely with the widget container.

Fit


Determines how the picture fits the playback area. Contain by default:

  • Contain: Scales the picture keeping its original aspect ratio so that it is fully visible, with any spare space shown as black bars.

  • Cover: Scales the picture keeping its original aspect ratio until it fills the whole area, cropping the overflow.

Auto play


Selected by default. When selected, the video starts playing as soon as it finishes loading, without the end user selecting anything.

Muted by default


Selected by default. When selected, the video starts playing muted. Most browsers require muting before allowing autoplay, so keep it selected when Auto play is enabled.

Show toolbar


Selected by default, showing the control bar below the video (play/pause, volume, progress, and so on). When cleared, only the picture is shown.

Auto reconnect


Selected by default. When the video stream is interrupted, for example by network fluctuation, the widget tries to reconnect automatically, which reduces manual intervention.

Interactions at Runtime


The widget provides the following behaviors at runtime, with no configuration needed:

  • Address resolution: Parameter placeholders in the address are resolved before the request is issued. With Stream source set to Video service URL, the widget assembles the asset ID and (for history playback) the start and end times into query parameters, requests the video service, and plays the address it returns; whether it is a playback is determined by whether the request carries start and end times.

  • Playback control: Determined jointly by Auto play, Muted by default, Show toolbar, and Auto reconnect. At runtime, end users can operate the toolbar manually.


Note

The Basic tab of the CCTV widget provides neither Show Tooltip nor Export Widget Data, and the widget supports neither widget linkage nor style copying.