Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-command-permissions #6142

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions src/utils/chat-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const FLAG_ANIMATE_LOAD = "--animate";
const FLAG_NO_OBJECT_MENU = "--no-menu";
const ADD_FLAGS = [FLAG_RESIZE, FLAG_RECENTER, FLAG_ANIMATE_LOAD, FLAG_NO_OBJECT_MENU];
export function add(world: HubsWorld, avatarPov: Object3D, args: string[]) {
if (!APP.hubChannel!.can("spawn_and_move_media")) return;
args = args.filter(arg => arg);
if (args.length) {
const initialData = {
Expand Down
Loading