Skip to content

Commit

Permalink
[WebRTC] webrtc/multi-video.html can potentially overflow payload types
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258979

Reviewed by Xabier Rodriguez-Calvar.

Restrict each transceiver to one codec (H.264) to prevent payload types from overflowing in SDP
offer.

* LayoutTests/webrtc/multi-video.html:

Canonical link: https://commits.webkit.org/265944@main
  • Loading branch information
philn committed Jul 11, 2023
1 parent ea9a3d0 commit dbbc3bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions LayoutTests/webrtc/multi-video.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
firstConnection.addTrack(track4, newStream);
firstConnection.addTrack(track5, newStream);
firstConnection.addTrack(track6, newStream);

// Restrict each transceiver to one codec (H.264) to prevent payload types from overflowing in SDP offer.
const codecs = RTCRtpSender.getCapabilities("video").codecs;
const h264Codec = codecs.filter(codec => { return codec.mimeType === "video/H264"; })[0];
firstConnection.getTransceivers().forEach((transceiver) => { transceiver.setCodecPreferences([h264Codec]); });
}, (secondConnection) => {
secondConnection.ontrack = (trackEvent) => {
resolve(trackEvent.streams[0]);
Expand Down

0 comments on commit dbbc3bc

Please sign in to comment.