MediaTrackSettings: latency property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
TheMediaTrackSettings dictionary'slatency property is a double-precision floating-pointnumber indicating the estimated latency (specified in seconds) of theMediaStreamTrack as currently configured. This lets you determine whatvalue was selected to comply with your specified constraints for this property's valueas described in theMediaTrackConstraints.latency property you providedwhen calling eithergetUserMedia() orMediaStreamTrack.applyConstraints().
This is, of course, an approximation, since latency can vary for many reasons includingCPU, transmission, and storage overhead.
If needed, you can determine whether or not this constraint is supported by checkingthe value ofMediaTrackSupportedConstraints.latency as returned by a calltoMediaDevices.getSupportedConstraints(). However, typically this isunnecessary since browsers will ignore any constraints they're unfamiliar with.
BecauseRTP doesn't include this information, tracks associated with aWebRTCRTCPeerConnectionwill never include this property.
In this article
Value
A double-precision floating-point number indicating the estimated latency, in seconds,of the audio track as currently configured.
Examples
See theConstraint exerciser example.
Specifications
| Specification |
|---|
| Media Capture and Streams> # dom-mediatrackconstraintset-latency> |