mediaTrackProperties
function mediaTrackProperties(kind, options?): PublishProperty[];Defined in: relay-sdks/ts/src/media-track-properties.ts:59
The track properties that give a media track its default delivery timeout and publisher priority (spec/behavior.md,
“Media publishing”), so a stall costs stale frames rather than lasting latency. Pass them to registerTrack with the track’s format
properties, such as @caprid/moq-media’s locTrackProperties():
const video = publisher.registerTrack({ track: 'video', trackProperties: [...locTrackProperties(), ...mediaTrackProperties('video', { keyframeIntervalUs: 1_000_000 })],});The result is a SUBGROUP_DELIVERY_TIMEOUT (0x06) in whole milliseconds, rounded up: 500 ms for audio, and for video the target latency less the keyframe interval, but never less than the interval. Then a Default Publisher Priority (0x0E) that puts audio ahead of video: 16 for audio, 96 for video. moq-relay 0.17 passes it on to viewers in SUBSCRIBE_OK but orders delivery by subscriber priority alone, so on that relay it changes nothing yet. No object timeout is set: through a frame writer it would never fire, because a group’s wait for settling room is not counted and, once its stream is open, a browser’s transport takes each object at once even during a stall.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
kind |
MediaKind |
options? |
MediaTrackPropertiesOptions |