EnxStream


A Stream carries a different type of media. Audio, Video and/or Data. This stream gets transferred towards remote endpoints through Enablex Media Servers where it’s played and interacted with.

There are essentially 2 types of streams, viz.

  1. Local Stream: A Stream which a Client End Point initiates and transfers over the network.
  2. Remote Stream: A Stream which a Client End Point receives from others over the network.
Prop Type Required Description
eventHandlers Object No Event handlers responsible to get all event call back for room instance.

Methods for EnxStream class:

Methods Name Descriptions
initStream: To init Stream instance
sendData: To send data over stream.
switchCamera(streamId) To switch camera during the session.
muteSelfAudio:(streamId,value) To mute/unmute published stream audio.
muteSelfVideo:(streamId,value) To stop/start published stream video.
hardMuteAudio(streamId,clientId) To mute remote stream audio. Only for moderator use.
hardUnmuteAudio(streamId,clientId) To unmute remote stream audio. Only for moderator use.
hardMuteVideo(streamId,clientId) To mute remote stream video. Only for moderator use.
hardUnmuteVideo(streamId,clientId) To unmute remote stream video. Only for moderator use.

Callback for EnxStream class:

Callbacks Descriptions
audioEvents: This callback called on perform audio actions on the streams.
remoteStreamAudioMute: All Participants receives If the remote user mute own audio.
remoteStreamAudioUnMute: All Participants receives If the remote user unmute own audio..
videoEvents: This callback called on perform video actions on the streams.
remoteStreamVideoMute: All Participants receives If the remote user mute own video.
remoteStreamVideoUnMute: All Participants receives If the remote user unmute own video.
receiveData: This callback called when receive data on the streams.
hardMutedAudio: On Success of single user mute by moderator. This delegate method is for moderator.
hardUnmutedAudio: On Success of single user unmute by moderator. This delegate method is for moderator.
receivedHardMuteAudio: On Success of single user mute by moderator. This delegate method is for participant.
receiveHardUnmuteAudio: On Success of single user unmute by moderator This delegate method is for participant.
hardMutedVideo: This callback called when a hard mute video alert moderator received from server. This delegate is for moderator.
hardUnmutedVideo: This callback called when a hard unmute video alert moderator received from server. This delegate is for moderator.
receivedHardMuteVideo: This callback called when a hard mute video alert participant received from server.
receivedHardUnmuteVideo: This callback called when a hard unmute video alert participant received from server.



Initialized Stream:-

This method will help to initialized stream, which a client end point initiates and transfers over the network.

Enx.initStream(streamId);
Prop Type Required Description
streamId String Yes This streamId need to segregate each stream to know which stream Initialized.


Send Chat Message:-

This method will help to send chat message in room

Enx.sendData(message);

Where message is

{ message : 'hi', from : 'name', timestamp : 125253 }


CallBack To Receive Data

This callback method will invoke when room receives data at stream level

receiveData:event =>{ },

Where event is

{ id: 45442563, msg: { message: 'Hello', from: 'Shashank', type: 'public', timestamp: 1536319344844 } }


Switch Camera:-

This method will help to switch the camera in room

Enx.switchCamera(streamId);
Prop Type Required Description
streamId String Yes This streamId need to segregate each stream to know which stream Initialized.


Mute Self Audio:-

This Method will help to mute/unmute of a particular Stream Audio

Enx.muteSelfAudio(streamId , true/false);
Prop Type Required Description
streamId String Yes Here streamId will help to know which stream going to mute/unmute Audio
true/false Bool Yes Here True for mute Audio and False for unmute Audio


CallBack

audioEvents:event =>{ },

Where event is

{ msg:'message', result:0 }

CallBack : Receive all other users when audio is muted

remoteStreamAudioMute:event =>{ },

Where event is

{ result:0, clientId:0086645a-463b-4c72-ba1a-0b3c808b97c0, msg:'user muted audio' }

CallBack : Receive all other users when audio is unmuted

remoteStreamAudioUnMute:event =>{ },

Where event is

