v160 · webrtc · peer connection
Policy probe
The entire web-facing surface of this feature is one dictionary member: RTCConfiguration.rtpHeaderEncryptionPolicy, an RTCRtpHeaderEncryptionPolicy enum of "disable", "negotiate" (the default) or "require". This page constructs real RTCPeerConnections with each value, reads them back through getConfiguration(), and tries to change the policy afterwards — which the spec forbids.
Construct a peer connection
Try to change it later
The spec adds a step to set the configuration: “If the value of configuration.rtpHeaderEncryptionPolicy differs from oldConfig.rtpHeaderEncryptionPolicy, then fail” — an InvalidModificationError, exactly like bundlePolicy and rtcpMuxPolicy.
Enum vocabulary of this build
The enum changed during implementation: webrtc-extensions PR #256 added "disable". Builds that predate it reject "disable" with a TypeError. Every value is tried for real:
| value | constructor | getConfiguration() reflects |
|---|---|---|
| running… | ||
the probe, verbatim
const pc = new RTCPeerConnection();
"rtpHeaderEncryptionPolicy" in pc.getConfiguration()
// true → the member is implemented ([RuntimeEnabled=RtcRtpHeaderEncryptionPolicy])
// false → unknown dictionary key: the constructor silently IGNORES it,
// so new RTCPeerConnection({rtpHeaderEncryptionPolicy:"require"})
// not throwing proves nothing.
new RTCPeerConnection({ rtpHeaderEncryptionPolicy: "disable" })
// Chrome 153 + flag: TypeError (enum was "negotiate" | "require")
// current spec: OK, getConfiguration() → "disable"