Skip to content

Commit

Permalink
fix(arena-user): fixed load crash detecting arena-camera on slow netw…
Browse files Browse the repository at this point in the history
…orks
  • Loading branch information
mwfarb committed Aug 5, 2022
1 parent 926b649 commit cec3585
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/arena-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ AFRAME.registerComponent('arena-user', {
// frustum culling for WebRTC video streams;
if (this.videoID) {
let inFieldOfView = true;
if (arenaCameraComponent.isVideoFrustumCullingEnabled()) {
if (arenaCameraComponent && arenaCameraComponent.isVideoFrustumCullingEnabled()) {
if (this.el.contains(this.videoCube)) {
inFieldOfView = arenaCameraComponent.viewIntersectsObject3D(this.videoCube.object3D);
}
Expand All @@ -555,7 +555,7 @@ AFRAME.registerComponent('arena-user', {
} else if (inFieldOfView == false) {
this.muteVideo();
this.evaluateRemoteResolution(0);
} else if (arenaCameraComponent.isVideoDistanceConstraintsEnabled()) {
} else if (arenaCameraComponent && arenaCameraComponent.isVideoDistanceConstraintsEnabled()) {
// check if A/V cut off distance has been reached
if (distance > ARENA.maxAVDist) {
this.muteVideo();
Expand Down

0 comments on commit cec3585

Please sign in to comment.