janus_ws v0.1.1 Janus.WS View Source

Hex pm

For interacting with Janus WebRTC Gateway via WebSockets.

Link to this section Summary

Functions

To attach a plugin to a janus session

To create a janus session

To destroy a janus session

To detach a plugin from a janus session

To fetch info about the janus instance

To send a keepalive for a session

To send a message to a handle in a session

To send a trickle candidate for a session

Link to this section Types

Link to this type

handle_id() View Source
handle_id() :: integer()

Link to this type

send_result() View Source
send_result() ::
  {:ok, tx_id()}
  | {:error,
     %WebSockex.FrameEncodeError{
       __exception__: term(),
       close_code: term(),
       frame_payload: term(),
       frame_type: term(),
       reason: term()
     }
     | %WebSockex.ConnError{__exception__: term(), original: term()}
     | %WebSockex.NotConnectedError{
         __exception__: term(),
         connection_state: term()
       }
     | %WebSockex.InvalidFrameError{__exception__: term(), frame: term()}}

Link to this type

session_id() View Source
session_id() :: integer()

Link to this section Functions

Link to this function

attach(client, session_id, plugin) View Source
attach(client(), session_id(), String.t()) :: send_result()

To attach a plugin to a janus session

Link to this function

create_session(client, pid \\ self()) View Source
create_session(client(), pid()) :: send_result()

To create a janus session

Link to this function

destroy_session(client, session_id) View Source
destroy_session(client(), session_id()) :: send_result()

To destroy a janus session

Link to this function

detach(client, session_id, handle_id) View Source
detach(client(), session_id(), handle_id()) :: send_result()

To detach a plugin from a janus session

Link to this function

info(client, pid \\ self()) View Source
info(client(), pid()) :: send_result()

To fetch info about the janus instance

Link to this function

send_keepalive(client, session_id) View Source
send_keepalive(client(), session_id()) :: send_result()

To send a keepalive for a session

Link to this function

send_message(client, session_id, handle_id, data) View Source
send_message(client(), session_id(), handle_id(), map()) :: send_result()

To send a message to a handle in a session

Link to this function

send_trickle_candidate(client, session_id, handle_id, candidates) View Source
send_trickle_candidate(client(), session_id(), handle_id(), [map()]) ::
  send_result()
send_trickle_candidate(client(), session_id(), handle_id(), map()) ::
  send_result()

To send a trickle candidate for a session

Example:

Registry.start_link(keys: :duplicate, name: Janus.WS.Session.Registry)
Janus.WS.start_link(url: "ws://localhost:8188", registry: Janus.WS.Session.Registry)