Skip to content
Snippets Groups Projects
Commit 970c1d60 authored by Brian Peiris's avatar Brian Peiris
Browse files

Merge remote-tracking branch 'origin/hub-ids' into feature/bots

parents 08c30875 61fa6652
No related branches found
No related tags found
No related merge requests found
...@@ -211,7 +211,7 @@ const onReady = async () => { ...@@ -211,7 +211,7 @@ const onReady = async () => {
} }
}; };
const enterScene = async (mediaStream, enterInVR, janusRoomId) => { const enterScene = async (mediaStream, enterInVR, hubId) => {
const scene = document.querySelector("a-scene"); const scene = document.querySelector("a-scene");
const playerRig = document.querySelector("#player-rig"); const playerRig = document.querySelector("#player-rig");
document.querySelector("a-scene canvas").classList.remove("blurred"); document.querySelector("a-scene canvas").classList.remove("blurred");
...@@ -226,7 +226,7 @@ const onReady = async () => { ...@@ -226,7 +226,7 @@ const onReady = async () => {
document.querySelector("#player-camera").setAttribute("look-controls", ""); document.querySelector("#player-camera").setAttribute("look-controls", "");
scene.setAttribute("networked-scene", { scene.setAttribute("networked-scene", {
room: janusRoomId, room: hubId,
serverURL: process.env.JANUS_SERVER serverURL: process.env.JANUS_SERVER
}); });
...@@ -380,11 +380,11 @@ const onReady = async () => { ...@@ -380,11 +380,11 @@ const onReady = async () => {
}); });
environmentRoot.appendChild(initialEnvironmentEl); environmentRoot.appendChild(initialEnvironmentEl);
const setRoom = (janusRoomId, hubName) => { const setRoom = (hubId, hubName) => {
if (!isBotMode) { if (!isBotMode) {
remountUI({ janusRoomId, hubName }); remountUI({ hubId, hubName });
} else { } else {
const enterSceneImmediately = () => enterScene(new MediaStream(), false, janusRoomId); const enterSceneImmediately = () => enterScene(new MediaStream(), false, hubId);
if (scene.hasLoaded) { if (scene.hasLoaded) {
enterSceneImmediately(); enterSceneImmediately();
} else { } else {
...@@ -395,7 +395,7 @@ const onReady = async () => { ...@@ -395,7 +395,7 @@ const onReady = async () => {
if (qs.room) { if (qs.room) {
// If ?room is set, this is `yarn start`, so just use a default environment and query string room. // If ?room is set, this is `yarn start`, so just use a default environment and query string room.
setRoom(qs.room && !isNaN(parseInt(qs.room)) ? parseInt(qs.room) : 1); setRoom(qs.room || "default");
initialEnvironmentEl.setAttribute("gltf-bundle", { initialEnvironmentEl.setAttribute("gltf-bundle", {
src: DEFAULT_ENVIRONMENT_URL src: DEFAULT_ENVIRONMENT_URL
}); });
...@@ -425,7 +425,7 @@ const onReady = async () => { ...@@ -425,7 +425,7 @@ const onReady = async () => {
const hub = data.hubs[0]; const hub = data.hubs[0];
const defaultSpaceTopic = hub.topics[0]; const defaultSpaceTopic = hub.topics[0];
const gltfBundleUrl = defaultSpaceTopic.assets.find(a => a.asset_type === "gltf_bundle").src; const gltfBundleUrl = defaultSpaceTopic.assets.find(a => a.asset_type === "gltf_bundle").src;
setRoom(defaultSpaceTopic.janus_room_id, hub.name); setRoom(hub.hub_id, hub.name);
initialEnvironmentEl.setAttribute("gltf-bundle", `src: ${gltfBundleUrl}`); initialEnvironmentEl.setAttribute("gltf-bundle", `src: ${gltfBundleUrl}`);
hubChannel.setPhoenixChannel(channel); hubChannel.setPhoenixChannel(channel);
}) })
......
...@@ -64,9 +64,9 @@ class UIRoot extends Component { ...@@ -64,9 +64,9 @@ class UIRoot extends Component {
showProfileEntry: PropTypes.bool, showProfileEntry: PropTypes.bool,
availableVREntryTypes: PropTypes.object, availableVREntryTypes: PropTypes.object,
initialEnvironmentLoaded: PropTypes.bool, initialEnvironmentLoaded: PropTypes.bool,
janusRoomId: PropTypes.number,
roomUnavailableReason: PropTypes.string, roomUnavailableReason: PropTypes.string,
platformUnsupportedReason: PropTypes.string, platformUnsupportedReason: PropTypes.string,
hubId: PropTypes.string,
hubName: PropTypes.string, hubName: PropTypes.string,
occupantCount: PropTypes.number occupantCount: PropTypes.number
}; };
...@@ -488,7 +488,7 @@ class UIRoot extends Component { ...@@ -488,7 +488,7 @@ class UIRoot extends Component {
screenfull.request(); screenfull.request();
} }
this.props.enterScene(this.state.mediaStream, this.state.enterInVR, this.props.janusRoomId); this.props.enterScene(this.state.mediaStream, this.state.enterInVR, this.props.hubId);
const mediaStream = this.state.mediaStream; const mediaStream = this.state.mediaStream;
...@@ -572,7 +572,7 @@ class UIRoot extends Component { ...@@ -572,7 +572,7 @@ class UIRoot extends Component {
); );
} }
if (!this.props.initialEnvironmentLoaded || !this.props.availableVREntryTypes || !this.props.janusRoomId) { if (!this.props.initialEnvironmentLoaded || !this.props.availableVREntryTypes || !this.props.hubId) {
return ( return (
<IntlProvider locale={lang} messages={messages}> <IntlProvider locale={lang} messages={messages}>
<div className="loading-panel"> <div className="loading-panel">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment