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

State "naf:reconnecting" when connection is bad and it reconnects #67

Open
vincentfretin opened this issue Mar 18, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@vincentfretin
Copy link
Member

I have the following code in my project that add a "naf:reconnecting" state I'm using to not show a user left message for clientDisconnected event and using it in video-texture-target and waypoint components as well to clean the projected screen share of the disconnected user or unoccupy waypoint if the user really disconnected and that's not just me that reconnects.

if (!NAF.adapters.adapters.janus.prototype.reconnectOriginal) {
    NAF.adapters.adapters.janus.prototype.reconnectOriginal = NAF.adapters.adapters.janus.prototype.reconnect;
    NAF.adapters.adapters.janus.prototype.reconnect = async function () {
      const sceneEl = document.querySelector("a-scene");
      if (!sceneEl) {
        return;
      }
      sceneEl.addState("naf:reconnecting");
      await this.reconnectOriginal();
      sceneEl.removeState("naf:reconnecting");
    };
  }

Properly add that in the adapter in next release.

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

No branches or pull requests

1 participant