Skip to content

Commit

Permalink
Add RTCP handler in the echo example (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: Michał Śledź <[email protected]>
  • Loading branch information
themusicman and mickel8 authored Feb 21, 2024
1 parent 4e77274 commit 682c434
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/echo/lib/echo/peer_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ defmodule Echo.PeerHandler do
{:ok, state}
end

defp handle_webrtc_msg({:rtcp, _packets}, state) do
# do something with RTCP packets
{:ok, state}
end

defp handle_webrtc_msg({:rtp, id, packet}, %{in_audio_track_id: id} = state) do
PeerConnection.send_rtp(state.peer_connection, state.out_audio_track_id, packet)
{:ok, state}
Expand Down

0 comments on commit 682c434

Please sign in to comment.