const skylink = new Skylink(config);
const showloader = () => {
// show a loader and hide the view from the client
}
const hideloader = () => {
// hide the loader and display the view on the client
}
// PEER_JOINED event with isSelf=true will always trigger before SERVER_PEER_JOINED event
// PEER_JOINED event with isSelf=false will trigger after the SERVER_PEER_JOINED event indicating that a remote peer has joined the room
SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.PEER_JOINED, () => {
// handle peer joined events as usual
});
SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.ON_INCOMING_STREAM, () => {
// handle stream events as usual
});
SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.SERVER_PEER_JOINED, () => {
// hideloader();
});
skylink.joinRoom(joinRoomOptions);
showloader();