Skip to content

BroadcastClock

Defined in: clock.ts:99

A publisher’s single clock: every track in the broadcast is stamped from it, in microseconds since the Unix epoch. One moment on a monotonic source is pinned to the system clock, and the timeline advances at the source’s rate.

readonly originEpochUs: number;

Defined in: clock.ts:103

The pinned moment as microseconds since the Unix epoch.


readonly originUs: number;

Defined in: clock.ts:101

The pinned moment, on the source clock.

fromSourceUs(sourceUs): number;

Defined in: clock.ts:111

Map a timestamp on this clock’s own source, such as performance.now() microseconds taken at capture, to the timeline: originEpochUs + sourceUs − originUs. For a capture clock with another origin, use BroadcastClock.sourceTimeline.

Parameter Type
sourceUs number

number


now(): number;

Defined in: clock.ts:105

The timeline now: Unix-epoch microseconds.

number


sampleTimeline(sampleRate, options?): SampleTimeline;

Defined in: clock.ts:118

Anchor a sample counter that starts at zero. The device clock that drives it drifts against the source, so re-anchor with a fresh timeline when the two disagree by more than a frame.

Parameter Type
sampleRate number
options? SampleTimelineOptions

SampleTimeline


sourceTimeline(options?): SourceTimeline;

Defined in: clock.ts:113

Map a clock with its own origin and rate, kept on the broadcast timeline by calibration.

Parameter Type
options? SourceTimelineOptions

SourceTimeline