-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
154 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
defmodule ExWebRTC.ICETransport do | ||
# module implementing this behaviour | ||
@type t() :: module() | ||
|
||
@type state() :: any() | ||
|
||
@callback add_remote_candidate(state(), candidate :: String.t()) :: :ok | ||
@callback end_of_candidates(state()) :: :ok | ||
@callback gather_candidates(state()) :: :ok | ||
@callback get_local_credentials(state()) :: {:ok, ufrag :: binary(), pwd :: binary()} | ||
@callback restart(state()) :: :ok | ||
@callback send_data(state(), binary()) :: :ok | ||
@callback set_remote_credentials(state(), ufrag :: binary(), pwd :: binary()) :: :ok | ||
@callback start_link(ExICE.ICEAgent.role(), Keyword.t()) :: {:ok, state()} | ||
end | ||
|
||
defmodule ExWebRTC.DefaultICETransport do | ||
@behaviour ExWebRTC.ICETransport | ||
|
||
alias ExICE.ICEAgent | ||
|
||
@impl true | ||
defdelegate add_remote_candidate(state, candidate), to: ICEAgent | ||
@impl true | ||
defdelegate end_of_candidates(state), to: ICEAgent | ||
@impl true | ||
defdelegate gather_candidates(state), to: ICEAgent | ||
@impl true | ||
defdelegate get_local_credentials(state), to: ICEAgent | ||
@impl true | ||
defdelegate restart(state), to: ICEAgent | ||
@impl true | ||
defdelegate send_data(state, data), to: ICEAgent | ||
@impl true | ||
defdelegate set_remote_credentials(state, ufrag, pwd), to: ICEAgent | ||
@impl true | ||
defdelegate start_link(role, opts), to: ICEAgent | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.