45 lines
1.9 KiB
HTML
45 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Magnoliyan Video Chat</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="../../mgVideoChat/mgVideoChat-1.18.0.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>MgVChat <small>Reconnect</small></h1>
|
|
<div class="alert alert-info" role="alert">
|
|
If no one else is in the room, please open the same page in other tab to do self-test.
|
|
</div>
|
|
</div>
|
|
<div id="mgVideoChat"></div>
|
|
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
|
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
|
|
<!-- Video Chat -->
|
|
<script src="../../mgVideoChat/mgVideoChat-1.18.0-min.js"></script>
|
|
<script src="../common/js/menu.js"></script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
let mgChat = $('#mgVideoChat').mgVideoChat({
|
|
wsURL: wsUrlDefault + '?room=1'
|
|
});
|
|
//get low level rtc object
|
|
rtc = mgChat.getRtc();
|
|
//attach to rtc object low level events
|
|
rtc.on('connected', function(data) {
|
|
console.log('connected', data);
|
|
mgChat.$messagePanel.hide();
|
|
});
|
|
rtc.on('socket_closed', function(data) {
|
|
console.log('socket_closed', data);
|
|
setTimeout(function() {
|
|
console.log("reconnecting....");
|
|
rtc.connect(mgChat.config.wsURL);
|
|
}, 3000);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |