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

Screen sharing trigger and icon increases when I create new AccCore objects #81

Open
2 tasks
Michaelrecycle opened this issue Jun 12, 2020 · 1 comment
Open
2 tasks

Comments

@Michaelrecycle
Copy link

New issue checklist

General information

@kascote @robjperez @willyaranda @jaoo @martinvol

  • Library version(s): v2.0.15
  • iOS/Android/Browser version(s): Chrome v83.0.4103.97
  • Devices/Simulators/Machine affected: Computer
  • Reproducible in the demo project? (Yes/No): Yes
  • Related issues:

Bug report

I need to change session in the app without refreshing the page and stuff which means when I do:
otCore = new AccCore(options) where options has credentials I am unable to change the session unless I basically do otCore = new AccCore(options) however that causes the screen sharing to be created/initialized again which means there is an additional icon button and it causes the chrome to prompt screenshare twice WHILST not actually working even if I press "screenshare" twice on two different popups.

How can I either remove the old AccCore or destroy it or something and remake it or just change the session the AccCore is pointing to?

I have tried to do otCore.internalState.setSession but that returns an error. I also do otCore.disconnect and otCore.endCall but that does not do anything.

The session changes succesfully and everything else seems to work fine. The only issue seems to be the additional packages such as screen share which get increased linearly with the number of times I jump sessions.

Expected behavior

Everytime I create AccCore I need the old screenshare package to remain so that I can screen share normally instead of loading it in everytime I jump sessions.

...

Actual behavior

Seeing a duplicate screen sharing package which causes the icon button to duplicate each time I remake new AccCore(options) object and when I click it causes multiple prompts and does not work in the end.

...

Steps to reproduce

Recreate otCore in componentDidMount (or anywhere). You can just duplicate these two lines:

otCore = new AccCore(options);
otCore = new AccCore(options);

...

Crash log? Screenshots? Videos? Sample project?

image
This gets duplicated when I make a new AccCore object to jump sessions and so it also causes the pop up to trigger multiple times depending on how many times I duplicated AccCore object.

...

Question or Feature Request

Is it possible for me to change sessions without remaking AccCore? Or is it possible to override certain things such as the screen sharing package duplication?

...

Here is the code below for the main logic:

@mtomov
Copy link

mtomov commented Sep 18, 2020

I can confirm the bug. The same happens with the Record and Chat buttons as well. I see this behaviour with Turbolinks.

Edit: Actually managed to fix the Turbolinks issue by detecting if the visit is a preview, and running only if the visit is not a restoration one. Something like this:

connect() {
  if (document.documentElement.hasAttribute("data-turbolinks-preview")) {
    return
  }
  ..  // continue with normal setup
}

image

Any workarounds?

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