Skip to content

Commit 7083bf8

Browse files
author
Avaer Kazmer
committed
Handle land owner rtc disconnect
1 parent 93915dc commit 7083bf8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,22 @@
486486
skinMeshes.splice(skinMeshes.indexOf(skinMesh), 1);
487487
skinMesh = null;
488488
}
489+
if (landState) {
490+
// remove owned xr-iframes
491+
492+
const landXrIframe = root.childNodes[0];
493+
const ownedXrIframes = _getOwnedXrIframes(landXrIframe);
494+
for (let i = 0; i < ownedXrIframes.length; i++) {
495+
const ownedXrIframe = ownedXrIframes[i];
496+
const match = ownedXrIframe.match(/^owned:(.*?)-/);
497+
if (match) {
498+
const ownerId = match[1];
499+
if (ownerId === peerConnectionId) {
500+
ownedXrIframe.parentNode.removeChild(ownedXrIframe);
501+
}
502+
}
503+
}
504+
}
489505
};
490506
peerConnection.connectionId = peerConnectionId;
491507
peerConnection.open = false;

0 commit comments

Comments
 (0)