// Create an instance
const smeeting = new SMeeting({
logLevel: LogLevel.DEBUG,
logTarget: LogTarget.CONSOLE,
});
// Check environment information
const envinfo = smeeting.getEnvInfo();
console.log("environment", envinfo);
if(!envinfo.supported) {
alert("SMeeting is not supported in this environment. Switch to the latest version of Chrome.");
} else {
if(!envinfo.mediaDevices) {
if(!envinfo.secure) {
alert("This is not a secure context (https, localhost, or 127.0.0.1). Media devices such as the mic and camera cannot be accessed for audio and video capture and publishing.");
} else {
alert("This environment does not support accessing devices. Media devices such as the mic and camera cannot be accessed for audio and video capture and publishing.");
}
}
if(!envinfo.h264Enc) {
alert("This environment does not support H264 encoding. Publishing is unavailable.");
}
if(!envinfo.h264Dec) {
alert("This environment does not support H264 decoding. Receiving streams is unavailable.");
}
if(!envinfo.screenshare) {
alert("This environment does not support starting screen sharing.");
}
}
// Handle event callbacks
smeeting.onNotifyRoomEvent = (evt: RoomEvent) => {
console.log('Meeting event received', evt);
switch (evt.type) {
// ...
}
})