Coder Social home page Coder Social logo

muaz-khan / rtcmulticonnection Goto Github PK

View Code? Open in Web Editor NEW
2.5K 166.0 1.4K 7.4 MB

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)

Home Page: https://muazkhan.com:9001/

License: MIT License

JavaScript 93.84% HTML 2.72% CSS 3.44%
webrtc webrtc-experiments webrtc-demos rtcmulticonnection webrtc-javascript-library webrtc-libraries

rtcmulticonnection's Introduction

RTCMultiConnection - WebRTC JavaScript Library

npm downloads Build Status: Linux

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)

Socket.io Signaling Server

Signaling server has a separate repository:

Demos

Getting Started Without Any Installation

YouTube Channel

Install On Your Own Website

mkdir demo && cd demo

# install from NPM
npm install rtcmulticonnection

# or clone from github
git clone https://github.com/muaz-khan/RTCMultiConnection.git ./

# install all required packages
# you can optionally include --save-dev
npm install

node server --port=9001

Integrate Inside Any Nodejs Application

Config.json Explained

How to Enable HTTPs?

Want to Contribute?

RTCMultiConnection is using Grunt to compile javascript into dist directory:

Wiki Pages

  1. https://github.com/muaz-khan/RTCMultiConnection/wiki
  2. https://github.com/muaz-khan/RTCMultiConnection-Server/wiki

License

RTCMultiConnection is released under MIT licence . Copyright (c) Muaz Khan.

rtcmulticonnection's People

Contributors

adrianmcli avatar basilvictor avatar brianpursley avatar chenghaoc avatar dansandland avatar dnish avatar emilio93 avatar grimace avatar hajunho avatar khvictor avatar killmenot avatar lautaroalvarez avatar mikhaelgerbet avatar moreiraandre avatar muaz-khan avatar periodic1911 avatar pranavms13 avatar reptoh avatar swhgoon avatar visgotti avatar vrajroham avatar xxzefgh avatar yuripetusko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtcmulticonnection's Issues

Screen Sharing with Firefox

Hi Muaz

It seems like I can't share my screen with Firefox. Each time I share a screen, instead of displaying the shared screen, Firefox dupplicates foreign shared cameras.
Here is my code:

$( "#share-screen" ).off().click(function()
{
    RTCconnection.removeStream(ownStreams.screenID);

    RTCconnection.addStream({
        screen:true,
        oneway:true
    });
});

