Media
Extends:
Media Stream Manager If using Video/audio stream for all users: use the broadcast primitive (Data Channel) If using Video/audio stream for only one user, use the unicast primitive (Streaming) But pay attention that using unicast method, when a shuffling occur the connection might diseapear. For this usage, create an overlay network with only this peer connected to you. Or shut down the shuffle mechanism but this is not recommended.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
NI: * |
|
public |
NO: * |
|
public |
i: * |
|
public |
o: * |
|
public |
options: {"chunkSize": *} |
|
public get |
pid: * |
Private Members | ||
private |
_activeMedia: * |
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
Chunk a string into n message of size 'chunkSize' |
|
public |
getStreamMedia(id: *, elem: *): * |
|
public |
sendBroadcastOverDataChannel(media: Object, options: Object): boolean Send a MediaStream using our broadcast primitives using Data Channel. |
|
public |
sendUnicast(id: Object, media: Object): boolean Send a message to only one neighbor... |
Private Methods | ||
private |
Handler executed when a message is recevied |
|
private |
_reconstruct(stream: *, options: undefined) |
|
private |
_setListeners(media: *) |
Public Constructors
public constructor() source
Public Members
public NI: * source
public NO: * source
public i: * source
public o: * source
public options: {"chunkSize": *} source
public get pid: * source
Private Members
private _activeMedia: * source
private _activeStream: * source
private _communication: * source
Public Methods
public chunkify(string: string, chunkSize: Number=this.options.chunkSize): * source
Chunk a string into n message of size 'chunkSize'
Params:
Name | Type | Attribute | Description |
string | string | ||
chunkSize | Number=this.options.chunkSize |
Return:
* |
public getStreamMedia(id: *, elem: *): * source
Params:
Name | Type | Attribute | Description |
id | * | ||
elem | * |
Return:
* |
public sendBroadcastOverDataChannel(media: Object, options: Object): boolean source
Send a MediaStream using our broadcast primitives using Data Channel.
public sendUnicast(id: Object, media: Object): boolean source
Send a message to only one neighbor...
Private Methods
private _receive(id: string, stream: Object): void source
Handler executed when a message is recevied
Return:
void |
private _reconstruct(stream: *, options: undefined) source
Params:
Name | Type | Attribute | Description |
stream | * | ||
options | undefined |
|
private _setListeners(media: *) source
Params:
Name | Type | Attribute | Description |
media | * |