UCL-VR / ubiq

Other
98 stars 34 forks source link

Browser Sample Refresh #30

Closed sebjf closed 1 year ago

sebjf commented 1 year ago

This PR updates the Browser samples (formerly Web samples), making sure that the principal sample is fully working with all the latest updates and that keeping it up to date in the future will be straightforward.

This is achieved by adding support for a bundler (rollup) which packages and shims the NodeJs code to create a js module that can be imported in a web page and used similarly to how it is in Node.

This is demonstrated by a new sample, hello.html, that allows users to join a room, see a 2D layout of participants, exchange RTC data, and explore the dictionaries and messages being sent in the room.

Though no conditionals have been added, a couple of tweaks have been made to how the Node js is written to make it more amenable to the browser. Additionally, a more complete set of Components have been added that are more useful for Browser peers, and existing APIs extended.

The NetworkId service hashing function has also been updated to only use operations available in the browser.

Due to that change, this version of Ubiq is incompatible with existing Peers, however it is compatible with the current version of the server and does not require a major version change.