Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double Friends Stream #69

Open
pdxbenjamin opened this issue Jun 21, 2019 · 6 comments
Open

Double Friends Stream #69

pdxbenjamin opened this issue Jun 21, 2019 · 6 comments

Comments

@pdxbenjamin
Copy link

pdxbenjamin commented Jun 21, 2019

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
Copy link
Owner

stephenlb commented Jun 24, 2019

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

@stephenlb
Copy link
Owner

stephenlb commented Jun 24, 2019

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

@pdxbenjamin
Copy link
Author

@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
Copy link
Owner

stephenlb commented Jun 25, 2019 via email

@pdxbenjamin
Copy link
Author

pdxbenjamin commented Jun 25, 2019

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
Copy link
Author

pdxbenjamin commented Jun 26, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants