Skip to content

Commit

Permalink
Avoid unnecessary eid access
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Jun 23, 2023
1 parent 166f2f4 commit ac486ce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/scene-entry-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default class SceneEntryManager {
spawnFromFileList([src]);
}
} else {
spawnMediaInfrontOfPlayerAndReturn(src, contentOrigin).eid;
spawnMediaInfrontOfPlayerAndReturn(src, contentOrigin);
}
};

Expand Down Expand Up @@ -365,10 +365,12 @@ export default class SceneEntryManager {
} else {
currentVideoShareEntity = spawnMediaInfrontOfPlayerAndReturn(this.mediaDevicesManager.mediaStream, undefined);
// Wire up custom removal event which will stop the stream.
currentVideoShareEntity.setAttribute(
"emit-scene-event-on-remove",
`event:${MediaDevicesEvents.VIDEO_SHARE_ENDED}`
);
if (currentVideoShareEntity) {
currentVideoShareEntity.setAttribute(
"emit-scene-event-on-remove",
`event:${MediaDevicesEvents.VIDEO_SHARE_ENDED}`
);
}
}

this.scene.emit("share_video_enabled", { source: isDisplayMedia ? MediaDevices.SCREEN : MediaDevices.CAMERA });
Expand Down

0 comments on commit ac486ce

Please sign in to comment.