You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,7 +60,7 @@ webrtc.on('readyToCall', function () {
60
60
61
61
`peerConnectionConfig` - Set this to specify your own STUN and TURN servers. By default, SimpleWebRTC uses Google's public STUN server (`stun.l.google.com:19302`), which is intended for public use according to: https://twitter.com/HenrikJoreteg/status/354105684591251456
62
62
63
-
Note that you will most likely also need to run your own TURN servers. See http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ for a basic tutorial.
63
+
Note that you will most likely also need to run your own TURN servers. See http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ for a basic tutorial.
64
64
65
65
## Filetransfer
66
66
Sending files between individual participants is supported. See http://simplewebrtc.com/filetransfer.html for a demo.
@@ -73,7 +73,7 @@ Sometimes you need to do more advanced stuff. See http://simplewebrtc.com/notsos
-`object options` - options object provided to constructor consisting of:
91
+
-`string url` - *required* url for signaling server. Defaults to signaling server URL which can be used for development. You must use your own signaling server for production.
92
+
-`object sockio` - *optional* object to be passed as options to the signaling server connection.
93
+
-`Connection connection` - *optional* connection object for signaling. See `Connection` below. Defaults to a new SocketIoConnection
94
+
-`bool debug` - *optional* flag to set the instance to debug mode
95
+
-`[string|DomElement] locaVidelEl` - ID or Element to contain the local video element
96
+
-`[string|DomElement] remoteVideosEl` - ID or Element to contain the
97
+
remote video elements
98
+
-`bool autoRequestMedia` - *optional(=false)* option to automatically request user media. Use `true` to request automatically, or `false` to request media later with `startLocalVideo`
99
+
-`bool enableDataChannels`*optional(=true)* option to enable/disable data channels (used for volume levels or direct messaging)
100
+
-`bool autoRemoveVideos` - *optional(=true)* option to automatically remove video elements when streams are stopped.
101
+
-`bool adjustPeerVolume` - *optional(=false)* option to reduce peer volume when the local participant is speaking
102
+
-`number peerVolumeWhenSpeaking` - *optional(=.0.25)* value used in
103
+
conjunction with `adjustPeerVolume`. Uses values between 0 and 1.
104
+
-`object media` - media options to be passed to `getUserMedia`. Defaults to `{ video: true, audio: true }`. Valid configurations described [on MDN](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) with official spec [at w3c](http://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia).
-`object localVideo` - *optional* options for attaching the local video stream to the page. Defaults to
107
+
```javascript
108
+
{
109
+
autoplay:true, // automatically play the video stream on the page
110
+
mirror:true, // flip the local video to mirror mode (for UX)
111
+
muted:true// mute local video stream to prevent echo
112
+
}
113
+
```
114
+
-`object logger` - *optional* alternate logger for the instance; any object that implements `log`, `warn`, and `error` methods.
115
+
116
+
### Fields
117
+
118
+
`capabilities` - the [`webrtcSupport`](https://github.com/HenrikJoreteg/webrtcsupport) object that describes browser capabilities, for convenience
119
+
120
+
`config` - the configuration options extended from options passed to the constructor
121
+
122
+
`connection` - the socket (or alternate) signaling connection
123
+
124
+
`webrtc` - the underlying WebRTC session manager
125
+
126
+
### Events
127
+
128
+
`'connectionReady', sessionId`
129
+
130
+
`'createdPeer', peer`
131
+
132
+
`'stunservers', stunServers`
133
+
134
+
`'turnservers', turnservers`
135
+
136
+
`'localScreenAdded', el`
137
+
138
+
### Methods
139
+
140
+
`leaveRoom()`
141
+
142
+
`disconnect()`
143
+
144
+
`handlePeerStreamAdded(peer)`
145
+
146
+
`handlePeerStreamRemoved(peer)`
147
+
148
+
`getDomId(peer)`
149
+
150
+
`setVolumeForAll(volume)`
151
+
152
+
`joinRoom(name, callback)`
153
+
154
+
`getEl(idOrEl)`
155
+
156
+
`startLocalVideo()`
157
+
158
+
`stopLocalVideo()`
159
+
160
+
`getLocalVideoContainer()`
161
+
162
+
`getRemoteVideoContainer()`
163
+
164
+
`shareScreen(callback)`
165
+
166
+
`getLocalScreen()`
167
+
168
+
`stopScreenShare()`
169
+
170
+
`testReadiness()`
171
+
172
+
`createRoom(name, callback)`
173
+
174
+
`sendFile()`
175
+
176
+
### Connection
177
+
178
+
By default, SimpleWebRTC uses a Socket.io connection to communicate with the signaling server. However, you can provide an alternate connection object to use. All that your alternate connection need provide are four methods:
179
+
180
+
-`on(ev, fn)` - A method to invoke `fn` when event `ev` is triggered
181
+
-`emit()` - A method to send/emit arbitrary arguments on the connection
182
+
-`getSessionId()` - A method to get a unique session Id for the connection
183
+
-`disconnect()` - A method to disconnect the connection
0 commit comments