{ result:0, clientId:0086645a-463b-4c72-ba1a-0b3c808b97c0, msg:'user unmuted audio' }


Mute Self Video:-

This Method will help to mute/unmute of a particular Stream Video

Enx.muteSelfVideo(streamId , true/false);
Prop Type Required Description
streamId String Yes Here streamId will help to know which stream going to mute/unmute Video
true/false Bool Yes Here True for off Video and False for on Video



CallBack

videoEvents:event =>{ },

Where event is

{ msg:'message', result:0 }


CallBack: Receive all other users when video is muted

remoteStreamVideoMute:event =>{ },

Where event is

{ result:0, clientId:0086645a-463b-4c72-ba1a-0b3c808b97c0, msg:'user muted video' }


CallBack: Receive all other users when video is unmuted

remoteStreamVideoUnMute:event =>{ },

Where event is

{ result:0, clientId:0086645a-463b-4c72-ba1a-0b3c808b97c0, msg:'user unmuted video' }


Hard Mute Particular Stream Audio:-

This method will help to mediator to mute a particular stream Audio

Enx.hardMuteAudio(streamId,clientId);
Prop Type Required Description
streamId String Yes Here streamId will help to know which stream has try to mute Audio
clientId String Yes Here clientId will help to know which stream will mute.



Moderator CallBack

There would be listener for participant and moderator when hardmute audio used by moderator. For this callbacks are:

hardMutedAudio:event =>{ },

Where event is

{ result : 0 }


Participant CallBack

Participant Callback for hardmute audio done by Moderator.

receivedHardMuteAudio:event = >{ },

Where event is

{ result:0, clientId:0a39350b-fba9-4f43-9559-673d2e43eb48, msg:'user audio hard muted' }


Hard UnMute Particular Stream Audio:-

This method will help to mediator to Unmute a particular stream Video

Enx.hardUnmuteAudio(streamId,clientId);
Prop Type Required Description
streamId String Yes Here streamId will help to know which stream has try to unmute Video
clientId String Yes Here clientId will help to know which stream will unmute.



Moderator CallBack

There would be listener for participant and moderator when hardunmute audio used by moderator. For this callbacks are:

hardUnmutedAudio:event =>{ },

Where event is

{ result : 0 }


Participant CallBack

Participant Callback for hardmute audio done by Moderator.

receiveHardUnmuteAudio:event =>{ },

Where event is

{ result:0, clientId:0a39350b-fba9-4f43-9559-673d2e43eb48, msg:'user audio hard unmuted' }


Hard Mute Particular Stream Video:-

This method will help to mediator to mute a particular stream Video

Enx.hardMuteVideo(streamId,clientId);
Prop Type Required Description
streamId String Yes Here streamId will help to know which stream has try to mute Video
clientId String Yes Here clientId will help to know which stream will mute.



Moderator CallBack

There would be listener for participant and moderator when hardmute video used by moderator. For this callbacks are:

hardMutedVideo:event =>{ },

Where event is

{ result : 0 }


Participant CallBack

Participant Callback for hardmute video done by mediator

receivedHardMuteVideo:event = >{ },

Where event is

{ result:0, clientId:0a39350b-fba9-4f43-9559-673d2e43eb48, msg:'user video hard muted' }



Hard UnMute Particular Stream Video:-

This method will help to mediator to Unmute a particular stream Video

Enx.hardUnmuteVideo(streamId,clientId);
Prop Type Required Description
streamId String Yes Here streamId will help to know which stream has try to unmute Video
clientId String Yes Here clientId will help to know which stream will unmute.



Moderator CallBack

There would be listener for participant and moderator when hardunmute video used by moderator. For this callbacks are:

hardUnmutedVideo:event =>{ },

Where event is

{ result : 0 }


Participant CallBack

Participant Callback for hardunmute video done by mediator

receiveHardUnmuteVideo:event =>{ },

Where event is

{ result:0, clientId:0a39350b-fba9-4f43-9559-673d2e43eb48, msg:'user video hard unmuted' }