TODO(henbos): Fill in.

This is an unofficial proposal.

Introduction

TODO(henbos): Fill in.

RTCRtpReceiver extensions

Let RTCRtpReceiver objects have a [[\PlayoutDelayHint]] internal slot initially initialized to null.

partial interface RTCRtpReceiver {
  attribute double? playoutDelayHint;
};

Attributes

playoutDelayHint of type double, nullable

This attribute allows the application to give a hint to the User Agent about what playout delay is acceptable. The User Agent SHOULD NOT playout audio or video that is received unless this amount of time has passed in seconds, allowing the User Agent to perform more or less buffering than it might otherwise do. This allows to influence the tradeoffs between having a higher delay and the risk that buffers such as the jitter buffer will run out of audio or video frames to play due to network jitter. This API only serves to provide a hint, and the User Agent may ignore it. The hint SHOULD NOT be followed if it significantly impacts audio or video quality (e.g. bad network), or if the value implies allocating larger buffers than the User Agent is willing to provide.

The playout delay hint applies even if DTX is used. For example, if DTX is used and packets start flowing after silence, the hint can influence the User Agent to buffer these packets rather than playing them out.

On getting, this attribute MUST return the value of the [[\PlayoutDelayHint]] internal slot.

On setting, the User Agent MUST run the following steps:

  1. Let receiver be the RTCRtpReceiver object on which the setter is invoked.

  2. Let delay be the argument to the setter.

  3. If delay is negative, throw a TypeError and abort these steps.

  4. Set the value of receiver's [[\PlayoutDelayHint]] internal slot to delay.

  5. In parallel, begin executing the following steps:

    1. Update the underlying system about the new delay hint, or that there is no hint if delay is null. If at any point in time this value is larger than the User Agent is able or willing to provide, the User Agent SHOULD use the maximum value available to match the requested delay as close as possible. If at any point in time this value is smaller than the User Agent determines is needed in order provide sufficient audio or video quality, the User Agent SHOULD use the smallest value possible.

      If User Agent ignores the hint at any time, this is not reflected in the [[\PlayoutDelayHint]] internal slot.