Skip to content

Commit 8c94755

Browse files
committed
Update Modyfing the session guide
1 parent eee5f37 commit 8c94755

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

guides/advanced/modifying.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ to the previous tutorial on consuming media data.
168168
In a real scenario, you'd have to receive the RTP packet from the PeerConnection, inspect its payload type, find the codec associated with that payload type, find the payload type
169169
associated with that codec on the other PeerConnection, and use it to overwrite the original payload type in the packet.
170170
171-
Unfortunately, at the moment the `PeerConnection.send_rtp` API forces you to use the topmost negotiated codec, so there's no way to handle RTP streams with changing codecs.
172-
The only real solution is to force `PeerConnection` to negotiate only one codec.
171+
By default, `ExWebRTC.PeerConnection.send_rtp/4` will use the topmost negotiated codec, but you can change this behavior with
172+
`ExWebRTC.PeerConnection.set_sender_codec/3`.
173+
174+
Another option is to negotiate only one codec:
173175
174176
```elixir
175177
codec = %ExWebRTC.RTPCodecParameters{
@@ -180,8 +182,8 @@ codec = %ExWebRTC.RTPCodecParameters{
180182
{:ok, pc} = PeerConnection.start_link(video_codecs: [codec])
181183
```
182184
183-
This is not ideal as the remote PeerConnection might not support this particular codec. This tutorial will be appropriately updated once the `PeerConnection` API allows
184-
for more in this regard.
185+
And the last option is to perform server-side transcoding e.g. always negotiate both VP8 and H264 (in that preference), and if someone only supports H264, transcode their stream to VP8.
186+
185187

186188
> #### WebRTC internals {: .tip}
187189
> If you're developing using a Chromium-based browser, be sure to type out `chrome://webrtc-internals` in your address bar,

0 commit comments

Comments
 (0)