Skip to content

Commit

Permalink
Ajout des commentaires du code
Browse files Browse the repository at this point in the history
  • Loading branch information
MouMou committed Mar 1, 2012
1 parent 516bd32 commit 0312b45
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 58 deletions.
119 changes: 73 additions & 46 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<!doctype html>
<html>
<head>
<title>WebRTC</title>
<!-- Stylesheet Ressources -->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Call the socket.io Ressources of the server -->
<script src="http://localhost:8888/socket.io/socket.io.js" type="text/javascript" charset="utf-8"></script>
<!-- JavaScript Ressources -->
<script src="js/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/webrtc.js" type="text/javascript" charset="utf-8"></script>.
<script src="js/global.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<!-- Modal Connection -->
<div class="modal hide fade" id="ModalConnection">
<div class="modal-header">
Expand All @@ -32,7 +41,9 @@
</div>
</div>
<!-- End of the Modal Connection -->
<!-- Modal About -->
<div class="modal hide fade" id="ModalAbout">
<div class="modal-header">
Expand All @@ -53,7 +64,9 @@
</div>
</div>
<!-- End of the Modal About -->
<!-- Navbar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
Expand All @@ -73,76 +86,90 @@
</div>
</div>
</div>
<!-- End of the Navbar -->
<!-- Content -->
<div class="container-fluid">
<!-- Introduction -->
<div class="hero-unit">
<p>This is a demo for testing WebRTC in a LAN between two clients with WebRTC support.</p>
</div>
<!-- End of Introduction -->
<div class="row-fluid">
<div class="span3">
<div class="row-fluid">
<div class="span12">
<h2 align="left">Local</h2>
<video width="100%" height="100%" id="localVideo" autoplay="autoplay"
style="opacity: 0;
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;">
</video>
<div class="span3">
<!-- Local Video -->
<div class="row-fluid">
<div class="span12">
<h2 align="left">Local</h2>
<video width="100%" height="100%" id="localVideo" autoplay="autoplay"
style="opacity: 0;
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;">
</video>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h2 align="left">Remote</h2>
<video width="100%" height="100%" id="remoteVideo" autoplay="autoplay"
style="opacity: 0;
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;">
</video>
<!-- End of Local Video -->
<!-- Remote Video -->
<div class="row-fluid">
<div class="span12">
<h2 align="left">Remote</h2>
<video width="100%" height="100%" id="remoteVideo" autoplay="autoplay"
style="opacity: 0;
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;">
</video>
</div>
</div>
</div>
<!-- End of Remote Video -->
</div>
<div class="span9">
<div class="row-fluid" align="center">
<div class="span12">
<img src="img/ppt.jpg" alt="PPT" width="500" height="500" />
</div>
</div>
<br>
<div class="row-fluid" align="center">
<div class="span12">
<h2 align="left">Chat</h2>
<form class="well form-inline">
<textarea class="input-xlarge" disabled="disabled" id="textarea" rows="2" style=" width: 820px; height: 40px; ">
</textarea>
<hr>
<input type="text" class="input span8" placeholder="Message">
<button id="send" class="btn btn-primary">Send</button>
</form>
<div class="span9">
<!-- Content (Power Point) -->
<div class="row-fluid" align="center">
<div class="span12">
<img src="img/ppt.jpg" alt="PPT" width="500" height="500" />
</div>
</div>
</div>
<!-- End of Content (Power Point) -->
<br>
<!-- Chat -->
<div class="row-fluid" align="center">
<div class="span12">
<h2 align="left">Chat</h2>
<form class="well form-inline">
<textarea class="input-xlarge" disabled="disabled" id="textarea" rows="2" style=" width: 820px; height: 40px; ">
</textarea>
<hr>
<input type="text" class="input span8" placeholder="Message">
<button id="send" class="btn btn-primary">Send</button>
</form>
</div>
</div>
<!-- End of Chat -->
</div>
</div>
</div>
<!-- Statut of the visio call -->
<div id="footer"></div>
<hr>
<footer>
<p>&copy; Atos Worldline 2012</p>
</footer>
<!-- Footer -->
<footer><p>&copy; Atos Worldline 2012</p></footer>
</div>
<!-- End of the Content -->
</body>
</html>
49 changes: 40 additions & 9 deletions js/global.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,63 @@
///////////////////////////////////////////////////////////
// Javascript file used for some events of the index.php //
///////////////////////////////////////////////////////////

$(function() {

/**
* Declare the variable nickname
*/
var nickname = $("#nickname");

/**
* The Modal Connection opens when the page is loaded
* @return {void}
*/
$('#ModalConnection').modal({
backdrop: "static",
keyboard: false
})

/**
* Validation of the user's connection
* @return {void}
*/
$("#loginSub").on("click", function(){
if(nickname.val() == ""){
nickname.parent('div').addClass("error");
nickname.siblings('span').removeClass('hide');
} else {
$('#username').text(nickname.val());
$('#ModalConnection').modal('hide');
initialize();
}
/**
* if the nickname is not entered : error
*/
if(nickname.val() == ""){
nickname.parent('div').addClass("error");
nickname.siblings('span').removeClass('hide');
/**
* else write the nickname in the right of the navbar
* and the Modal Connection closes when the user click on the "close button"
*/
} else {
$('#username').text(nickname.val());
$('#ModalConnection').modal('hide');
initialize();
}
});

/**
* The Modal About opens when the user click on the "about button" in the navbar
* @return {void}
*/
$("#about").on("click", function(){
$('#ModalAbout').modal({
backdrop: "static",
keyboard: false
})
});

/**
* The Modal About closes when the user click on the "close button"
* @return {void}
*/
$("#close").on("click", function(){
$('#ModalAbout').modal('hide');
});

});
});

6 changes: 3 additions & 3 deletions js/webrtc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////
// Javascript file used to make a viso call between 2 clients //
////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Javascript file used to make a visio call between 2 clients //
/////////////////////////////////////////////////////////////////

//-- Global variables declarations--//
var localVideo;
Expand Down

0 comments on commit 0312b45

Please sign in to comment.