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.
Properties
Section titled “Properties”originEpochUs
Section titled “originEpochUs”readonly originEpochUs: number;Defined in: clock.ts:103
The pinned moment as microseconds since the Unix epoch.
originUs
Section titled “originUs”readonly originUs: number;Defined in: clock.ts:101
The pinned moment, on the source clock.
Methods
Section titled “Methods”fromSourceUs()
Section titled “fromSourceUs()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sourceUs |
number |
Returns
Section titled “Returns”number
now(): number;Defined in: clock.ts:105
The timeline now: Unix-epoch microseconds.
Returns
Section titled “Returns”number
sampleTimeline()
Section titled “sampleTimeline()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sampleRate |
number |
options? |
SampleTimelineOptions |
Returns
Section titled “Returns”sourceTimeline()
Section titled “sourceTimeline()”sourceTimeline(options?): SourceTimeline;Defined in: clock.ts:113
Map a clock with its own origin and rate, kept on the broadcast timeline by calibration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
SourceTimelineOptions |