Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

Stream events

Marçal_S_
Beginner
697 Views

Hello. 

I'm using MCU v3.4 and Javascript SDK sample code, when i enable or disable Audio/Video streams the other peers doesn't receive the events.

The code I use to handle events :

['VideoEnabled', 'AudioEnabled', 'VideoDisabled', 'AudioDisabled'].map(
        function(event_name) {
              stream.on(event_name, function() {
                   L.Logger.info('stream', stream.id(), event_name);
              });
        });

 

And the other peer action was:

stream.disableAudio();

Anyone can help me? is there something wrong? Thanks!

 

 

0 Kudos
8 Replies
Marçal_S_
Beginner
697 Views

Hi there!!! Anyone has any suggestion¿? 

0 Kudos
yongtao_x_
Beginner
697 Views

Marçal S. wrote:

Hi there!!! Anyone has any suggestion¿? 

 

 

RemoteMixedStream.emit('VideoEnabled', evnet); 

RemoteMixedStream.on('VideoEnabled', function(event) ;

This can, but only inform this client


 
 

0 Kudos
Marçal_S_
Beginner
697 Views

Are you right. If you emit an event in RemoteStream of an user, you receive the event in RemoteStream of this stream, but its locally and don't make sense.

In the documentation says that this kind of events was reserved by MCU and triggers when the streams change.

void Woogeen.RemoteStream.on( string event, function listener )

This function registers a listener for a specified event, which would be called when the event occurred.

Remarks:

Reserved events from MCU:

Event Name Description Status
VideoLayoutChanged Video layout of the mix (remote) stream changed stable
VideoEnabled Video track of the remote stream enabled stable
VideoDisabled Video track of the remote stream disabled stable
AudioEnabled Audio track of the remote stream enabled stable
AudioDisabled Audio track of the remote stream disabled stable

User-defined events and listeners are also supported, See stream.emit(event, data) method.

 

Reading this, I understand, when user disable audio in his LocalStream, the others users in the room must receive in their remoteStreams of that user an AudioDisabled event. It must works like this behavior? or i'm wrong

0 Kudos
yongtao_x_
Beginner
697 Views

Marçal S. wrote:

Are you right. If you emit an event in RemoteStream of an user, you receive the event in RemoteStream of this stream, but its locally and don't make sense.

In the documentation says that this kind of events was reserved by MCU and triggers when the streams change.

void Woogeen.RemoteStream.on( string event, function listener )

This function registers a listener for a specified event, which would be called when the event occurred.

Remarks:

Reserved events from MCU:

Event Name
Description
Status

VideoLayoutChanged
Video layout of the mix (remote) stream changed
stable

VideoEnabled
Video track of the remote stream enabled
stable

VideoDisabled
Video track of the remote stream disabled
stable

AudioEnabled
Audio track of the remote stream enabled
stable

AudioDisabled
Audio track of the remote stream disabled
stable

User-defined events and listeners are also supported, See stream.emit(event, data) method.

 

Reading this, I understand, when user disable audio in his LocalStream, the others users in the room must receive in their remoteStreams of that user an AudioDisabled event. It must works like this behavior? or i'm wrong

 

Currently found only VideoLayoutChanged can receive the notice from the MCU, audio and video status can not be received, unless this bug. Now only through the send way to broadcast messages to achieve

0 Kudos
yongtao_x_
Beginner
697 Views

Marçal S. wrote:

Are you right. If you emit an event in RemoteStream of an user, you receive the event in RemoteStream of this stream, but its locally and don't make sense.

In the documentation says that this kind of events was reserved by MCU and triggers when the streams change.

void Woogeen.RemoteStream.on( string event, function listener )

This function registers a listener for a specified event, which would be called when the event occurred.

Remarks:

Reserved events from MCU:

Event Name
Description
Status

VideoLayoutChanged
Video layout of the mix (remote) stream changed
stable

VideoEnabled
Video track of the remote stream enabled
stable

VideoDisabled
Video track of the remote stream disabled
stable

AudioEnabled
Audio track of the remote stream enabled
stable

AudioDisabled
Audio track of the remote stream disabled
stable

User-defined events and listeners are also supported, See stream.emit(event, data) method.

 

Reading this, I understand, when user disable audio in his LocalStream, the others users in the room must receive in their remoteStreams of that user an AudioDisabled event. It must works like this behavior? or i'm wrong

 

me be you can try 'StateChange', from to SDK 'update_stream'

0 Kudos
Jianjun_Z_Intel
Employee
697 Views

Hi Marçal,

disableAudio/disableVideo only disables audio/video tracks on you local machine. It does not send message to remote side.

0 Kudos
Marçal_S_
Beginner
697 Views

Then I don't understand when the events fires, i tried tons of modifications but Enable/Disable Video/Audio events never triggers.

Other thing  I can't understand it's: when you emit an event through an RemoteStream only the user that fires the event receive this event :S

0 Kudos
yongtao_x_
Beginner
697 Views

Marçal S. wrote:

Then I don't understand when the events fires, i tried tons of modifications but Enable/Disable Video/Audio events never triggers.

Other thing  I can't understand it's: when you emit an event through an RemoteStream only the user that fires the event receive this event :S

 

Has been modified by modifying the updateStream audio and video status changes

session_agent/session.js

n.updateStream = function(e, o, r, n) {
log.info("updateStream:", e, r,o), 
g("room", "all", "update_stream", {
event: "StateChange",
id: e,
state: r,
type:o
}), i ? (i.updateStream(e, o, r), n("callback", "ok")) : n("callback", "error", "Controller is not ready")
}

 

woogeen.sdk.js

j.socket.on("update_stream", function(a) {
//if(void 0 !== j.remoteStreams[a.id]) return void e.Logger.warning("stream already added:", a.id);
var b = j.remoteStreams[a.id];
if(a.event == 'StateChange') {
 
c = new d.StreamEvent({
type: "stream-update",
stream: b,
msg:a.state,
avType:a.type
});
j.dispatchEvent(c);
} else {
 
b && b.emit(a.event, a.data)
}
 
})
 
conference.on('stream-update', function(event) 

0 Kudos
Reply