diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-11 01:46:27 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-16 11:21:20 +0200 |
commit | 729b1e9941c0eeb0d51608c313ae2096ce13b2ba (patch) | |
tree | 8acc4290e784d0e0a662d7b5aa13f6a92a3c882d /modules/webrtc/doc_classes/WebRTCPeerConnection.xml | |
parent | eded8d52e3f11357451214ab4d957ed1f7a31b18 (diff) |
WebRTC refactor. Data channels, STUN/TURN support.
A big refactor to the WebRTC module. API is now considered quite stable.
Highlights:
- Renamed `WebRTCPeer` to `WebRTCPeerConnection`.
- `WebRTCPeerConnection` no longer act as `PacketPeer`, it only handle the connection itself (a bit like `TCP_Server`)
- Added new `WebRTCDataChannel` class which inherits from `PacketPeer` to handle data transfer.
- Add `WebRTCPeerConnection.initialize` method to create a new connection with the desired configuration provided as dictionary ([see MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#RTCConfiguration_dictionary)).
- Add `WebRTCPeerConnection.create_data_channel` method to create a data channel for the given connection. The connection must be in `STATE_NEW` as specified by the standard ([see MDN docs for options](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createDataChannel#RTCDataChannelInit_dictionary)).
- Add a `data_channel_received` signal to `WebRTCPeerConnection` for in-band (not negotiated) channels.
- Renamed `WebRTCPeerConnection` `offer_created` signal to `session_description_created`.
- Renamed `WebRTCPeerConnection` `new_ice_candidate` signal to `ice_candidate_created`
Diffstat (limited to 'modules/webrtc/doc_classes/WebRTCPeerConnection.xml')
-rw-r--r-- | modules/webrtc/doc_classes/WebRTCPeerConnection.xml | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml new file mode 100644 index 0000000000..8b14c60deb --- /dev/null +++ b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="WebRTCPeerConnection" inherits="Reference" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_ice_candidate"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="media" type="String"> + </argument> + <argument index="1" name="index" type="int"> + </argument> + <argument index="2" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="close"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="create_data_channel"> + <return type="WebRTCDataChannel"> + </return> + <argument index="0" name="label" type="String"> + </argument> + <argument index="1" name="options" type="Dictionary" default="{ + +}"> + </argument> + <description> + </description> + </method> + <method name="create_offer"> + <return type="int" enum="Error"> + </return> + <description> + </description> + </method> + <method name="get_connection_state" qualifiers="const"> + <return type="int" enum="WebRTCPeerConnection.ConnectionState"> + </return> + <description> + </description> + </method> + <method name="initialize"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="configuration" type="Dictionary" default="{ + +}"> + </argument> + <description> + </description> + </method> + <method name="poll"> + <return type="int" enum="Error"> + </return> + <description> + </description> + </method> + <method name="set_local_description"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="type" type="String"> + </argument> + <argument index="1" name="sdp" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_remote_description"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="type" type="String"> + </argument> + <argument index="1" name="sdp" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <signals> + <signal name="data_channel_received"> + <argument index="0" name="channel" type="Object"> + </argument> + <description> + </description> + </signal> + <signal name="ice_candidate_created"> + <argument index="0" name="media" type="String"> + </argument> + <argument index="1" name="index" type="int"> + </argument> + <argument index="2" name="name" type="String"> + </argument> + <description> + </description> + </signal> + <signal name="session_description_created"> + <argument index="0" name="type" type="String"> + </argument> + <argument index="1" name="sdp" type="String"> + </argument> + <description> + </description> + </signal> + </signals> + <constants> + <constant name="STATE_NEW" value="0" enum="ConnectionState"> + </constant> + <constant name="STATE_CONNECTING" value="1" enum="ConnectionState"> + </constant> + <constant name="STATE_CONNECTED" value="2" enum="ConnectionState"> + </constant> + <constant name="STATE_DISCONNECTED" value="3" enum="ConnectionState"> + </constant> + <constant name="STATE_FAILED" value="4" enum="ConnectionState"> + </constant> + <constant name="STATE_CLOSED" value="5" enum="ConnectionState"> + </constant> + </constants> +</class> |