MenuMenu

RTCMultiConnection.StreamsHandler

Get access to StreamsHandler.js

How to use

// first parameter is your MediaStream object
// second parameter is: should I sync mute/unmute/stop action across all users
// third parameter is your "connection" object
connection.StreamsHandler.setHandlers(screenStream, true, connection);

This object helps you force syncing of screen-stop action across all connected users.

RTCMultiConnection, by default, always forces sync-action. i.e. it tells all connected users that your stream is muted or unmute or stopped.

Internal code (you can always override):

connection.StreamsHandler.onSyncNeeded = function(streamid, action, type) {
    connection.peers.getAllParticipants().forEach(function(participant) {
        mPeer.onNegotiationNeeded({
            streamid: streamid,
            action: action,
            streamSyncNeeded: true,
            type: type || 'both'
        }, participant);
    });
};