rtc.LocalPeer Class
Represents the local user of the room
Constructor
rtc.LocalPeer
()
Item Index
Events
Methods
addDataChannel
-
[name='data'] -
[desc={ordered: true}]
Add data channel which will be negotiated with all remote peers
Parameters:
-
[name='data']String optionalName of the data channel
-
[desc={ordered: true}]Object optionalOptions passed to
RTCDataChannel.createDataChannel()
addStream
-
[name='stream'] -
stream
Add local stream to be sent to all remote peers
Parameters:
-
[name='stream']String optionalName of the stream
-
streamPromise -> rtc.Stream | rtc.Stream | ObjectThe stream, a promise to the stream or the configuration to create a stream with
rtc.Stream.createStream()
Returns:
Promise of the stream which was added
isLocal
()
Boolean
Checks whether the peer is the local peer. Returns always true on this
class.
Returns:
Returns true
status
-
key
Get an item of the status transferred to all remote peers
Parameters:
-
keyStringThe key of the value. Will return
Returns:
The value associated with the key
status
-
key -
value
Set an item of the status transferred to all remote peers
Parameters:
-
keyStringThe key of the value. Will return
-
valueObjectThe value to store
stream
-
[name='stream']
Get local stream
Parameters:
-
[name='stream']String optionalName of the stream
Returns:
Promise of the stream
Properties
channels
Object
Contains all DataChannel configurations negotiated with all remote peers
streams
Object
Contains promises of the local streams offered to all remote peers
Events
status_changed
-
status
Parameters:
-
statusObjectThe new status object
