-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: janusweb action: commit revision: path_from: revision_from: a22032875b185471dd36f3f31d3b0c6454a7b273: path_to: revision_to:
commit a22032875b185471dd36f3f31d3b0c6454a7b273 Author: James Baicoianu <james_github@baicoianu.com> Date: Fri Jan 13 21:11:09 2017 -0800 Added more instructions to README diff --git a/README.md b/README.md
--- a/README.md +++ b/README.md @@ -15,9 +15,59 @@ browser. - Supports hand tracking peripherals like Leap Motion, Oculus Touch, and Vive controllers - Networking support -## Installing +## Using -To build JanusWeb, run the following commands: +There are several different ways to use JanusWeb, depending on how much control you want to +have over the whole system. + +### Use our viewer +Our default viewer is always available at https://web.janusvr.com/. You can write an HTML +page with your [JanusVR Markup](http://janusvr.com/guide/markuplanguage/index.html) and host +it anywhere you would normally host a static website. Any regular webhost, AWS S3 static +sites, CDNs, or even more exotic locations like [IPFS distributed filesystems](https://ipfs.io) will work. +Then just load your page in our viewer by entering the URL into the navigation bar, and you +can link to it and share on social media. + +### Pull our scripts into your page +Using the above method, all of your links would go through our servers. If you'd prefer to +link to your own servers, you can pull our JS into your page and use JanusWeb as a scriptable +client via its API. This looks something like this: + +```html +<html> + <head> + <title>My JanusVR Room</title> + </head> + <body> + <FireBoxRoom> + <Room use_local_asset="room1"> + <Object id="cube" pos="0 1 5" /> + <Text col="1 0 0" pos="0 2 4">My First Room</Text> + </Room> + </FireBoxRoom> + <script src="https://web.janusvr.com/janusweb.js"></script> + <script>elation.janusweb.init({url: document.location.href})</script> + </body> +</html> +``` + +The `elation.janusweb.init()` function can take a number of arguments, and returns a promise which +receives an instance of the client. This client reference can be controlled via its API. See the +sections on Arguments and Scripting below. + +### Install from ZIPs +(TODO - we will start shipping zip builds of JanusWeb once we release v1.0) + +### Install from NPM +(TODO - we will start shipping official NPM packages of JanusWeb once we release v1.0) +```bash +npm install janusweb +``` + +### Build from source + +If you'd like to build JanusWeb from source, you can check it out from Github and build using the +following steps: ```bash $ git clone https://github.com/jbaicoianu/janusweb @@ -26,8 +76,76 @@ $ npm install $ npm run build ``` -This will give you a full build of the latest verson of JanusWeb in your `build/` -directory. This directory can be hosted anywhere you would normally host static -HTML, and you can place your default ```<FireBoxRoom>``` within this file. +This will give you a full build of the latest verson of JanusWeb in your `build/` directory. You +can then modify `build/index.html` however you see fit, and host it as suggested above. + +NOTE - if you see errors relating to node-canvas, make sure your system has `libgif-dev` installed. + +## Arguments +JanusWeb supports several arguments at initialization time to control how it behaves. + +<table> + <th><td> Name </td><td> Description </td><td> Default </td></th> + <tr><td> homepage </td><td> Default page to go to when user presses + home button </td><td> https://web.janusvr.com/ </td></tr> + <tr><td> url </td><td> Default page to load </td><td> (homepage) </td></tr> + <tr><td> shownavigation </td><td> Control visibility of navigation bar </td><td> true </td></tr> + <tr><td> showchat </td><td> Control visibility of chat </td><td> true </td></tr> + <tr><td> usevoip </td><td> Enable or disable VOIP functionality + (NOTE - disabled pending browser support + for Opus via WebAudio) </td><td> false </td></tr> + <tr><td> resolution </td><td> If specified, restrict the renderer to + a the specified size </td><td> (none) </td></tr> + <tr><td> networking </td><td> Enable or disable networking </td><td> true </td></tr> + <tr><td> autoload </td><td> Load URL by default or wait for script </td><td> true </td></tr> +</table> + +## Scripting +After initializing the client, `elation.janusweb.init()` returns a Promise which returns a reference to the client. +You can programatically control this client to do all sorts of things. For instance, we can make the client load a +URL, wait for the room and all of its assets to load, and then take a screenshot of the page: + +```javascript +var pageinfo = elation.utils.parseURL(document.location.href), + urlargs = pageinfo.args || {}, + hashargs = pageinfo.hash || {}; + +var url = elation.utils.any(hashargs.url, urlargs.url, 'http://www.janusvr.com/index.html'); +var delay = elation.utils.any(hashargs.delay, urlargs.delay, 1000); + +elation.janusweb.init({ + url: url, + resolution: '1920x1080', + showchat: false, + shownavigation: false +}).then(function(client) { + elation.events.add(client.janusweb.currentroom, 'room_load_complete', function() { + setTimeout(function() { + client.hideMenu(); + client.screenshot(types[type]).then(function(imagefile) { + // upload imagefile somewhere via REST API + console.log('Screenshot complete!'); + }); + }, delay); + }); +}); + +``` + +Many other aspects of the JanusWeb client can be controlled this way as well. Our users are +always thinking up new and inventive ways of using the JanusWeb client. Embed it in your blog +posts, use it to render 3D content behind your 2d webpage, put a virtual security camera in your +world and view a live stream of the virtual world from any web browser. Control the virtual world +via a web interface. This is your scriptable live portal into the metaverse, to do with whatever +you please. The possibilities are endless! + +You can even run JanusWeb in NodeJS for headless server-side operations. Use it to write a bot that +wanders the metaverse, or run your game logic and physics on a server to have one authoritative +source of state for your world. If this sounds interesting to you let us know, we will be more +than happy to help you through this (it's all very experimental right now!) + +## Contributing +JanusWeb is open source, and we welcome any contributions! Please do report bugs using GitHub Issues, +and all pull requests will be considered. We could especially use help with documentation! + -See [JanusVR Markup Documentation](http://janusvr.com/guide/markuplanguage/index.html) for a full reference of supported markup.
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 18:33:29 2024