Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

Stream events

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!

 

 

Tags (2)
0 Kudos
8 Replies
Highlighted
Beginner

Hi there!!! Anyone has any

Hi there!!! Anyone has any suggestion¿? 

0 Kudos
Highlighted
Beginner

Quote:Marçal S. wrote:

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
Highlighted
Beginner

Are you right. If you emit an

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
Highlighted
Beginner

Quote:Marçal S. wrote:

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
Highlighted
Beginner

Quote:Marçal S. wrote:

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
Highlighted

Hi Marçal,

Hi Marçal,

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

0 Kudos
Highlighted
Beginner

Then I don't understand when

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
Highlighted
Beginner

Quote:Marçal S. wrote:

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