diff --git a/package.json b/package.json index 0d9ed6b57e38dc448a3da828e3acb5cc24a33035..f1e218e7e16627e1e0eb60553c1e420f031f20c8 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,8 @@ "moment": "^2.22.0", "moment-timezone": "^0.5.14", "moving-average": "^1.0.0", - "naf-janus-adapter": "^0.5.2", - "networked-aframe": "https://github.com/mozillareality/networked-aframe#mr-social-client/master", + "naf-janus-adapter": "github:mozilla/naf-janus-adapter#69d179badde1c6a888ccb3718579eae9a7c5ffca", + "networked-aframe": "https://github.com/mozillareality/networked-aframe#bp-built", "nipplejs": "^0.6.7", "phoenix": "^1.3.0", "query-string": "^5.0.1", diff --git a/src/hub.js b/src/hub.js index 89ebcc4687a8e819f281eeee9f628f3d135a1623..382d4b56c04de413a64c78aba13d5d33848f420a 100644 --- a/src/hub.js +++ b/src/hub.js @@ -248,6 +248,19 @@ const onReady = async () => { hubChannel.sendEntryEvent().then(() => { store.update({ lastEnteredAt: moment().toJSON() }); }); + remountUI({ participantCount: NAF.connection.adapter.publisher.initialOccupants.length + 1 }); + }); + + document.body.addEventListener("clientConnected", () => { + remountUI({ + participantCount: Object.values(NAF.connection.activeDataChannels).filter(active => active).length + 1 + }); + }); + + document.body.addEventListener("clientDisconnected", () => { + remountUI({ + participantCount: Object.values(NAF.connection.activeDataChannels).filter(active => active).length + 1 + }); }); scene.components["networked-scene"].connect().catch(connectError => { diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js index e7bc7c81ed66f84a86d9b650191008ae1510b273..8b3c590f970da185c2f1ab64fe24a69f766e967e 100644 --- a/src/react-components/ui-root.js +++ b/src/react-components/ui-root.js @@ -66,8 +66,9 @@ class UIRoot extends Component { availableVREntryTypes: PropTypes.object, initialEnvironmentLoaded: PropTypes.bool, janusRoomId: PropTypes.number, + roomUnavailableReason: PropTypes.string, hubName: PropTypes.string, - roomUnavailableReason: PropTypes.string + participantCount: PropTypes.number }; state = { @@ -771,7 +772,7 @@ class UIRoot extends Component { {this.state.entryStep === ENTRY_STEPS.finished ? ( <div> <TwoDHUD muted={this.state.muted} onToggleMute={this.toggleMute} /> - <Footer hubName={this.props.hubName} /> + <Footer hubName={this.props.hubName} participantCount={this.props.participantCount} /> </div> ) : null} </div> diff --git a/yarn.lock b/yarn.lock index 6ae1ce2d8e2b6fb237724d975e27a2145a189ca7..49c4db03e9806d27368cc425edd28132553aae26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -118,7 +118,7 @@ accepts@1.3.3: mime-types "~2.1.11" negotiator "0.6.1" -accepts@~1.3.4: +accepts@~1.3.4, accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" dependencies: @@ -2007,14 +2007,18 @@ colormin@^1.0.5: css-color-names "0.0.4" has "^1.0.1" -colors@*, colors@^1.1.2, colors@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" +colors@*: + version "1.2.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.1.tgz#f4a3d302976aaf042356ba1ade3b1a2c62d9d794" colors@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" +colors@^1.1.2, colors@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + combine-source-map@~0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" @@ -3062,7 +3066,42 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -express@^4.10.7, express@^4.16.2: +express@^4.10.7: + version "4.16.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53" + dependencies: + accepts "~1.3.5" + array-flatten "1.1.1" + body-parser "1.18.2" + content-disposition "0.5.2" + content-type "~1.0.4" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.1.1" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.2" + path-to-regexp "0.1.7" + proxy-addr "~2.0.3" + qs "6.5.1" + range-parser "~1.2.0" + safe-buffer "5.1.1" + send "0.16.2" + serve-static "1.13.2" + setprototypeof "1.1.0" + statuses "~1.4.0" + type-is "~1.6.16" + utils-merge "1.0.1" + vary "~1.1.2" + +express@^4.16.2: version "4.16.2" resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c" dependencies: @@ -3268,6 +3307,18 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" +finalhandler@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.2" + statuses "~1.4.0" + unpipe "~1.0.0" + find-cache-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" @@ -5308,9 +5359,9 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -naf-janus-adapter@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/naf-janus-adapter/-/naf-janus-adapter-0.5.2.tgz#f4a9522c4e0b38fcbfe7c71b668afed67d5e133e" +"naf-janus-adapter@github:mozilla/naf-janus-adapter#69d179badde1c6a888ccb3718579eae9a7c5ffca": + version "0.5.1" + resolved "https://codeload.github.com/mozilla/naf-janus-adapter/tar.gz/69d179badde1c6a888ccb3718579eae9a7c5ffca" dependencies: debug "^3.1.0" minijanus "^0.5.0" @@ -5354,9 +5405,9 @@ neo-async@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f" -"networked-aframe@https://github.com/mozillareality/networked-aframe#mr-social-client/master": +"networked-aframe@https://github.com/mozillareality/networked-aframe#bp-built": version "0.6.1" - resolved "https://github.com/mozillareality/networked-aframe#69be0e7e5f66070526c8240cb795b9e88da971a9" + resolved "https://github.com/mozillareality/networked-aframe#a97379a3e33f6b08e3784b9057daec0c4c47c157" dependencies: easyrtc "1.1.0" express "^4.10.7" @@ -6334,7 +6385,7 @@ prop-types@^15.5.4, prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" -proxy-addr@~2.0.2: +proxy-addr@~2.0.2, proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" dependencies: @@ -7102,7 +7153,7 @@ serve-static@1.13.1: parseurl "~1.3.2" send "0.16.1" -serve-static@^1.10.0, serve-static@^1.8.0: +serve-static@1.13.2, serve-static@^1.10.0, serve-static@^1.8.0: version "1.13.2" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" dependencies: @@ -7914,7 +7965,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-is@~1.6.15: +type-is@~1.6.15, type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" dependencies: