This page explains how to upgrade to latest version (v3 or higher).
Use streamEvents
instead of connection.streams
:
var stream = connection.streamEvents['streamid'];
// or use this code:
// backward compatibility
connection.streams = connection.streamEvents;
connection.numberOfConnectedUsers = 0;
if (Object.observe) {
Object.observe(connection.streamEvents, function() {
// for backward compatibility
connection.streams = connection.streamEvents;
});
Object.observe(connection.peers, function() {
// for backward compatibility
connection.numberOfConnectedUsers = connection.getAllParticipants().length;
});
}
# you can even use "getStreamById"
var stream = connection.attachStreams.getStreamById('streamid');
# to get remote stream by id
var allRemoteStreams = connection.getRemoteStreams('remote-user-id');
var stream = allRemoteStreams.getStreamByid('streamid');
Wanna check isScreen
or isVideo
or isAudio
?
connection.onstream = function(event) {
if(event.stream.isScreen) {
// screen stream
}
if(event.stream.isVideo) {
// audio+video or video-only stream
}
if(event.stream.isAudio) {
// audio-only stream
}
};
var stream = connection.streamEvents['streamid'].stream;
stream.mute('audio'); // mute only audio tracks
stream.mute('video'); // mute only video tracks
stream.mute('both'); // mute both video and audio tracks
// or simply
stream.mute(); // mute both video and audio tracks
- Getting Started guide for RTCMultiConnection
- Installation Guide
- How to Use?
- API Reference
- Upgrade from v2 to v3
- How to write iOS/Android applications?
- Tips & Tricks
- https://twitter.com/WebRTCWeb i.e. @WebRTCWeb
RTCMultiConnection is released under MIT licence . Copyright (c) Muaz Khan.