@reactoo/watchtogether-sdk-js 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -1975,7 +1975,12 @@ class RoomSession {
1975
1975
  await this.#destroyHandle(this.#subscriberHandle?.handleId, false);
1976
1976
 
1977
1977
  this.#wipeListeners();
1978
- if (this.ws && this.ws.readyState === 1) {
1978
+
1979
+ if(!this.useWebsockets) {
1980
+ await this.#send({"janus": "destroy"}, true);
1981
+ }
1982
+
1983
+ else if (this.ws && this.ws.readyState === 1) {
1979
1984
  await this.#send({"janus": "destroy"}, true);
1980
1985
  this.ws.close();
1981
1986
  }