RTCconnection.onstream = function (e)
{
    // CASE 1: Screen
    if(e.isScreen)
    {
        console.log("screen stream is here !");

        // Mute video if it's me
        if(e.userid == "{{ webconf.username }}")
        {
            $( '#small-video .streams.' + e.userid ).prepend('<video src="' + e.blobURL + '" class="screen ' + e.userid + '" id="ownScreen" autoplay="autoplay" muted="muted" TITLE = "Cliquez pour afficher en grand" ></video>');
            ownStreams.screenID = e.streamid;
        }
        else
        {
            $( '#small-video > .streams.' + e.userid + ' > .screen' ).remove(); //removes previous screen shared by the user who triggered the event, if there is one

            $( '#small-video .streams.' + e.userid ).prepend('<video src="' + e.blobURL + '" class="screen ' + e.userid + '" id="remoteScreen' + e.userid +'" autoplay="autoplay" TITLE = "Cliquez pour afficher en grand" ></video>');

            RTCconnection.askToShareParticipants();
            if (owner && e.type == 'remote' && !e.session.oneway){
                RTCconnection.shareParticipants({
                    dontShareWith: e.userid
                });
            }
        }
    // CASE 2: Video+audio
    else
    {
        console.log("video stream is here !");

        // Mute video if it's me
        if(e.userid == "{{ webconf.username }}")
        {
            $( '#small-video .streams.' + e.userid ).append('<video src="' + e.blobURL + '" class="video ' + e.userid + '" autoplay="autoplay" muted="muted" TITLE = "Cliquez pour afficher en grand" ></video>');
            $( "#videoContainer").append('<video src="' + e.blobURL + '" class="video ' + e.userid + '" id="cameraSnapshot" autoplay="autoplay" muted="muted" height=200></video>');
        }
        else
        {
            $( '#small-video .streams.' + e.userid ).append('<video src="' + e.blobURL + '" class="video ' + e.userid + '"autoplay="autoplay" TITLE = "Cliquez pour afficher en grand" ></video>');
            RTCconnection.askToShareParticipants();
            if (owner && e.type == 'remote' && !e.session.oneway) {
                RTCconnection.shareParticipants({
                    dontShareWith: e.userid
                });
            }
        }
    }
};

This code works if I use only Chrome. As soon as I use Chrome and Firefox or only Firefox in a chatroom, I get this bug.

How to update configuration when stream is running?

Hi,

I'm currently facing an issue with the RTCMultiConnection library.
I'd like to update a connection configuration (for example, changing video stream resolution).

For example, I start a new video & audio stream:

@stream = new RTCMultiConnection(@stream_id)

@stream.isInitiator = true

@stream.open
    session:
        audio: true
        video: true

Then, I want to allow user to change his video stream resolution.
So, after a user interaction I change the resolution:

@stream.media.min someVal, someVal
@stream.media.max someVal, someVal

Unfortunately, the modifications are not applied: they must be made before opening the connection in order to be effective.

I've found a refresh function, but it looks like to behave more like a reset one.
When I try do make a @stream.refresh(), it just stops the stream and I need to reopen a new connection.

So, my question is: is it possible to make changes on the connection configuration (like muting sound or video, changing resolution, changing camera device, ...) without having to reopen a new one with the new configuration?

Disable loading of filebufferReader.js?

There is a lot of "magic" happening that can be very confusing.. I think that if some libary isn't included and we need it than trigger some error to let us know.. but dont auto fetch it for us..

for example right now its auto fetch filebufferReader for me without me ever using it from here: https://cdn.webrtc-experiment.com/FileBufferReader.js.

this is my simple js:

 var connection = new RTCMultiConnection();
connection.session = {
        audio: true,
        video: true,
        data:  true // only need to pass messages between clients no files
    };
connection.getExternalIceServers = false; //another unwanted magic
connection.connect();

any idea? thanks

Screen sharing with firefox on mac os

Hello,

The screen sharing feature doesn't seem to work on firefox / mac os.

Tested with Firefox Nightly 35 on Mac OS Mavericks (screen sharing and allowed domains were set in about:config). Works well with nightly on Windows.

Sometimes participant streams are not coming to the initiator

Already described here,
muaz-khan/WebRTC-Experiment#248

To add to this, the issue doesn't seem to depend from STUN/TURN server performance, it appears even if the participant and initiator are on the same machine.

The problem probably relates to peer connections, not to streams directly since in successful scenarios "Peer connection has been established between you and <...>" is always reported and connection.peers contains the right participant peer and it doesn't contain it otherwise.

Please assist.

Recording support in RTCMULTICONNECTION-v3

Hi Muaz,
In RTCMulticonnection 3.0 how can we achieve the Recording of video/audio. And also please suggest on the custom controls for play, Pause as in all-in-one.htnl example. Thanks for your help in advance.
Please suggest

why webrtc connection fails

I find more and more "Peer connection is closed between you &" warning recently, i dont know what causes this error, and how to cut down the failures.

Ice connection fails, how can I know what is wrong?

Hi!

I have an application using the latest version RTCMultiConnection and it works well with most person I test it with.

But with some people, the Ice negotiation just fails, giving me the RTCMultiConnection error "ICE connectivity check is failed. Renegotiating peer connection."

Is there a way to know what is wrong?

Thanks.

EDIT: I have tested some online demo of webrtc with these persons and it works without problem. ;(

Unable to reconnect to screen sharing after disconnect

We're having an issue where we call .disconnect() on an active participant connection, then make a new connection later on and try to connect to the same channel. The initiator's connection is active this entire time. When we do this, it appears that the onstream callback doesn't fire again, so we are unable to add the video to our html. We are currently testing with version 2.2.5.

screen sharing works in demo, but doesn't work in localhost

hello, I'm testing screen sharing's demo, but I have a problem.
when I test demo is ok, then I download the source and run it in my localhost and this return me errors.
may you help me?
in my console:
Screen Capturing frame is loaded. RTCMultiConnection.js:3839
name PermissionDeniedError RTCMultiConnection.js:4750
constraintName {
"audio": false,
"video": {
"mandatory": {
"chromeMediaSource": "screen",
"maxWidth": 1920,
"maxHeight": 1080,
"minAspectRatio": 1.77
},
"optional": []
}
} RTCMultiConnection.js:4751
message User denied to share content of his screen. RTCMultiConnection.js:4752
original session Object {screen: true}

Chat/text meessage issue after performing screen sharing

We used RTCMulticonnection 3.0.
We performed the below exercise
We created a session having audio video and data and used chat/text message function, this worked as expected.
Next we performed screen sharing and then again tried to send text/chat message from participant to the Host and we were unable to do so.
We observed that this is happening after connection.addstream is being called.
Below is our code snippet used.

connection.sdpConstraints.mandatory = {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true
};
//This is called on button click for screen sharing
connection.addStream({
screen: true,
oneway: true
});

we refereed the link
https://github.com/muaz-khan/RTCMultiConnection/wiki/Screen-Sharing

Planning some breaking/new updates

Why?

Because current RTCMultiConnection presence detection model is kind of very poor. 98% of connections failed out of signaling and presence detection failures.

How?

Need to separate API in different methods; also need to remove openSignalingChannel because it caused a lot confusions regarding presence detection.

Concepts?

Ref?

  1. https://trello.com/c/K4dYDz47/85-improve-presence-detection
  2. muaz-khan/WebRTC-Experiment#283
  3. https://trello.com/c/hVuIiuI8/82-issue-283

New API?

Maybe openBigRoom and openSmallRoom, e.g.

connection.openBigRoom('room-id');
connection.openSmallRoom('room-id');

Maybe bigRoomSocket and onOpenSmallRoomSocket:

connection.bigRoomSocket = socket;
connection.onOpenSmallRoomSocket = function(configuration) {
    // ---
};

Maybe onRMCMessages and addParticipant:

connection.onRMCMessages = function(message) {
    if(message.isInitiatorPresent) {
        socket.emit('server-event', message.initiatorId);
    }

    if(message.listOfParticipants) {
        socket.emit('server-event', message.shareWith);
    }
};

socket.on('listOfParticipants', function(listOfParticipants) {
    listOfParticipants.forEach(function(userid) {
        connection.addParticipant(userid);
    });
});

socket.on('initiatorPresent', function(initiatorId) {
    // var sessionDescription = connection.sessionDescriptions.selectById(initiatorId);
    connection.joinInitiator(initiatorId);
});

Note:

Nothing is implemented yet. Still working on finalizing easy-to-use and manageable API to handle signaling, presence detection and RTCMultiConnection integration.

Modulization:

Working on modulizating RTCMultiConnection to make sure every "unique" object is having separate repository, as suggested in #1.

OnNewSession event is not fired when url's querystring is different

Hi,

I am trying to integrate video conferencing onto an existing website which makes use of querystring to navigate between different sections in a page. So different participants might have a difference in the querystring part of the url.
This is causing the onNewSession event to not fire for users who have a different querystring from the initiator.
How do i workaround this problem?

Need to omit initiator's concept

Kind of confusing statement:

There must always be an initiator i.e. moderator.

Many people suggested this scenario:

Everyone should use connection.join and that's it.

connection.join('room-id');

This scenario will force keeping room active until all participants leave the room. There will be no other option.

If we try to consider first participant as initiator then existing concept still applies.

If we switch to just-join concept, then there will be less customization and it'll cause breaking changes.

PS. RTCMultiConnection still requires breaking changes to make it as much reliable as possible.

Firefox and RTCMultiConnection

Hi,

Using Multi-Broadcasters and Many Viewers demo as reference I created a plugin for my wbsite to allow every group admin to simulate a class room. When the users join the conference they are simple viewers but they can start to broadcast along with the admin if he gives them the permission.

This is the code I used:

          connection = new RTCMultiConnection();
          connection.session = {
              audio: true,
              video: true,
             broadcast: false
           };

           connection.dontOverrideSession = false;

          connection.onNewSession = function(session) {
                session.join({
                         oneway: true
                 });
           }

          connection.onstream = function(e) { //add users to padder div
                  if(e.mediaElement.id!="undefined" ){
           e.mediaElement.style.zIndex=noUsers+1;
          videos.appendChild(e.mediaElement);
          noUsers+=1;
          if(user=="admin" && noUsers>1){ //this is the close button 
            var button=document.createElement("button");
            button.setAttribute("class","close_user");
            button.setAttribute("id",e.userid);
            button.innerHTML="X";
            button.style.zIndex=noUsers+1;
            videos.appendChild(button); 
        }
      }
           if (e.type == 'remote') {
                  // because "viewer" joined room as "oneway:true"
                 // initiator will NEVER share participants
                // to manually ask for participants;
               // call "askToShareParticipants" method.
                 connection.askToShareParticipants();
        }
      if (connection.isInitiator && e.type == 'remote' && !e.session.oneway) {
            // call "shareParticipants" to manually share participants with all connected users!
          connection.shareParticipants({
              dontShareWith: e.userid
          });
    }
}

And this is the code for the Start conference / Join conference:

      //Start or join conference
      start.onclick = function() {
             // dont-override-session allows you force RTCMultiConnection
             // to not override default session of participants;
           // by default, session is always overridden and set to the session coming from initiator!
           if (this.firstChild.data == 'Join conference') {
               connection.connect(connection.channel);

              question.style.display = 'inline';
              this.style.display = "none";
              end.style.display = 'inline';
         }
         if (this.firstChild.data == 'Start conference') {
              connection.open({
                   sessionid: connection.channel,
                   captureUserMediaOnDemand: false
               });
                this.style.display = 'none';
              end.style.display = 'inline';
         }
     };

When the admin allows him to broadcast I used:

       connection.addStream({
           audio: true,
           video: true,
           broadcast: true
      });

The admin closes the user's broadcast by using:

    connection.sendCustomMessage({
        dropAllMedias: true,
        targetUserid: id
    });

and on the user side:

        connection.onCustomMessage = function(message) {
        if (message.targetUserid == connection.userid && message.dropAllMedias) {
            // remove all audio streams
           // remove all video streams
           // remove all screen streams
          connection.streams.stop('local');         
      }
  };

If everyone is using Chrome everything is working. The problems begins when I try to use Firefox with Chrome or Firefox with Firefox.
If the admin wants to close the user's broadcast the media element for that user doesn't disappear it just goes blank. On the user's side his media element disappears but if he wants to broadcast again nothing happens. (It's as if Firefox is still using the microphone and webcam to broadcast but without the media element present on that page).
Also with Firefox the audio and video are delayed.

At the moment I'm using RTCMultiConnection-v2.2.4.

Am I doing something wrong or is it a Firefox issue?

sendCustomMessage() doesn't work if defaultSocket is not yet available

Hey, there's a bug, line number 2646
if (!defaultSocket) {
return setTimeout(function () {
connection.sendMessage(message);
}, 1000);
}

There's no such function as connection.sendMessage, there's only connection.sendCustomMessage(), please fix.

By the way haven't you think about using TDD and feature branching or at least writing unit tests for your library? Otherwise there'll bee constant code regression.

Also, instead of having one big repository and putting the libraries in its subfolders and keeping each older version for each library you could use Git capabilities:

  • it's possible to create a separate repository for each library and add them into the main repository as Git submodules, see the documentation: http://git-scm.com/book/en/Git-Tools-Submodules - this way it will be much easier to track the issues and maintain the code and the versions and for users there will be no difference, they would be able to click on a specific submodule and go to its repo.
  • it's better to mark stable releases (like RTCMultiConnection-v1.7) with Git tags instead of keeping all the versions as separate files, see the documentation here: http://git-scm.com/book/en/Git-Basics-Tagging

If there's a need to make a minor change to a major version just add a minor postfix to the version number in the tag name, like 1.8.1, 1.8.1.1, in this case the users will be sure that they use the right version that was working before and new updates will not break their application.

rooms-list is not listing all rooms

After testing multiple demo systems like.
https://www.webrtc-experiment.com/RTCMultiConnection/videoconferencing.html
https://www.webrtc-experiment.com/RTCMultiConnection/audioconferencing.html

I noticed that it just lists 1 room at a time. I'm currently using/developing the Audio Conference system on my website. Is there any way we can come in contact like skype orso?

Besides that i have more wishes like displaying the "Character Name" and at this point i dont know how, since it's new to me.

How RTCMultiConnectiion connects

Hi,

i dont know how to connect two clients, when they are on seperate machine. Im using custom websocket for signaling:

IAWebRTC.connection.openSignalingChannel = function (config) {
var channel = config.channel || this.channel;
IAWebRTC.onMessageCallbacks[channel] = config.onmessage;

        if (config.onopen) setTimeout(config.onopen, 10);

        return {
            send: function (data) {

                var iaObject = new IAObject();
                    iaObject.Function = "IAWebRTC.ConnectStream";
                    iaObject.SetObject.channel = config.channel;
                    iaObject.SetObject.message = data;
                    iaObject.SetObject.sender = IAWebRTC.connection.userid;

                if (notifyUser != undefined && notifyUser != null) iaObject.SetObject.callUser = notifyUser;
                SendToServer(iaObject);

            },
            channel: channel
        };
    };

so the message is sended to server, than to second user on seperate machine. Second user is getting this message but got all the time "Unable to reach initiator. Trying again...".
I can see that another message is going from second user to initiator with message:

{
"messageFor": "cxj5wmqu5qxgvi",
"presenceState": "checking",
"_config": {
"userid": "cxj5wmqu5qxgvi",
"extra": {},
"sessionid": "http12700111011",
"session": {
"audio": true,
"video": true
}
},
"userid": "9m89zjlwims4i",
"extra": {}
}

But i really dont know how to create peer connection beetwen them. Here is also mine onmessage function:

ConnectStream: function (htmlObject) {
if (!IAWebRTC.isReady) IAWebRTC.CreateConnection(htmlObject.GetObject.SenderId);

    if (htmlObject.GetObject.sender != IAWebRTC.connection.userid && IAWebRTC.onMessageCallbacks[htmlObject.GetObject.channel]) {
        IAWebRTC.onMessageCallbacks[htmlObject.GetObject.channel](htmlObject.GetObject.message);
    }

    if (!IAWebRTC.isOpen) {
        IAWebRTC.connection.join(JSON.parse(htmlObject.GetObject.message));
        IAWebRTC.isOpen = true;
    }
},

onstreamended endless loop

Hi!

I've experienced a nasty endless loop calling onstreamended that appears in a very particular case.

As this function can be called in many part of your code I failed to find a fix yet, but I'll spend some time on it and propose a solution if I find one.

As you documented in "onstreamended" function, there are some case where this event is never fired when a participant close his tab.
This has a chance to happen 1/3 time when testing my application on 3 different tabs, and closing one. :3

The other two tabs don't get the event "onstreamended", but if I close one of the two tabs, it ends up in an endless loop calling "onstreamended".

Thanks!

RTCMultiConnection not support more than two connections at the same time

I'm working with RTCMultiConnection and presence detection; where A and B are connected automatically added to the same channel. But if you connect C, communication is only working between A and C, B is disconnected. If you connect a D, C is disconnected and is working A and D.

What happens when that happens, I can only support 2 connections, the first and most recent.

My server is signaling websocket-over-nodejs.

Thank you for your continued help!

How to handle partial support for participants

Hi,

I'm using MultiConnection and trying to implement a 'many-to-many' conference with 'audio+video+data+screen' session. This is working fine when participant has webcam, but throws following alert and reloads page for participants who doesn't have webcam:

It seems that you are capturing webcam and there is no device available or access is denied. Reloading...

How can I make those participant without webcam to receive video stream so that they can see initiator's screen.

onStreamEndedHandler doesn't call connection.onstreamended if mediaElement is not attached

Hi,

I have a need to place user's stream as a video element in different places in DOM in my application. That's why I don't pass e.mediaElement in myconnection.onstream called but just pass stream to my internal function. Instead it, I use getMediaElement lib that provides me with canvas

However, in this case onstreamended isn't called due to this line https://github.com/muaz-khan/RTCMultiConnection/blob/master/RTCMultiConnection.js#L4569

Any workaround? Could we suppress it with solution like https://github.com/muaz-khan/RTCMultiConnection/blob/master/RTCMultiConnection.js#L5247 ?

Stop screen sharing

Hi. I'm working on a webchat with screen sharing, but I have some problems with your API. I am using v2.2.2

When the user enters the chatroom, they have their camera and micro activated. But they can click on a button "share-screen" in order to share their screen. When they want to stop sharing, or change the screen shared, they have to click "share-screen" again. But this have to stop ONLY this user's screen stream.
The shared screen is displayed on a div created when "onstream" is fired. I'd like to make the div disappear when "onstreamended" is fired.

Unfortunately, "onstreamended" is not fired when I use the ".stop()" function.

Could you please help me ?

Initiator cannot rejoin session

So far RTCMultiConnection is working great, but I find that if the initiator leaves a session where there are two other participants (I'm simulating this by running Firefox, Opera, and Chrome on the same machine. each with the same data session open), then he/she/it cannot return, and in fact nobody else can join the session.

But the other participants can leave and then return. Only the initiator has this restriction.

Is there a way around this? I'd like the initiator, who happened to be the first person checking in, to be able to leave and return like everyone else.

Thanks!

Audio & Video streams

Hi,

I'm currently trying to use the mute / unmute features.
One thing that could be great is to mute only audio or only video.

However, when I try to find the audio & video streams, I only find one stream.
For example, connection.localStreams, returns only one stream:

MediaStreamended: false
id: "pyuuhRzcT3vrcppb72nCPxgjDB76MXtcsx9U"
isAudio: false
isScreen: false
isVideo: true
label: "pyuuhRzcT3vrcppb72nCPxgjDB76MXtcsx9U"
streamid: "i2tq4rvy5d0a4i"
...

As you can see, this stream is marked as a video stream (isVideo is true and isAudio is false).
But, when I mute this stream (connection.streams["i2tq4rvy5d0a4i"].mute()), video and audio are muted and not only video.

So, is there a way to mute only video or only audio?

Actually, I simply open a connection like this:

@connection.open
    session:
        audio: true
        video: true
    extra: {}

An other thing quite strange concerning audio stream happens when I join a stream.

# set session id
@connection.sessionid = sessionid

# join stream
@connection.join
    sessionid: sessionid
    userid: userid
    session: {}
    extra: {}

# callback onJoin
onJoinStream = (event) =>
    if event.type == 'remote'
        $('#stream_video').attr("src", event.blobURL)

Everything works great. But when I mute the audio in the media player, I still hear something (and I don't find the source of the sound...).

numberOfConnectedUsers remains the same after remote user has left the session

Hi,

Got stick with strange behavior (possible issues but not sure).

Demo can be used to reproduce the issue
Steps to reproduce:

  1. Start a new session as an initiator
  2. Check numberOfConnectedUsers count
console.log(connection.numberOfConnectedUsers) // 0
  1. Join a second user (used another pc). Connection.numberOfConnectedUsers at the initiator equals 1.
  2. Close the second user and check connection.numberOfConnectedUsers at host # still 1

The issue is that if I rejoin as another user "connection.onconnected" didn't fire for me due to incorrect numbers of users// connection.numberOfConnectedUsers in this case
https://github.com/muaz-khan/RTCMultiConnection/blob/master/RTCMultiConnection.js#L1445

Is there any solution to fix it? Or another workaround?

Screen sharing not working with RTCMUlticonnection V3.0

Hi,

I am trying to use screen sharing provided in RTCMUlticonnection V3.0 (Socket.IO over node.js) you have provided but i keep getting the below error. What the problem is i am not able to figure out. Please do have a look at the below error trace and let me know if you see anything amiss from my end.

onLocalMediaError NavigatorUserMediaErrorconstraintName: ""message: ""name: "InvalidStateError"proto: NavigatorUserMediaErrorMultiPeersHandler.js:272 MultiPeers.onLocalMediaError
RTCMultiConnection.js:812 NavigatorUserMediaErrorconstraintName: ""message: ""name: "InvalidStateError"proto: NavigatorUserMediaError
RTCMultiConnection.js:270 socket.io connection is opened.

I do have the chrome screen sharing extension installed on my machine and followed all the steps as mentioned in Screen-Capturing.js.

error in chrome emulation mood

chrome version: 38 (64-bit win7)
in devTool, emulation is on, Device is e.g. Apple iPhone 4
RTCMultiConnetion file: Last time updated at Sep 22, 2014, 08:32:23

After requireing RTCMultiConnetion.js I get:
Uncaught TypeError: Cannot read property '2' of null ............... line: 4029

the problem caused by:
if (isChrome && navigator.userAgent.match(/Chrom(e|ium)/([0-9]+)./)[2])

stream-mp3-live.html demo is not working from firefox to chrome

Hi Muaz,
When I do the stream-mp3-live from chrome(ie, choose the file in chrome) to firefox it is working but when I reverse the combination it is not working. It is playing empty. When I see the logs, it shows firefox is not sending any data.

Is this an expected behavior or am I missing something??

Trying to diagnose an issue where ICE never changes from gathering to complete

Hope this is an acceptable place to as a question. I've loved playing around with RTCMultiConnection. I've recently switched from using a free STUN/TURN server to one I'm running myself. My own server seems to work fine when connecting Mac -> Mac, but when trying to establish a Mac -> Windows connection, it doesn't seem to complete.

I've been adding a bunch of logging statements to the file to try to understand exactly what's going on, and why the connection never completes. In both the working test, I'm seeing ICE host candidates, however I'm only seeing srflx and relay candidates in the functional test; those are never getting logged in the non-functional test.

I'm running a stock Amazon EC2 server with the rfc5766-turn-server AMI; I don't know if this is some misconfiguration problem with my server, or something else.

Any idea how I can figure out why this session is never being properly established?

How to differentiate between screen and video elements in RTCMulticonnection-v3

Hi Muaz,
In connection.onstream in RTCMulticonnection 3.0 how can we add isScreen object to know if a person has shard his screen. Currently it is not possible to distinguish the same.In the current version there's no difference between video and screen element as in previous version 2.2.5. How do we differentiate between the video and screen video element. Please suggest.

detect screen sharing end

Hi !

Every time I start screen sharing, then stop it with the chrome's button "stop sharing", both participants never receive any kind of event "onstreamended" or "onclose" ect...

Is there a way to detect it or is it a bug?

Custom firebase instance not working

At line 6063 of the current latest.js this line would replace the default firebase instance with the custom one:

connection.resources.firebaseio = connection.resources.firebaseio.replace('//chat.', '//' + connection.firebase + '.');

Unfortunately, at thos point, connection.resources.firebaseio seems to be https://webrtc-experiment.firebaseIO.com/, so no replacement takes place and no custom firebase is possible.

That said, why do you use a regexp to do this task? Wouldn't it be easier to have a function to generate the Firebase URL and use it in the whole library, instead of setting a string somewhwere and replace it via regexp?

Some ideas

Hi Muaz,

First of all, thank you for a great library.

I'm playing with RTCMultiConnection found that it's different in this repo and https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection

My issue is located in difference between the following files:
https://github.com/muaz-khan/WebRTC-Experiment/blob/master/RTCMultiConnection/latest.js#L3470
and
https://github.com/muaz-khan/RTCMultiConnection/blob/master/RTCMultiConnection.js#L3470

What do you think about the following ideas:

  1. Add bower support. See more here
  2. Include "RTCMultiConnection" as node/bower package to "WebRTC-Experiment" repository (allows to manage it better in WebRTC-Experiment repo)
  3. Use tags to manage different versions
  • You can use grunt-bump or grunt-contrib-bump for that
    1. Move change log from library to a separate file (CHANGELOG.md)
    2. Create CONTRIBUTING.md to describe contributing rules.

If you don't mind I can do most part of changes and send you a pull request?

connection.onopen fire twice each time when new person connect to room

connection.onopen fire twice for both creator and participator when i use data-only connection.

//creator code
var connection = new RTCMultiConnection();
connection.session = {
    data: true
};
var room = 'room1';
connection.open(room);
//participator code
var connection = new RTCMultiConnection();
connection.session = {
    data: true
};
var room = 'room1';
connection.connect(room);

Bandwidth control

Hi,

Do you know a way to control the video bandwidth on Firefox? Looking your sourcecode, I've noted that use the approaches:

b=AS:xx
and
a=fmtp:yyy x-google-min-bitrate=xx; x-google-max-bitrate=xx

I've tried both method and they work on Chrome, but the bandwidth from Firefox is not modified.

Do you know any other method?

Thanks

Marcos

connection.numberOfConnectedUsers-- is not executed when 'beforeunload' event is fired

Hello,

I'm currently building an application where some people can stream and other watch these streams.

For this example, I have a streamer with a display of the variable @stream.numberOfConnectedUsers
(with @stream = new RTCMultiConnection(@stream_id))

When a watcher join the session RTC

  • correctly increment connection.numberOfConnectedUsers++.

When a watcher leave his session by leaving tab (by event beforeunload)

  • didn't do connection.numberOfConnectedUsers--

connection.numberOfConnectedUsers-- is normally incremented in

function onLeaveHandler(event, connection)

I tried to debug the library and I don't know why he doesn't enter in the if:

if (response.left) {

https://github.com/muaz-khan/RTCMultiConnection/blob/master/RTCMultiConnection.js#L3522


my configuration is the:

streamer

@stream.onstream = onNewStreamCallback
@stream.open
    session:
        audio: true
        video: true
        extra: {}

watcher

@stream.onstream = onJoinStreamCallback
@stream.sessionid = sessionid
@stream.join
    sessionid: sessionid
    userid: userid
    session: {}
    extra: {}

Server Side Recording

Hi,

I'm currently building an application where some people can stream and other watch these streams.

I'd like to implement a "replay" feature, where watchers can review old streams.

I've tried to allow streamers to record their stream (via startRecording and stopRecording RTCMultiConnection functions).
But this is not very user friendly: users have to download two files (one for the audio and an other for the video) and must upload these files to the server.

So, in order to improve this feature, I'd like to record streams server side: user won't have to download and upload files and streams replay will be available instantly.

I've searched on the API, but I haven't found a way to do this: is it possible to implement this kind of feature (and, if it's the case, how can I achieve it?).

creating rooms automatically

Hellow there!
Is there way to make a several rooms automatically when server starts? So user who comes on server can choose where to join?

Filebufferreader error when more than 2 user are connected

Hi Muaz,
I am using RTCMULTICONNECTION -v3 for the project. The file sharing is throwing error "Uncaught TypeError: Cannot read property 'extra' of undefined " when more than two users are connected. This error is present in the demos as well.
Kindly suggest.

webrtc: bandwidth usage in chrome m39

I'm setting audio bandwidth to 50kbps (connection.bandwidth = { audio: 50 };) , and I can see the value in the SDP strings in setLocalDescription and setRemoteDescription:

a=mid:audio
b=AS:50

However when I'm looking at the stats graphs in webrtc-internals, I'm seeing 80kbps:
screen shot 2014-12-05 at 7 09 32 pm

Should this not be limited to 50kbps for each?

openSignalingChannel using socket.io rooms instead of namespaces

Can the openSignalingChannel method used with socket.io rooms instead of namespaces?
What should connection.channel be set when using socket.io rooms instead of namespaces?
(I'm not sure if I need to manually set presenceState of the backbone RMC.)

When I experiment, I always get 'Session-Descriptions not found. Rechecking..' or ' Unable to reach initiator. Trying again...' errors.

I'm using the simplest server-side signaling code as below, and the same client code as http://www.rtcmulticonnection.org/docs/openSignalingChannel/#single-socket.

Thanks.

server.js

    ...
    io.on('connection', function (socket) {
      socket.on('message', function (data) {
          socket.broadcast.emit('message', data);
      });
    });
    ...

Switching RTCMultiConnection between channels

Hi Muaz,

Is there a way for a single RTCMultiConnection instance to dynamically switch between channels i.e. big-rooms?

What I want to do is to instantiate RTCMultiConnection with one channel, later switch it to use another channel, and then maybe come back to the original channel.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.