50 lines
2.2 KiB
HTML
50 lines
2.2 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.14.1.css">
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="container">
|
||
|
|
<h1>MgVChat <small>Events API</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.14.1-min.js"></script>
|
||
|
|
<script src="../common/js/menu.js"></script>
|
||
|
|
<script>
|
||
|
|
$(document).ready(function(){
|
||
|
|
var mgChat = $('#mgVideoChat').mgVideoChat({
|
||
|
|
wsURL: wsUrlDefault + '?room=1'
|
||
|
|
});
|
||
|
|
//on call status change
|
||
|
|
$('#mgVideoChat').mgVideoChat('on','call_status',function(connectionId, status){
|
||
|
|
console.log('[mgVideoChat.call_status] fired',connectionId, status);
|
||
|
|
});
|
||
|
|
//on chat message
|
||
|
|
$('#mgVideoChat').mgVideoChat('on','chat_message',function(data){
|
||
|
|
console.log('[mgVideoChat.chat_message] fired', data);
|
||
|
|
});
|
||
|
|
//on logged in
|
||
|
|
$('#mgVideoChat').mgVideoChat('on','logged',function(){
|
||
|
|
console.log('[mgVideoChat.logged] fired');
|
||
|
|
});
|
||
|
|
|
||
|
|
var rtc = mgChat.getRtc();
|
||
|
|
//lower level api
|
||
|
|
rtc.on('chat_message', function(data) {
|
||
|
|
console.log('[mgRtc.chat_message] fired', data);
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|