public interface PeerStream
Modifier and Type | Interface and Description |
---|---|
static interface |
PeerStream.Handler
PeerStream handler.
|
Modifier and Type | Method and Description |
---|---|
DataStream |
getDataChannel(String label)
Get a DataChannel of the current peer.
|
Map<String,DataStream> |
getDataChannels()
Get all DataChannel of the current peer.
|
String |
getId()
Get peer identifier of this stream
|
MediaStream |
getMedia()
Get the media stream, if any.
|
boolean |
hasMedia()
Test if peer stream contains a media stream
|
boolean |
isLocal()
Test if the peer stream is local or not.
|
DataStream |
openDataChannel(String label)
Open a DataChannel with the current peer.
|
void |
setHandler(PeerStream.Handler handler)
Set an handle for this peer stream
|
String getId()
// Usage
String peerId = peerStream.getId();
boolean isLocal()
// Usage
if ( peerStream.isLocal() == true ) { ... }
boolean hasMedia()
// Usage
if ( peerStream.hasMedia() == true ) { ... }
MediaStream getMedia()
// Usage
MediaStream mediaStream = peerStream.getMedia();
DataStream openDataChannel(String label)
// Usage
DataStream dataStream = peerStream.openDataChannel( "myLabel" );
label
- (String) Label of the DataChannelDataStream getDataChannel(String label)
// Usage
DataStream dataStream = peerStream.getDataChannel( "myLabel" );
label
- (String) Label of the DataChannelMap<String,DataStream> getDataChannels()
// Usage
Map<String, DataStream> channels = peerStream.getDataChannels();
void setHandler(PeerStream.Handler handler)
// Usage
peerStream.setHandler( handler );
handler
- peer stream handlerCopyright © 2015. All rights reserved.