Skip to content

Commit

Permalink
Make DataChannel support optional
Browse files Browse the repository at this point in the history
  • Loading branch information
LVala committed Aug 28, 2024
1 parent 8109856 commit 6a91bcd
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 323 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ def deps do
end
```

Elixir WebRTC comes with optional support for DataChannels, but it must be explicitely turned on by
adding optional `ex_sctp` dependency

```elixir
def deps do
[
{:ex_webrtc, "~> 0.4.1"},
{:ex_sctp, "~> 0.1.0"}
]
end
```

Please note that `ex_sctp` requires you to have Rust installed in order to compile.

## Getting started

To get started with Elixir WebRTC, check out:
Expand Down
2 changes: 1 addition & 1 deletion lib/ex_webrtc/peer_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ defmodule ExWebRTC.PeerConnection do
end

defp dc_negotiation_needed?(state) do
first_channel = map_size(state.sctp_transport.channels) == 1
first_channel = SCTPTransport.channel_count(state.sctp_transport) == 1

has_channels =
case state.current_local_desc do
Expand Down
Loading

0 comments on commit 6a91bcd

Please sign in to comment.