114 lines
3.4 KiB
HTML
114 lines
3.4 KiB
HTML
<!-- Demo version: 2019.01.09 -->
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en" dir="ltr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Video Conferencing using RTCMultiConnection</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
|
<link rel="shortcut icon" href="/include/videocall/demos/logo.png">
|
|
<link rel="stylesheet" href="/include/videocall/demos/stylesheet.css">
|
|
<script src="/include/videocall/demos/menu.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<h1>
|
|
Video Conferencing using RTCMultiConnection
|
|
<p class="no-mobile">
|
|
Multi-user (many-to-many) video chat using mesh networking model.
|
|
</p>
|
|
</h1>
|
|
|
|
<section class="make-center">
|
|
<div>
|
|
<label><input type="checkbox" id="record-entire-conference"> Record Entire Conference In The Browser?</label>
|
|
<span id="recording-status" style="display: none;"></span>
|
|
<button id="btn-stop-recording" style="display: none;">Stop Recording</button>
|
|
<br><br>
|
|
|
|
<input type="text" id="room-id" value="abcdef" autocorrect=off autocapitalize=off size=20>
|
|
<button id="open-room">Open Room</button>
|
|
<button id="join-room">Join Room</button>
|
|
<button id="open-or-join-room">Auto Open Or Join Room</button>
|
|
<button id="btnGetUserInfo">click</button>
|
|
</div>
|
|
|
|
<div id="videos-container" style="margin: 20px 0;"></div>
|
|
|
|
<div id="room-urls" style="text-align: center;display: none;background: #F1EDED;margin: 15px -10px;border: 1px solid rgb(189, 189, 189);border-left: 0;border-right: 0;"></div>
|
|
</section>
|
|
|
|
<script src="/include/videocall/dist/RTCMultiConnection.min.js"></script>
|
|
<script src="/include/videocall/demos/adapter.js"></script>
|
|
<script src="/include/videocall/demos/socket.io.js"></script>
|
|
|
|
<!-- custom layout for HTML5 audio/video elements -->
|
|
<link rel="stylesheet" href="/include/videocall/dev/getHTMLMediaElement.css">
|
|
<script src="/include/videocall/dev/getHTMLMediaElement.js"></script>
|
|
|
|
<script src="/include/videocall/demos/RecordRTC.js"></script>
|
|
|
|
|
|
<div id="users"></div>
|
|
|
|
|
|
<script>
|
|
var connection = new RTCMultiConnection();
|
|
|
|
// this line is VERY_important
|
|
connection.socketURL = 'https://cs3198.mojohost.com:9001/';
|
|
|
|
// if you want audio+video conferencing
|
|
connection.session = {
|
|
audio: false,
|
|
video: false
|
|
};
|
|
|
|
connection.open('ajaypw7wnyp', function(isRoomOpened, roomid, error) {
|
|
if(isRoomOpened === true) {
|
|
showRoomURL(connection.sessionid);
|
|
}
|
|
else {
|
|
disableInputButtons(true);
|
|
if(error === 'Room not available') {
|
|
alert('Someone already created this room. Please either join or create a separate room.');
|
|
return;
|
|
}
|
|
alert(error);
|
|
}
|
|
});
|
|
|
|
btnGetUserInfo.onclick = function() {
|
|
console.log(connection);
|
|
|
|
connection.getNumberOfBroadcastViewers('ajaypw7wnyp');
|
|
|
|
connection.getAllParticipants().forEach(function(participantId) {
|
|
var user = connection.peers[participantId];
|
|
var hisUID = user.userid;
|
|
alert(hisUID + ' connected with you.');
|
|
});
|
|
|
|
var numberOfUsers = connection.getAllParticipants('ajaypw7wnyp').length;
|
|
alert(numberOfUsers + ' users connected with you.');
|
|
|
|
var allUserStreams = connection.getRemoteStreams();
|
|
alert(allUserStreams);
|
|
};
|
|
|
|
//connection.openOrJoin('ajaypw7wnyp');
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<footer>
|
|
<small id="send-message"></small>
|
|
</footer>
|
|
|
|
<script src="https://cdn.webrtc-experiment.com/common.js"></script>
|
|
</body>
|
|
</html>
|