This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Warning this is pretty hacky as you need to change the URL for the room to end with the scene ID. Maybe there is a better way to query the scene ID based on the url, but the spoke only allows to set URL so this is what I imagined late in the evening. | |
// open-media-button.js | |
} else if (await isHubsRoomUrl(this.src)) { | |
// Get the 6 last letters of the name of the url (that you set up as the Scene ID) | |
let lastSix = this.src.substr(this.src.length - 6); // Should be something like "avC5IO" | |
// use modified Utopiah script | |
let bestRoom = getBestRoom(lastSix); | |
await exitImmersive(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the URL of a Hubs room that is not empty nor at room capacity | |
// Warning: the proper API is being defined at https://github.com/mozilla/reticulum/pull/382 | |
let getBestRoom = async () => { | |
// by https://twitter.com/jamesckane for @paracreative worked on the #ApartPosters show. | |
// let endpoint = "https://show.apartposters.com/api/v1/media/search?source=rooms&filter=public"; | |
let endpoint = "/api/v1/media/search?source=rooms&filter=public"; | |
let response = await fetch(endpoint); | |
let json = await response.json(); | |
let rooms = json.entries; | |
let bestRoom = {}; |