The connect function is responsible for creating a connection between the clients.
functionconnect() {let displayed_name =document.getElementById('display_name').valuelet streamingToken =document.getElementById('session_token').valueif(!displayed_name ||!streamingToken)alert('Display name and token is empty or invalid! Please check and try again!')WTSDK.Session.connect( streamingToken, displayed_name );}
The onConnected function is used to define a callback that will be called when the local user's media stream is created. This callback can be used to perform various operations on the stream, such as displaying it in a video element.