[Pkg-voip-commits] [janus] 103/282: Aligned NoSIP branch to latest changes
Jonas Smedegaard
dr at jones.dk
Wed Dec 20 21:53:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.
commit def7be2654c2cd88100dd5ccd7aad4bc9d84fbd1
Author: Lorenzo Miniero <lminiero at gmail.com>
Date: Fri Sep 1 11:54:36 2017 +0200
Aligned NoSIP branch to latest changes
---
html/nosiptest.html | 2 +-
html/nosiptest.js | 41 +++++++++++++++++++++++++----------------
plugins/janus_nosip.c | 3 +--
3 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/html/nosiptest.html b/html/nosiptest.html
index 37a257c..189f52f 100644
--- a/html/nosiptest.html
+++ b/html/nosiptest.html
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Janus WebRTC Gateway: NoSIP (SDP/RTP)</title>
-<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/webrtc-adapter/3.4.3/adapter.min.js" ></script>
+<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/webrtc-adapter/5.0.1/adapter.min.js" ></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js" ></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js" ></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/js/bootstrap.min.js"></script>
diff --git a/html/nosiptest.js b/html/nosiptest.js
index c9c9825..942059e 100644
--- a/html/nosiptest.js
+++ b/html/nosiptest.js
@@ -156,7 +156,7 @@ $(document).ready(function() {
},
onmessage: function(msg, jsep) {
Janus.debug("[caller] ::: Got a message :::");
- Janus.debug(JSON.stringify(msg));
+ Janus.debug(msg);
// Any error?
var error = msg["error"];
if(error) {
@@ -194,7 +194,7 @@ $(document).ready(function() {
},
onlocalstream: function(stream) {
Janus.debug("[caller] ::: Got a local stream :::");
- Janus.debug(JSON.stringify(stream));
+ Janus.debug(stream);
if($('#myvideo').length === 0) {
$('#videos').removeClass('hide').show();
$('#videoleft').append('<video class="rounded centered" id="myvideo" width=320 height=240 autoplay muted="muted"/>');
@@ -230,26 +230,35 @@ $(document).ready(function() {
},
onremotestream: function(stream) {
Janus.debug("[caller] ::: Got a remote stream :::");
- Janus.debug(JSON.stringify(stream));
- if($('#peervideo').length === 0) {
- $('#videos').removeClass('hide').show();
- $('#videoright').append('<video class="rounded centered hide" id="peervideo" width=320 height=240 autoplay/>');
- // Show the video and hide the spinner
- $("#peervideo").bind("playing", function () {
- $('#waitingvideo').remove();
- $('#peervideo').removeClass('hide');
- if(spinner !== null && spinner !== undefined)
- spinner.stop();
- spinner = null;
- });
+ Janus.debug(stream);
+ if($('#peervideo').length > 0) {
+ // Been here already: let's see if anything changed
+ var videoTracks = stream.getVideoTracks();
+ if(videoTracks && videoTracks.length > 0 && !videoTracks[0].muted) {
+ $('#novideo').remove();
+ if($("#peervideo").get(0).videoWidth)
+ $('#peervideo').show();
+ }
+ return;
}
+ $('#videos').removeClass('hide').show();
+ $('#videoright').append('<video class="rounded centered hide" id="peervideo" width=320 height=240 autoplay/>');
+ // Show the video and hide the spinner
+ $("#peervideo").bind("playing", function () {
+ $('#waitingvideo').remove();
+ if(this.videoWidth)
+ $('#peervideo').removeClass('hide');
+ if(spinner !== null && spinner !== undefined)
+ spinner.stop();
+ spinner = null;
+ });
Janus.attachMediaStream($('#peervideo').get(0), stream);
var videoTracks = stream.getVideoTracks();
if(videoTracks === null || videoTracks === undefined || videoTracks.length === 0 || videoTracks[0].muted) {
// No remote video
$('#peervideo').hide();
$('#videoright').append(
- '<div class="no-video-container">' +
+ '<div id="novideo" class="no-video-container">' +
'<i class="fa fa-video-camera fa-5 no-video-icon"></i>' +
'<span class="no-video-text">No remote video available</span>' +
'</div>');
@@ -314,7 +323,7 @@ $(document).ready(function() {
},
onmessage: function(msg, jsep) {
Janus.debug("[callee] ::: Got a message :::");
- Janus.debug(JSON.stringify(msg));
+ Janus.debug(msg);
// Any error?
var error = msg["error"];
if(error) {
diff --git a/plugins/janus_nosip.c b/plugins/janus_nosip.c
index 3abb22a..63b289c 100644
--- a/plugins/janus_nosip.c
+++ b/plugins/janus_nosip.c
@@ -238,7 +238,7 @@ typedef struct janus_nosip_session {
} janus_nosip_session;
static GHashTable *sessions;
static GList *old_sessions;
-static janus_mutex sessions_mutex;
+static janus_mutex sessions_mutex = JANUS_MUTEX_INITIALIZER;
/* SRTP stuff (in case we need SDES) */
@@ -479,7 +479,6 @@ int janus_nosip_init(janus_callbacks *callback, const char *config_path) {
#endif
sessions = g_hash_table_new(NULL, NULL);
- janus_mutex_init(&sessions_mutex);
messages = g_async_queue_new_full((GDestroyNotify) janus_nosip_message_free);
/* This is the callback we'll need to invoke to contact the gateway */
gateway = callback;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git
More information about the Pkg-voip-commits
mailing list