stephenlb / webrtc-sdk

WebRTC Simple Calling API + Mobile SDK - A simplified approach to RTCPeerConnection for mobile and web video calling apps.
https://stephenlb.github.io/webrtc-sdk/
MIT License
855 stars 278 forks source link

Double Friends Stream #69

Open pdxbenjamin opened 5 years ago

pdxbenjamin commented 5 years ago

With no changes or fancy business. A Downloaded copy of the repo .zip displays two 'friend' video views? I tried a Multicall.html and dial.html in the tutorials folder and they both have double / multiple friend video views when connected? I'm not saying, it is not working, it's double working?! Is that how it is suppose to be? @stephenlb

I've tested with two browsers on my one pc, pc to mobile, pc to pc. All Google Chrome.

stephenlb commented 5 years ago

Hi! Yes this is working. These HTML files are tests for a self-to-self call. This shows the SDK is working successfully.

stephenlb commented 5 years ago

If you want to test two devices, use this URL: https://stephenlb.github.io/webrtc-sdk/

pdxbenjamin commented 5 years ago

@stephenlb I've successfully tested two computers, many browsers and even mobile. Thank you for the link. I don't understand how to cancel the double video feed. Where in webrtc-v2.js can I look for better understand the v2.js inner workings.

stephenlb commented 5 years ago

May you screenshot the double video feed? I think it may just be the application doing this rather than the SDK.

On Mon, Jun 24, 2019 at 6:40 PM pdxbenjamin notifications@github.com wrote:

@stephenlb https://github.com/stephenlb I've successfully tested two computers, many browsers and even mobile. Thank you for the link. I don't understand how to cancel the double video feed. Where in webrtc-v2.js can I look for better understand the v2.js inner workings.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stephenlb/webrtc-sdk/issues/69?email_source=notifications&email_token=AAALBHTNQX55J4C6D2EVD4TP4FZPRA5CNFSM4H2HTFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOWJAA#issuecomment-505242752, or mute the thread https://github.com/notifications/unsubscribe-auth/AAALBHQSLO7UC4GCHSI4RQDP4FZPRANCNFSM4H2HTFQQ .

-- Stephen Blum - CTO https://www.linkedin.com/in/stephenlb/

pdxbenjamin commented 5 years ago

This is a fresh download of the repo. Using the multicall.html as a starting point, I changed the pubnub keys to my own. I have not made any other changes to webrtc-v2.js or the .html file. I've shown in my screen shot in chrome dev tools the 'friends' stream shows twice. This is locally of course on my pc, I use firebase if that matters but when it's live testing with another computer, or mobile or tablets every instance is doubled like this. If that is how it is suppose to be for demonstration purpose, cool, but what could I do to not double the friends stream?

@stephenlb

Thank you.

https://imgur.com/a/D0CPDzu

pdxbenjamin commented 5 years ago

I'm not sure why, again i'm not 100% on the inner workings of the webrtc-v2.js.

This simple change of adding more than the default, audio:true and video:true to the mediaconf has removed the double video.

v2.js

    const PHONE = window.PHONE = config => {
    const PHONE         = () => {};
    const pubnub        = socket(config);
    const pubkey        = config.publish_key;
    const subkey        = config.subscribe_key;
    const autocam       = config.autocam !== false;
    const sessionid     = uuid();
    const mediaconf     = config.media;
    // const mediaconf     = config.media || { audio : true, video : true };
    const conversations = {};
    let   myvideo       = document.createElement('video');
    let   snapper       = () => ' ';
    let   mystream      = null;
    let   myconnection  = false;

...

multicall.js

    let   session = null;
    const number  = Math.ceil(Math.random()*10);
    const phone   = PHONE({
      number        : number,
      media         : { video: { width:1280, height:720 } },
      autocam       : false,   
      publish_key   : 'pub-c-ed7ff8bb-737d-4732-8310-cc69dcd59',   
      subscribe_key : 'sub-c-c43d65b2-9f4d-11e8-84a1-bd3b0340'
    });

I was adding in Xirsys and doing a little bit of styling with css to make the mobile look a bit better. I wanted to add a bit of default sizing to the video feeds and added some constraints to the multicall.html media config and bamo, no more double friends feed. Weird eh. @stephenlb

https://imgur.com/a/cDrsLR4