63 lines
3.0 KiB
HTML
63 lines
3.0 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>coTURN</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>
|
|
<!-- Load the TURN Server API: -->
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
|
<script 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>
|
|
// This callback function will give us the iceServers:
|
|
$.ajax({
|
|
url: '../../../turn-rest-api/turn.php?username=magnoliyan',
|
|
xhrFields: {
|
|
withCredentials: false
|
|
},
|
|
success: function(data){
|
|
console.log(data);
|
|
var iceServers = [{'urls':'stun:stun.l.google.com:19302'}];
|
|
for(var i in data.uris){
|
|
iceServers.push({
|
|
'urls': data.uris[i],
|
|
'username': data.username,
|
|
'credential': data.password
|
|
});
|
|
};
|
|
console.log(iceServers);
|
|
$('#mgVideoChat').mgVideoChat({
|
|
wsURL: wsUrlDefault + '?room=1',
|
|
rtc: {
|
|
pcConfig: {
|
|
'iceServers': iceServers
|
|
},
|
|
pcConstraints: {"optional": [{"DtlsSrtpKeyAgreement": true}]},
|
|
offerConstraints: {"optional": [], "mandatory": {}},
|
|
mediaConstraints: {"audio": true, "video": true},
|
|
sdpConstraints: {
|
|
'mandatory': {
|
|
'OfferToReceiveAudio': true,
|
|
'OfferToReceiveVideo': true
|
|
}
|
|
},
|
|
audio_receive_codec: 'opus/48000'
|
|
}
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |