@jamm-api/client
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -125,2 +125,3 @@ /// <reference types="node" /> | ||
}; | ||
hardwarePreviewLoaded: boolean; | ||
constructor(opts?: RoomOpts); | ||
@@ -127,0 +128,0 @@ showHardwarePreview(token: string): void; |
@@ -65,2 +65,3 @@ "use strict"; | ||
_this.url = ''; | ||
_this.hardwarePreviewLoaded = false; | ||
_this.instanceId = Math.random().toString(); | ||
@@ -138,2 +139,3 @@ _this.opts = opts; | ||
var _this = this; | ||
this.hardwarePreviewLoaded = false; | ||
this.url = "" + this.baseURL.replace('/room', '/hardware'); | ||
@@ -163,2 +165,3 @@ var prefix = this.url.indexOf('?') > -1 ? '&' : '?'; | ||
if (((_a = event === null || event === void 0 ? void 0 : event.data) === null || _a === void 0 ? void 0 : _a.type) && ((_b = event === null || event === void 0 ? void 0 : event.data) === null || _b === void 0 ? void 0 : _b.instanceId) === _this.instanceId) { | ||
_this.hardwarePreviewLoaded = true; | ||
_this.emit(event.data.type, __assign({ target: _this }, event.data)); | ||
@@ -200,3 +203,3 @@ } | ||
} | ||
if (opts.reuseStream && this.element) { | ||
if (opts.reuseStream && this.element && this.hardwarePreviewLoaded) { | ||
// Reuse the existing stream by telling the page to navigate from hardware settings | ||
@@ -203,0 +206,0 @@ // to the room |
{ | ||
"name": "@jamm-api/client", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "JavaScript library for creating and joining Jamm Video embeds", | ||
@@ -5,0 +5,0 @@ "main": "dist-commonjs/index.js", |
Sorry, the diff of this file is not supported yet
26817
463