hanc-webrtc-widgets 2.2.5 → 2.2.7
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.
|
@@ -17409,7 +17409,7 @@ class wd extends EventTarget {
|
|
|
17409
17409
|
this.audioElements.delete(s.identity);
|
|
17410
17410
|
}
|
|
17411
17411
|
const a = t.attach();
|
|
17412
|
-
a.setAttribute("playsinline", "true"), a.setAttribute("webkit-playsinline", "true"), a.dataset.participantId = s.identity, this.audioContainer ? this.audioContainer.appendChild(a) : (console.warn("[LiveKit] Audio container not found, appending to body"), document.body.appendChild(a)), this.audioElements.set(s.identity, a), this.playAudioElement(a).then((c) => {
|
|
17412
|
+
a.setAttribute("playsinline", "true"), a.setAttribute("webkit-playsinline", "true"), a.dataset.participantId = s.identity, this.isAppleDevice && (a.volume = 0.8), this.audioContainer ? this.audioContainer.appendChild(a) : (console.warn("[LiveKit] Audio container not found, appending to body"), document.body.appendChild(a)), this.audioElements.set(s.identity, a), this.playAudioElement(a).then((c) => {
|
|
17413
17413
|
c || (this.audioPlaybackPrompt = !0, this.dispatchEvent(
|
|
17414
17414
|
new CustomEvent("audio-playback-status-changed", {
|
|
17415
17415
|
detail: { canPlayback: !1 }
|
|
@@ -38196,7 +38196,7 @@ class Hd {
|
|
|
38196
38196
|
mid: 0,
|
|
38197
38197
|
treble: 0,
|
|
38198
38198
|
level: 0
|
|
38199
|
-
}, this.resizeTimeoutId = null, this.isContextLost = !1, this.animate = () => {
|
|
38199
|
+
}, this.resizeObserver = null, this.resizeTimeoutId = null, this.isContextLost = !1, this.animate = () => {
|
|
38200
38200
|
if (this.isContextLost)
|
|
38201
38201
|
return;
|
|
38202
38202
|
this.animationId = requestAnimationFrame(this.animate);
|
|
@@ -38215,9 +38215,11 @@ class Hd {
|
|
|
38215
38215
|
}, this.handleResize = () => {
|
|
38216
38216
|
this.resizeTimeoutId !== null && clearTimeout(this.resizeTimeoutId), this.resizeTimeoutId = setTimeout(() => {
|
|
38217
38217
|
this.resizeTimeoutId = null;
|
|
38218
|
-
const u = this.container.clientWidth
|
|
38219
|
-
|
|
38220
|
-
|
|
38218
|
+
const u = this.container.clientWidth, h = this.container.clientHeight;
|
|
38219
|
+
if (u === 0 || h === 0) return;
|
|
38220
|
+
const f = u * this.canvasPadding, g = h * this.canvasPadding;
|
|
38221
|
+
this.camera.aspect = f / g, this.camera.updateProjectionMatrix(), this.renderer.setSize(f, g);
|
|
38222
|
+
}, 100);
|
|
38221
38223
|
}, this.handleMouseMove = (u) => {
|
|
38222
38224
|
const h = this.container.getBoundingClientRect(), f = (u.clientX - h.left) / h.width * 2 - 1, g = -((u.clientY - h.top) / h.height) * 2 + 1;
|
|
38223
38225
|
this.targetRotation.x = g * 0.3, this.targetRotation.y = f * 0.3;
|
|
@@ -38235,19 +38237,19 @@ class Hd {
|
|
|
38235
38237
|
powerPreference: "high-performance"
|
|
38236
38238
|
}), this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)), this.renderer.setSize(r, a), this.renderer.setClearColor(0, 0);
|
|
38237
38239
|
const d = this.renderer.domElement;
|
|
38238
|
-
d.style.position = "absolute", d.style.left = "50%", d.style.top = "50%", d.style.transform = "translate(-50%, -50%)", d.style.pointerEvents = "none", e.appendChild(d), d.addEventListener("webglcontextlost", this.boundHandleContextLost), d.addEventListener("webglcontextrestored", this.boundHandleContextRestored), this.createOrb(), window.addEventListener("resize", this.handleResize), e.addEventListener("mousemove", this.handleMouseMove), e.addEventListener("mouseleave", this.handleMouseLeave);
|
|
38240
|
+
d.style.position = "absolute", d.style.left = "50%", d.style.top = "50%", d.style.transform = "translate(-50%, -50%)", d.style.pointerEvents = "none", e.appendChild(d), d.addEventListener("webglcontextlost", this.boundHandleContextLost), d.addEventListener("webglcontextrestored", this.boundHandleContextRestored), this.createOrb(), window.addEventListener("resize", this.handleResize), this.resizeObserver = new ResizeObserver(this.handleResize), this.resizeObserver.observe(e), e.addEventListener("mousemove", this.handleMouseMove), e.addEventListener("mouseleave", this.handleMouseLeave);
|
|
38239
38241
|
}
|
|
38240
38242
|
/**
|
|
38241
38243
|
* Handle WebGL context loss (iOS background transition)
|
|
38242
38244
|
*/
|
|
38243
38245
|
handleContextLost(e) {
|
|
38244
|
-
e.preventDefault(),
|
|
38246
|
+
e.preventDefault(), this.isContextLost = !0, this.stop();
|
|
38245
38247
|
}
|
|
38246
38248
|
/**
|
|
38247
38249
|
* Handle WebGL context restoration (iOS foreground transition)
|
|
38248
38250
|
*/
|
|
38249
38251
|
handleContextRestored(e) {
|
|
38250
|
-
|
|
38252
|
+
this.isContextLost = !1, this.recreateAfterContextLoss(), this.start();
|
|
38251
38253
|
}
|
|
38252
38254
|
/**
|
|
38253
38255
|
* Recreate WebGL resources after context loss
|
|
@@ -38363,7 +38365,7 @@ class Hd {
|
|
|
38363
38365
|
* Cleanup resources
|
|
38364
38366
|
*/
|
|
38365
38367
|
destroy() {
|
|
38366
|
-
this.stop(), this.resizeTimeoutId !== null && (clearTimeout(this.resizeTimeoutId), this.resizeTimeoutId = null), window.removeEventListener("resize", this.handleResize), this.container.removeEventListener("mousemove", this.handleMouseMove), this.container.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
38368
|
+
this.stop(), this.resizeTimeoutId !== null && (clearTimeout(this.resizeTimeoutId), this.resizeTimeoutId = null), window.removeEventListener("resize", this.handleResize), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.container.removeEventListener("mousemove", this.handleMouseMove), this.container.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
38367
38369
|
const e = this.renderer.domElement;
|
|
38368
38370
|
e.removeEventListener("webglcontextlost", this.boundHandleContextLost), e.removeEventListener("webglcontextrestored", this.boundHandleContextRestored), this.orb && (this.orb.geometry.dispose(), this.scene.remove(this.orb), this.orb = null), this.glowMesh && (this.glowMesh.geometry.dispose(), this.scene.remove(this.glowMesh), this.glowMesh = null), this.orbMaterial && (this.orbMaterial.dispose(), this.orbMaterial = null), this.glowMaterial && (this.glowMaterial.dispose(), this.glowMaterial = null), this.renderer.dispose(), e.parentNode && e.parentNode.removeChild(e);
|
|
38369
38371
|
}
|