This is an old revision of the document!
Displaying MusicalEnvironment Content (In browser)
Overview: Imagine. One day, there was a guy named Tom. He created a very complicated MusicalEnvironment but did understand it completely and could not see what it did clearly. He also wanted to show his teammates his current MusicalEnvironment so that they could explain to him.
Things To Note: This tutorial assumes you have already installed Konduktiva successfully using the Konduktiva installation instructions and have read through and understood the first steps tutorial. The tutorial also assumes that you have imported Konduktiva to the K variable and assigned any of the example MusicalEnvironments to the e variable.
Displaying Content Of MusicalEnvironment Through Web Sockets
Websockets protocol is used because it can be shared remotely over the internet as long as it is configured properly.
Activating WebSocket server
Will be automatically activated when Koduktiva module is loaded.
Connecting To The WebSocket Server
Wherever Konduktiva is installed, go there and open index.html in the browser.
Send MusicalEnvironment Information To The Browser
To send the MusicalEnvironment information use thesendClientEnvInfo method in the MusicalEnvironment class.
e.sendClientEnvInfo() //undefined
This will send the information of e to all clients connected. The full documentation of how to use this method can be found here. (INSERT LINK after done)
Changing WebSocketServer Port
Use the function called changeWebsocketServerPort like so:
K.wss = K.changeWebsocketServerPort(8081, K.wss)
Remember You have to reassign K.wss for it to work. Also pass K.wss as the last argument. The first argument is the new port.
Next you will have to change the port the client listens to inside the file test.js line 25. It looks like this currently change it to the port you want to: ``` const serverPort = 8080; Replace with the port number on which the server is running ``` After that save and reload the client browser page.