Class DataCue
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalDataCue interface represents a cue that associates arbitrary timed data with an audio or video media resource, or exposes timed data from a media resource to web pages. It extends the TextTrackCue interface with a Value property that can hold any data type, and a Type property that identifies the kind of data.
[Value("DataCue")]
public class DataCue : TextTrackCue
- Inheritance
-
DataCue
- Inherited Members
Remarks
Unlike VTTCue, which is designed for displaying subtitle and caption text, DataCue is intended for non-rendered timed metadata. Use cases include dynamic content replacement, ad insertion, presentation of supplemental content alongside audio or video, or more generally, triggering application logic at specific points on the media timeline.
Some user agents may also automatically generate DataCue objects for in-band timed metadata carried within media streams, such as ID3 tags in HTTP Live Streaming (HLS).
-TextTrackCue
-VTTCue
-TextTrack
-TextTrackCueenter event
-TextTrackCueexit event
Constructors
DataCue()
public DataCue()
DataCue(Number, double, dynamic, string)
NOTE
ExperimentalDataCue() constructor creates and returns a new DataCue object that represents a timed metadata cue over a given time range. The resulting cue can be added to a metadata TextTrack using AddCue(TextTrackCue), allowing arbitrary data to be synchronized with audio or video playback.
public DataCue(Number startTime, double endTime, dynamic value, string type = null)
Parameters
Remarks
-DataCue
-TextTrack
-AddCue(TextTrackCue)
-TextTrackCueenter event
-TextTrackCueexit event
Properties
Type
NOTE
Experimentaltype read-only property of the DataCue interface returns a string identifying the type or schema of the data stored in the cue's Value property. This is typically a reverse-domain notation string (e.g., "org.id3", "com.apple.itunes") that allows applications to interpret the cue's data payload correctly.
[Value("type")]
public string Type { get; }
Property Value
- string
A string. Common values set by user agents for in-band metadata include:Application-defined cues may use any string, but reverse-domain notation is recommended to avoid collisions.
Remarks
When a user agent automatically generates DataCue objects for in-band timed metadata (for example, from an HTTP Live Streaming source), it sets this property to indicate the metadata format. When application code creates a DataCue using the DataCue(Number, double, dynamic, string) constructor, the type is set from the optional fourth argument and defaults to an empty string if omitted.
-DataCue
-Value
-DataCue(Number, double, dynamic, string) constructor
-TextTrackCue
Value
NOTE
Experimentalvalue property of the DataCue interface represents the data payload of the cue. Unlike VTTCue, which carries text content, DataCue can hold any data type — such as a JavaScript object, a string, or an ArrayBuffer — making it suitable for timed metadata use cases where structured data needs to be synchronized with media playback.
[Value("value")]
public dynamic Value { get; set; }
Property Value
- dynamic
Any type. The value is typically a string, a plain object, or an ArrayBuffer, depending on the source of the cue and the kind of timed metadata it represents.
Remarks
The property is read-write for application-created cues, allowing the data to be updated after construction. For cues generated automatically by the user agent from in-band timed metadata (e.g., ID3 tags in an HTTP Live Streaming source), the value is set by the user agent and reflects the metadata payload.
The Type property can be used alongside value to identify the format or schema of the data.
-DataCue
-Type
-DataCue(Number, double, dynamic, string) constructor
-TextTrackCue