reinit project
No files matched your search
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -6,85 +6,28 @@
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="shortcut icon" href="img/kurento.png" type="image/png" />
|
||||
|
||||
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="bower_components/demo-console/index.css">
|
||||
<link rel="stylesheet" href="bower_components/ekko-lightbox/dist/ekko-lightbox.min.css">
|
||||
<link rel="stylesheet" href="css/kurento.css">
|
||||
|
||||
|
||||
<script src="bower_components/adapter.js/adapter.js"></script>
|
||||
<script src="bower_components/jquery/dist/jquery.min.js"></script>
|
||||
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="bower_components/demo-console/index.js"></script>
|
||||
<script src="bower_components/ekko-lightbox/dist/ekko-lightbox.min.js"></script>
|
||||
|
||||
<script src="bower_components/kurento-utils/js/kurento-utils.js"></script>
|
||||
<script src="bower_components/io/dist/socket.io.js"></script>
|
||||
<script src="bower_components/socket.io-client/dist/socket.io.js"></script>
|
||||
|
||||
<script src="js/index.js"></script>
|
||||
<title>Kurento </title>
|
||||
<title>Steam</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
|
||||
</header>
|
||||
<video id="video" autoplay style="display: block; margin: 0 auto;"></video>
|
||||
|
||||
<div class="container">
|
||||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label for="roomName">Room:</label>
|
||||
<input class="input" id="roomName" value="default"/>
|
||||
<a id="call" href="#" class="btn btn-success">
|
||||
<span class="glyphicon glyphicon-play"></span> Presenter</a>
|
||||
<a id="viewer" href="#" class="btn btn-primary">
|
||||
<span class="glyphicon glyphicon-user"></span> Viewer</a>
|
||||
<a id="terminate" href="#" class="btn btn-danger">
|
||||
<span class="glyphicon glyphicon-stop"></span> Stop</a>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<label class="control-label" for="console">Console</label><br><br>
|
||||
<div id="console" class="democonsole">
|
||||
<ul></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<div id="videoBig">
|
||||
<video id="video" autoplay width="640px" height="480px" poster="img/webrtc.png"></video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="foot-fixed-bottom">
|
||||
<div class="container text-center">
|
||||
<hr/>
|
||||
<div class="row">© 2014-2015 Kurento</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<a href="http://www.urjc.es">
|
||||
<img src="img/urjc.gif" alt="Universidad Rey Juan Carlos" height="50px"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="http://www.kurento.org">
|
||||
<img src="img/kurento.png" alt="Kurento" height="50px"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="http://www.naevatec.com">
|
||||
<img src="img/naevatec.png" alt="Naevatec" height="50px"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -14,60 +14,68 @@
|
||||
*/
|
||||
|
||||
//var ws = new WebSocket('wss://' + location.host + '/one2many');
|
||||
|
||||
|
||||
var video;
|
||||
var webRtcPeer;
|
||||
var socket;
|
||||
var autoView = true;
|
||||
var room;
|
||||
|
||||
|
||||
function onError(msg){
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
socket = io();
|
||||
console = new Console();
|
||||
video = $('#video')[0];
|
||||
room = $('#roomName');
|
||||
|
||||
let url_string = window.location.href;
|
||||
let url = new URL(url_string);
|
||||
room = url.searchParams.get('room');
|
||||
|
||||
console.log(room);
|
||||
|
||||
socket = io('https://kurento.fishrungames.com/');
|
||||
|
||||
$('#call').on('click', function(e) { presenter(); e.preventDefault(); } );
|
||||
$('#viewer').on('click', function(e) { viewer(); e.preventDefault(); } );
|
||||
$('#terminate').on('click', function(e) { stop(); e.preventDefault();} );
|
||||
|
||||
|
||||
socket.on('connect', function(){
|
||||
console.log('Connected to socket');
|
||||
socket.on('connect', function(){
|
||||
console.log('Connected to socket');
|
||||
|
||||
socket.emit('subscribeToStream', currentRoom());
|
||||
socket.emit('subscribeToStream', currentRoom());
|
||||
});
|
||||
|
||||
socket.on('disconnect', function(){
|
||||
console.log('Disconnected from socket');
|
||||
dispose();
|
||||
});
|
||||
|
||||
socket.on('presenterResponse', function(data) {
|
||||
presenterResponse(data);
|
||||
});
|
||||
|
||||
socket.on('viewerResponse', function(data) {
|
||||
viewerResponse(data);
|
||||
});
|
||||
|
||||
socket.on('stopCommunication', function(data) {
|
||||
console.log('stopCommunication');
|
||||
dispose();
|
||||
});
|
||||
|
||||
socket.on('iceCandidate', function(data) {
|
||||
webRtcPeer.addIceCandidate(data.candidate)
|
||||
});
|
||||
|
||||
socket.on('streamStarted', function(data) {
|
||||
if (autoView) {
|
||||
viewer();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('disconnect', function(){
|
||||
console.log('Disconnected from socket');
|
||||
dispose();
|
||||
});
|
||||
|
||||
socket.on('presenterResponse', function(data) {
|
||||
presenterResponse(data);
|
||||
});
|
||||
|
||||
socket.on('viewerResponse', function(data) {
|
||||
viewerResponse(data);
|
||||
});
|
||||
|
||||
socket.on('stopCommunication', function(data) {
|
||||
console.log('stopCommunication');
|
||||
dispose();
|
||||
});
|
||||
|
||||
socket.on('iceCandidate', function(data) {
|
||||
webRtcPeer.addIceCandidate(data.candidate)
|
||||
});
|
||||
|
||||
socket.on('streamStarted', function(data) {
|
||||
if (autoView) {
|
||||
viewer();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
function presenterResponse(message) {
|
||||
if (message.response != 'accepted') {
|
||||
var errorMsg = message.message ? message.message : 'Unknown error';
|
||||
@@ -88,10 +96,6 @@ function viewerResponse(message) {
|
||||
}
|
||||
}
|
||||
|
||||
function onError(obj) {
|
||||
console.log(obj);
|
||||
}
|
||||
|
||||
function presenter() {
|
||||
if (!webRtcPeer) {
|
||||
showSpinner(video);
|
||||
@@ -127,7 +131,18 @@ function viewer() {
|
||||
|
||||
var options = {
|
||||
remoteVideo: video,
|
||||
onicecandidate : onIceCandidate
|
||||
onicecandidate : onIceCandidate,
|
||||
configuration: {
|
||||
iceServers:[
|
||||
{
|
||||
urls: 'turn:numb.viagenie.ca',
|
||||
credential: '170988abC',
|
||||
password: '170988abC',
|
||||
username: 'wow_123@bk.ru'
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(options, function(error) {
|
||||
@@ -193,7 +208,7 @@ function hideSpinner() {
|
||||
}
|
||||
|
||||
function currentRoom() {
|
||||
return $('#roomName').val();
|
||||
return room;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||