-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathcore.peerconnection.json
84 lines (76 loc) · 2.89 KB
/
core.peerconnection.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"name": "core.peerconnection",
"api": {
// Setup the link to the peer and options for this peer connection.
"setup": {
"type": "method",
"value": [
// The freedom.js channel identifier used to setup a signalling chanel.
"string",
// The peerName, used debugging and console messages.
"string",
// The list of STUN servers to use.
// The format of a single entry is stun:HOST:PORT, where HOST
// and PORT are a stun server hostname and port, respectively.
["array", "string"],
// Whether to immediately initiate a connection before fulfilling return
// promise.
"boolean"
]
},
// Send a message to the peer.
"send": {"type": "method", "value": [{
// Data channel id. If provided, will be used as the channel label.
// The behavior is undefined if the channel label doesn't exist.
"channelLabel": "string",
// One of the bellow should be defined; this is the data to send.
"text": "string",
"binary": "blob",
"buffer": "buffer"
}]},
// Called when we get a message from the peer.
"onReceived": {"type": "event", "value": {
// The label/id of the data channel.
"channelLabel": "string",
// One the below will be specified.
"text": "string",
"binary": "blob",
"buffer": "buffer"
}},
// Open the data channel with this label.
"openDataChannel": {"type": "method", "value": ["string"]},
// Close the data channel with this label.
"closeDataChannel": {"type": "method", "value": ["string"]},
// A channel with this id has been opened.
"onOpenDataChannel": {"type": "event", "value": {"channelId": "string"}},
// The channale with this id has been closed.
"onCloseDataChannel": {"type": "event", "value": {"channelId": "string"}},
// Returns the number of bytes that have queued using "send", but not
// yet sent out. Currently just exposes:
// http://www.w3.org/TR/webrtc/#widl-RTCDataChannel-bufferedAmount
"getBufferedAmount": {"type": "method",
"value": ["string"],
"ret": "number"},
// Returns local SDP headers from createOffer.
"getInfo": {"type": "method", "value": [], "ret": "string"},
"createOffer": {
"type": "method",
"value": [{
// Optional :RTCOfferOptions object.
"offerToReceiveVideo": "number",
"offerToReceiveAudio": "number",
"voiceActivityDetection": "boolean",
"iceRestart": "boolean"
}],
"ret": {
// Fulfills with a :RTCSessionDescription
"type": "string", // Should always be "offer".
"sdp": "string"
}
},
// Close the peer connection.
"close": {"type": "method", "value": []},
// The peer connection has been closed.
"onClose": {"type": "event", "value": {}}
}
}