الملفات
codepill-sfu/widgets/example-2.html
2025-08-06 18:21:43 +02:00

45 أسطر
2.0 KiB
HTML

<!doctype html>
<html>
<head>
<script src="https://sfu.mirotalk.com/js/Widget.js"></script>
</head>
<body>
<script>
// Advanced configuration
window.addEventListener('DOMContentLoaded', function () {
if (typeof MiroTalkWidget !== 'undefined') {
const domain = 'sfu.mirotalk.com';
const roomId = 'support-room';
const userName = 'guest-' + Math.floor(Math.random() * 10000);
new MiroTalkWidget(domain, roomId, userName, {
theme: 'dark', // or 'light'
widgetState: 'normal', // 'normal', 'minimized', 'closed'
widgetType: 'support',
supportWidget: {
position: 'bottom-right', // 'bottom-right', 'bottom-left', 'top-right', 'top-left'
expertImages: [
'https://i.pravatar.cc/40?img=1',
'https://i.pravatar.cc/40?img=2',
'https://i.pravatar.cc/40?img=3',
],
checkOnlineStatus: false, // Check if experts are in the specified room
isOnline: true,
customMessages: {
heading: 'Need Help?',
subheading: 'Get instant support from our expert team!',
connectText: 'connect in < 5 seconds',
onlineText: 'We are online',
offlineText: 'We are offline',
poweredBy: 'Powered by MiroTalk SFU',
},
},
});
} else {
console.error('MiroTalkWidget is not defined. Please check Widget.js loading.');
}
});
</script>
</body>
</html>