diff -Nru janus-0.10.8/bower.json janus-0.10.9/bower.json --- janus-0.10.8/bower.json 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/bower.json 2020-12-23 11:59:08.000000000 +0000 @@ -1,6 +1,6 @@ { "name": "janus-gateway", - "version": "0.10.8", + "version": "0.10.9", "homepage": "https://github.com/meetecho/janus-gateway", "authors": [ "Lorenzo Miniero ", diff -Nru janus-0.10.8/CHANGELOG.md janus-0.10.9/CHANGELOG.md --- janus-0.10.8/CHANGELOG.md 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/CHANGELOG.md 2020-12-23 11:59:08.000000000 +0000 @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. +## [v0.10.9] - 2020-12-23 + +- Replaced Travis CI with GitHub Actions [[PR-2486](#2486)] +- Fixed data channel messages potentially getting stuck in case of burst transfers (thanks @afshin2003!) [[PR-2427](#2427)] +- Fixed simulcast issues when renegotiating PeerConnections [[Issue-2466](#2466)] +- Added configurable TURN REST API timeout (thanks @evorw!) [[PR-2470](#2470)] +- Added support for recording of binary data channels [[PR-2481](#2481)] +- Fixed occasional SRTP errors when pausing and then resuming Streaming plugin handles after a long time +- Fixed occasional SRTP errors when leaving and joining AudioBridge rooms without a new PeerConnection after a long time +- Added support for playout of data channels in Record&Play plugin and demo (thanks @ricardo-salgado-tekever!) [[PR-2468](#2468)] +- Added option to override connections limit in HTTP transport plugin [[PR-2489](#2489)] +- Added options to enable libmicrohttpd debugging in HTTP transport plugin (thanks @evorw!) [[PR-2471](#2471)] +- Fixed a few compile and runtime issues in WebSocket event handler +- Refactored postprocessing management of timestamps to fix some key issues [[PR-2345](#2345)] +- Fixed postprocessing of audio recordings containing RTP silence suppression packets [[PR-2467](#2467)] +- Other smaller fixes and improvements (thanks to all who contributed pull requests and reported issues!) + ## [v0.10.8] - 2020-11-23 - Added differentiation between IPv4 and IPv6 NAT-1-1 addresses [[PR-2423](#2423)] diff -Nru janus-0.10.8/conf/janus.jcfg.sample.in janus-0.10.9/conf/janus.jcfg.sample.in --- janus-0.10.8/conf/janus.jcfg.sample.in 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/conf/janus.jcfg.sample.in 2020-12-23 11:59:08.000000000 +0000 @@ -294,12 +294,15 @@ # which is currently available in both rfc5766-turn-server and coturn. # You enable this by specifying the address of your TURN REST API backend, # the HTTP method to use (GET or POST) and, if required, the API key Janus - # must provide. Notice that the 'opaque_id' provided via Janus API will be - # used as the username for a specific PeerConnection by default; if that one - # is missing, the 'session_id' will be used as the username instead. + # must provide. The timeout can be configured in seconds, with a default of + # 10 seconds and a minimum of 1 second. Notice that the 'opaque_id' provided + # via Janus API will be used as the username for a specific PeerConnection + # by default; if that one is missing, the 'session_id' will be used as the + # username instead. #turn_rest_api = "http://yourbackend.com/path/to/api" #turn_rest_api_key = "anyapikeyyoumayhaveset" #turn_rest_api_method = "GET" + #turn_rest_api_timeout = 10 # You can also choose which interfaces should be explicitly used by the # gateway for the purpose of ICE candidates gathering, thus excluding diff -Nru janus-0.10.8/conf/janus.transport.http.jcfg.sample janus-0.10.9/conf/janus.transport.http.jcfg.sample --- janus-0.10.8/conf/janus.transport.http.jcfg.sample 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/conf/janus.transport.http.jcfg.sample 2020-12-23 11:59:08.000000000 +0000 @@ -5,6 +5,7 @@ # all the web servers will try and bind on both IPv4 and IPv6: if you # want to only bind to IPv4 addresses (e.g., because your system does not # support IPv6), you should set the web server 'ip' property to '0.0.0.0'. +# To see debug logs from the HTTP server library, set 'mhd_debug'. general: { #events = true # Whether to notify event handlers about transport events (default=true) json = "indented" # Whether the JSON messages should be indented (default), @@ -19,6 +20,8 @@ #secure_interface = "eth0" # Whether we should bind this server to a specific interface only #secure_ip = "192.168.0.1" # Whether we should bind this server to a specific IP address (v4 or v6) only #acl = "127.,192.168.0." # Only allow requests coming from this comma separated list of addresses + #mhd_connection_limit = 1020 # Open connections limit in libmicrohttpd (default=1020) + #mhd_debug = false # Ask libmicrohttpd to write warning and error messages to stderr (default=false) } # Janus can also expose an admin/monitor endpoint, to allow you to check diff -Nru janus-0.10.8/configure.ac janus-0.10.9/configure.ac --- janus-0.10.8/configure.ac 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/configure.ac 2020-12-23 11:59:08.000000000 +0000 @@ -1,4 +1,4 @@ -AC_INIT([Janus WebRTC Server],[0.10.8],[https://github.com/meetecho/janus-gateway],[janus-gateway],[https://janus.conf.meetecho.com]) +AC_INIT([Janus WebRTC Server],[0.10.9],[https://github.com/meetecho/janus-gateway],[janus-gateway],[https://janus.conf.meetecho.com]) AC_LANG(C) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([m4]) @@ -69,9 +69,9 @@ -Wunused-but-set-variable" esac -JANUS_VERSION=108 +JANUS_VERSION=109 AC_SUBST(JANUS_VERSION) -JANUS_VERSION_STRING="0.10.8" +JANUS_VERSION_STRING="0.10.9" AC_SUBST(JANUS_VERSION_STRING) case "$host_os" in @@ -522,6 +522,13 @@ AC_SUBST([MHD_CFLAGS]) AC_SUBST([MHD_LIBS]) AM_CONDITIONAL([ENABLE_REST], [test "x$enable_rest" = "xyes"]) +AM_COND_IF([ENABLE_REST], + [ + AC_CHECK_TYPES([enum MHD_Result], + [], + [], + [#include ]) + ]) AC_CHECK_LIB([websockets], [lws_create_vhost], diff -Nru janus-0.10.8/debian/changelog janus-0.10.9/debian/changelog --- janus-0.10.8/debian/changelog 2020-12-02 20:56:16.000000000 +0000 +++ janus-0.10.9/debian/changelog 2020-12-25 19:11:10.000000000 +0000 @@ -1,3 +1,13 @@ +janus (0.10.9-1) unstable; urgency=medium + + [ upstream ] + * new release + + [ Jonas Smedegaard ] + * update and unfuzz patches + + -- Jonas Smedegaard Fri, 25 Dec 2020 20:11:10 +0100 + janus (0.10.8-2) unstable; urgency=medium * use brotli compression suffix .brotli diff -Nru janus-0.10.8/debian/copyright_hints janus-0.10.9/debian/copyright_hints --- janus-0.10.8/debian/copyright_hints 2020-11-23 14:26:26.000000000 +0000 +++ janus-0.10.9/debian/copyright_hints 2020-12-25 19:10:51.000000000 +0000 @@ -369,6 +369,8 @@ postprocessing/pcap2mjr.c postprocessing/pp-av1.c postprocessing/pp-av1.h + postprocessing/pp-binary.c + postprocessing/pp-binary.h postprocessing/pp-g711.c postprocessing/pp-g711.h postprocessing/pp-g722.c diff -Nru janus-0.10.8/debian/patches/1003_javascript_config.patch janus-0.10.9/debian/patches/1003_javascript_config.patch --- janus-0.10.8/debian/patches/1003_javascript_config.patch 2020-10-30 11:13:35.000000000 +0000 +++ janus-0.10.9/debian/patches/1003_javascript_config.patch 2020-12-25 18:18:55.000000000 +0000 @@ -260,7 +260,7 @@ var janus = null; var echotest = null; var opaqueId = "devicetest-"+Janus.randomString(12); -@@ -206,15 +156,9 @@ +@@ -200,15 +150,9 @@ janus = new Janus( { server: server, @@ -508,7 +508,7 @@ var janus = null; var recordplay = null; var opaqueId = "recordplaytest-"+Janus.randomString(12); -@@ -84,6 +34,9 @@ +@@ -86,6 +36,9 @@ janus = new Janus( { server: server, diff -Nru janus-0.10.8/debian/patches/2001_use_snakeoil_cert.patch janus-0.10.9/debian/patches/2001_use_snakeoil_cert.patch --- janus-0.10.8/debian/patches/2001_use_snakeoil_cert.patch 2020-08-07 16:50:28.000000000 +0000 +++ janus-0.10.9/debian/patches/2001_use_snakeoil_cert.patch 2020-12-25 18:18:56.000000000 +0000 @@ -19,7 +19,7 @@ #dtls_ciphers = "your-desired-openssl-ciphers" --- a/conf/janus.transport.http.jcfg.sample +++ b/conf/janus.transport.http.jcfg.sample -@@ -60,8 +60,8 @@ +@@ -67,8 +67,8 @@ # You can also disable insecure protocols and ciphers by configuring the # 'ciphers' property accordingly (no limitation by default). certificates: { @@ -32,7 +32,7 @@ } --- a/conf/janus.transport.websockets.jcfg.sample +++ b/conf/janus.transport.websockets.jcfg.sample -@@ -42,8 +42,8 @@ +@@ -57,8 +57,8 @@ # 'ciphers' property accordingly (no limitation by default). # Examples of recommended cipher strings at https://cheatsheetseries.owasp.org/cheatsheets/TLS_Cipher_String_Cheat_Sheet.html certificates: { diff -Nru janus-0.10.8/debian/patches/2005_avoid_npm.patch janus-0.10.9/debian/patches/2005_avoid_npm.patch --- janus-0.10.8/debian/patches/2005_avoid_npm.patch 2020-06-12 07:58:23.000000000 +0000 +++ janus-0.10.9/debian/patches/2005_avoid_npm.patch 2020-12-25 18:18:59.000000000 +0000 @@ -5,7 +5,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/Makefile.am +++ b/Makefile.am -@@ -714,11 +714,8 @@ +@@ -716,11 +716,8 @@ if ENABLE_JAVASCRIPT_MODULES @@ -21,7 +21,7 @@ --- a/configure.ac +++ b/configure.ac -@@ -890,13 +890,6 @@ +@@ -897,13 +897,6 @@ ;; esac @@ -35,7 +35,7 @@ ## # Post-processing -@@ -1061,7 +1054,6 @@ +@@ -1068,7 +1061,6 @@ [echo " JSON file logger: no"]) AM_COND_IF([ENABLE_JAVASCRIPT_MODULES], [ echo "JavaScript modules: yes" diff -Nru janus-0.10.8/debian/patches/2006_avoid_doc_privacy_breach.patch janus-0.10.9/debian/patches/2006_avoid_doc_privacy_breach.patch --- janus-0.10.8/debian/patches/2006_avoid_doc_privacy_breach.patch 2020-07-13 08:52:21.000000000 +0000 +++ janus-0.10.9/debian/patches/2006_avoid_doc_privacy_breach.patch 2020-12-25 18:19:35.000000000 +0000 @@ -229,7 +229,7 @@ Janus WebRTC Server =================== -[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-brightgreen.svg)](COPYING) --[![Build Status](https://travis-ci.com/meetecho/janus-gateway.svg?branch=master)](https://travis-ci.com/meetecho/janus-gateway) +-![janus-ci](https://github.com/meetecho/janus-gateway/workflows/janus-ci/badge.svg) -[![Coverity Scan Build Status](https://scan.coverity.com/projects/13265/badge.svg)](https://scan.coverity.com/projects/meetecho-janus-gateway) -[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/janus-gateway.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:janus-gateway) diff -Nru janus-0.10.8/debian/rules janus-0.10.9/debian/rules --- janus-0.10.8/debian/rules 2020-12-02 20:52:26.000000000 +0000 +++ janus-0.10.9/debian/rules 2020-12-25 19:09:29.000000000 +0000 @@ -12,6 +12,28 @@ # avoid installing libtool *.la files export DH_OPTIONS = --exclude=.la +%: + dh $@ + +# optimize JavaScript for browser use +# * include source-map +%.min.js: %.js + uglifyjs.terser --compress --mangle \ + --source-map "base='$(abspath $(dir $@))',url='$(notdir $@).map'" \ + --output $@ \ + -- $< + +# pre-compress for browser use +%.gz: % + pigz --force --keep -11 -- $< + brotli --force --keep --best --suffix=.brotli -- $< + +%.html: %.md + pandoc --from gfm-raw_html --to html --standalone --output $@ $< + +%.txt: %.md + pandoc --from gfm-raw_html --to plain --output $@ $< + override_dh_auto_configure: dh_auto_configure -- \ --enable-json-logger \ @@ -43,26 +65,4 @@ --output.format umd \ --output.file ../$@ -# optimize JavaScript for browser use -# * include source-map -%.min.js: %.js - uglifyjs.terser --compress --mangle \ - --source-map "base='$(abspath $(dir $@))',url='$(notdir $@).map'" \ - --output $@ \ - -- $< - -# pre-compress for browser use -%.gz: % - pigz --force --keep -11 -- $< - brotli --force --keep --best --suffix=.brotli -- $< - -%.html: %.md - pandoc --from gfm-raw_html --to html --standalone --output $@ $< - -%.txt: %.md - pandoc --from gfm-raw_html --to plain --output $@ $< - -%: - dh $@ - .SECONDARY: diff -Nru janus-0.10.8/docs/janus-doxygen.cfg janus-0.10.9/docs/janus-doxygen.cfg --- janus-0.10.8/docs/janus-doxygen.cfg 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/docs/janus-doxygen.cfg 2020-12-23 11:59:08.000000000 +0000 @@ -38,7 +38,7 @@ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.8 +PROJECT_NUMBER = 0.10.9 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff -Nru janus-0.10.8/events/janus_wsevh.c janus-0.10.9/events/janus_wsevh.c --- janus-0.10.8/events/janus_wsevh.c 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/events/janus_wsevh.c 2020-12-23 11:59:08.000000000 +0000 @@ -129,12 +129,14 @@ static int janus_wsevh_callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); static struct lws_protocols protocols[] = { - { NULL, janus_wsevh_callback, sizeof(janus_wsevh_client), 0 }, /* Subprotocol will be configurable */ + { "janus-event-handlers", janus_wsevh_callback, sizeof(janus_wsevh_client), 0 }, /* Subprotocol will be configurable */ { NULL, NULL, 0, 0 } }; static const struct lws_extension exts[] = { +#ifndef LWS_WITHOUT_EXTENSIONS { "permessage-deflate", lws_extension_callback_pm_deflate, "permessage-deflate; client_max_window_bits" }, { "deflate-frame", lws_extension_callback_pm_deflate, "deflate_frame" }, +#endif { NULL, NULL, NULL } }; @@ -264,7 +266,7 @@ goto error; } if(strcasecmp(protocol, "ws") || !strlen(address)) { - JANUS_LOG(LOG_FATAL, "Invalid address (only ws:// and wss:// addresses are supported)\n"); + JANUS_LOG(LOG_FATAL, "Invalid address (only ws:// addresses are supported)\n"); JANUS_LOG(LOG_FATAL, " -- Protocol: %s\n", protocol); JANUS_LOG(LOG_FATAL, " -- Address: %s\n", address); JANUS_LOG(LOG_FATAL, " -- Path: %s\n", path); diff -Nru janus-0.10.8/.github/workflows/janus-ci.yml janus-0.10.9/.github/workflows/janus-ci.yml --- janus-0.10.8/.github/workflows/janus-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ janus-0.10.9/.github/workflows/janus-ci.yml 2020-12-23 11:59:08.000000000 +0000 @@ -0,0 +1,154 @@ +name: janus-ci + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + compiler: [gcc, clang] + datachannels: ["yes", "no"] + libcurl: ["yes", "no"] + include: + - datachannel: "yes" + libcurl: "yes" + deps_from_src: "yes" + janus_config_opts: "" + - datachannels: "yes" + libcurl: "no" + deps_from_src: "no" + janus_config_opts: "--disable-aes-gcm -disable-mqtt --disable-mqtt-event-handler --disable-turn-rest-api --disable-sample-event-handler" + - datachannels: "no" + libcurl: "yes" + deps_from_src: "no" + janus_config_opts: "--disable-aes-gcm -disable-mqtt --disable-mqtt-event-handler --disable-data-channels" + exclude: + - datachannels: "no" + libcurl: "no" + env: + CC: ${{ matrix.compiler }} + steps: + - name: install janus apt dependencies + run: > + sudo apt-get update && sudo apt-get --no-install-recommends -y install + autoconf + cmake + gengetopt + gtk-doc-tools + libavcodec-dev + libavformat-dev + libavutil-dev + libcollection-dev + libconfig-dev + libevent-dev + libglib2.0-dev + libgnutls28-dev + libini-config-dev + liblua5.3-dev + libjansson-dev + libmicrohttpd-dev + libmount-dev + libnanomsg-dev + libogg-dev + libopus-dev + librabbitmq-dev + libsofia-sip-ua-dev + libssl-dev + libvorbis-dev + ninja-build + openssl + - name: setup additional dependencies from apt + if: ${{ matrix.deps_from_src == 'no' }} + run: > + sudo apt-get --no-install-recommends -y install + libnice-dev + libsrtp2-dev + libusrsctp-dev + libwebsockets-dev + - name: install libcurl from apt + if: ${{ matrix.libcurl == 'yes' }} + run: sudo apt-get --no-install-recommends -y install libcurl4-openssl-dev + - name: setup python + if: ${{ matrix.deps_from_src == 'yes' }} + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: 'x64' + - name: install python packages + if: ${{ matrix.deps_from_src == 'yes' }} + run: pip3 install wheel meson + - name: setup libnice from sources + if: ${{ matrix.deps_from_src == 'yes' }} + run: | + git clone --depth 1 --quiet -b master https://gitlab.freedesktop.org/libnice/libnice.git libnice + pushd libnice + if [ $CC = clang ]; then LNICE_CFLAGS="-Wno-cast-align"; fi; + meson setup -Dprefix=/usr -Dlibdir=lib -Dc_args="$LNICE_CFLAGS" -Ddebug=false -Doptimization=0 -Dexamples=disabled -Dgtk_doc=disabled -Dgupnp=disabled -Dgstreamer=disabled -Dtests=disabled build + ninja -C build + sudo ninja -C build install + - name: checkout libsrtp source + if: ${{ matrix.deps_from_src == 'yes' }} + uses: actions/checkout@v2 + with: + repository: cisco/libsrtp + ref: v2.3.0 + - name: setup libsrtp from sources + if: ${{ matrix.deps_from_src == 'yes' }} + run: | + ./configure --prefix=/usr --enable-openssl + make -j$(nproc) shared_library + sudo make install + - name: checkout usrsctp source + if: ${{ matrix.datachannels == 'yes' && matrix.deps_from_src == 'yes' }} + uses: actions/checkout@v2 + with: + repository: sctplab/usrsctp + ref: master + - name: setup usrsctp from sources + if: ${{ matrix.datachannels == 'yes' && matrix.deps_from_src == 'yes' }} + run: | + ./bootstrap + ./configure --prefix=/usr --disable-static --disable-debug --disable-programs --disable-inet --disable-inet6 + make -j$(nproc) + sudo make install + - name: checkout lws source + if: ${{ matrix.deps_from_src == 'yes' }} + uses: actions/checkout@v2 + with: + repository: warmcat/libwebsockets + ref: v4.1-stable + - name: setup lws from sources + if: ${{ matrix.deps_from_src == 'yes' }} + run: | + mkdir -p build + pushd build + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLWS_WITH_STATIC=OFF -DLWS_WITHOUT_CLIENT=ON -DLWS_WITHOUT_TESTAPPS=ON -DLWS_WITHOUT_TEST_SERVER=ON -DLWS_WITH_HTTP2=OFF .. + make -j$(nproc) + sudo make install + - name: checkout paho-mqtt source + if: ${{ matrix.deps_from_src == 'yes' }} + uses: actions/checkout@v2 + with: + repository: eclipse/paho.mqtt.c + ref: v1.3.1 + - name: setup paho-mqtt from sources + if: ${{ matrix.deps_from_src == 'yes' }} + run: | + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_SAMPLES=FALSE -DPAHO_BUILD_DOCUMENTATION=FALSE + make -j$(nproc) + sudo make install + - name: checkout janus source + uses: actions/checkout@v2 + - name: build janus from sources + env: + JANUS_CONFIG_COMMON: "--disable-docs --enable-post-processing --enable-plugin-lua --enable-plugin-duktape --enable-json-logger" + JANUS_CONFIG_OPTS: ${{ matrix.janus_config_opts }} + run: | + ./autogen.sh + ./configure $JANUS_CONFIG_COMMON $JANUS_CONFIG_OPTS + make -j$(nproc) + make check-fuzzers diff -Nru janus-0.10.8/html/devicetest.js janus-0.10.9/html/devicetest.js --- janus-0.10.8/html/devicetest.js 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/html/devicetest.js 2020-12-23 11:59:08.000000000 +0000 @@ -52,7 +52,6 @@ var echotest = null; var opaqueId = "devicetest-"+Janus.randomString(12); -var firstTime = true; var bitrateTimer = null; var spinner = null; @@ -128,11 +127,6 @@ // A different device has been selected: hangup the session, and set it up again $('#audio-device, #video-device').attr('disabled', true); $('#change-devices').attr('disabled', true); - if(firstTime) { - firstTime = false; - restartCapture(); - return; - } restartCapture(); }); } diff -Nru janus-0.10.8/html/janus.js janus-0.10.9/html/janus.js --- janus-0.10.8/html/janus.js 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/html/janus.js 2020-12-23 11:59:08.000000000 +0000 @@ -2796,7 +2796,10 @@ Janus.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring"); } } - config.mySdp = offer.sdp; + config.mySdp = { + type: "offer", + sdp: offer.sdp + }; config.pc.setLocalDescription(offer) .catch(callbacks.error); config.mediaConstraints = mediaConstraints; @@ -3037,7 +3040,10 @@ Janus.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring"); } } - config.mySdp = answer.sdp; + config.mySdp = { + type: "answer", + sdp: answer.sdp + }; config.pc.setLocalDescription(answer) .catch(callbacks.error); config.mediaConstraints = mediaConstraints; @@ -3366,6 +3372,11 @@ } if(!video) continue; + var sim = lines[i].match(/a=ssrc-group:SIM (\d+) (\d+) (\d+)/); + if(sim) { + Janus.warn("The SDP already contains a SIM attribute, munging will be skipped"); + return sdp; + } var fid = lines[i].match(/a=ssrc-group:FID (\d+) (\d+)/); if(fid) { ssrc[0] = fid[1]; diff -Nru janus-0.10.8/html/multiopus.html janus-0.10.9/html/multiopus.html --- janus-0.10.8/html/multiopus.html 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/html/multiopus.html 2020-12-23 11:59:08.000000000 +0000 @@ -47,6 +47,14 @@

Demo details

+
Note well! This demo is known not to work + as expected, at the moment, due to two different bugs in Chrome with respect + to captureStream: the first bug + causes media from a captured video not to be sent on a PeerConnection, which is what + we try to do in this demo; the second bug + causes audio not to be sent if the source video element is muted, despite the + video itself containing an audio stream. Until both issues are fixed in Chrome, + this demo will basically do nothing, and so no point in trying it out.

This is a variant of the Echo Test demo meant to showcase the support for multichannel Opus, and so surround audio: everything is exactly the same in term of available controls, features, and the like, with diff -Nru janus-0.10.8/html/recordplaytest.html janus-0.10.9/html/recordplaytest.html --- janus-0.10.8/html/recordplaytest.html 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/html/recordplaytest.html 2020-12-23 11:59:08.000000000 +0000 @@ -93,6 +93,10 @@

+
+ + +
diff -Nru janus-0.10.8/html/recordplaytest.js janus-0.10.9/html/recordplaytest.js --- janus-0.10.8/html/recordplaytest.js 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/html/recordplaytest.js 2020-12-23 11:59:08.000000000 +0000 @@ -67,7 +67,9 @@ var vprofile = (getQueryStringValue("vprofile") !== "" ? getQueryStringValue("vprofile") : null); var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true"); var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true"); - +var recordData = (getQueryStringValue("data") !== "" ? getQueryStringValue("data") : null); +if(recordData !== "text" && recordData !== "binary") + recordData = null; $(document).ready(function() { // Initialize the library (all console debuggers enabled) @@ -147,7 +149,7 @@ recordplay.createAnswer( { jsep: jsep, - media: { audioSend: false, videoSend: false }, // We want recvonly audio/video + media: { audioSend: false, videoSend: false, data: true }, // We want recvonly audio/video success: function(jsep) { Janus.debug("Got SDP!", jsep); var body = { request: "start" }; @@ -314,6 +316,20 @@ $('#thevideo').removeClass('hide').show(); } }, + ondataopen: function(data) { + Janus.log("The DataChannel is available!"); + $('#datafield').parent().removeClass('hide'); + if(playing === false) { + // We're recording, use this field to send data + $('#datafield').attr('placeholder', 'Write a message to record'); + $('#datafield').removeAttr('disabled'); + } + }, + ondata: function(data) { + Janus.debug("We got data from the DataChannel!", data); + if(playing === true) + $('#datafield').val(data); + }, oncleanup: function() { Janus.log(" ::: Got a cleanup notification :::"); // FIXME Reset status @@ -324,6 +340,8 @@ $('#videobox').empty(); $("#videobox").parent().unblock(); $('#video').hide(); + $('#datafield').attr('disabled', true).attr('placeholder', '').val(''); + $('#datafield').parent().addClass('hide'); recording = false; playing = false; $('#record').removeAttr('disabled').click(startRecording); @@ -349,17 +367,29 @@ }}); }); -function checkEnter(field, event) { +function checkEnter(event) { var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if(theCode == 13) { - if(field.id == 'name') - insertName(); + sendData(); return false; } else { return true; } } +function sendData() { + var data = $('#datafield').val(); + if(data === "") { + bootbox.alert('Insert a message to send on the DataChannel'); + return; + } + recordplay.data({ + text: data, + error: function(reason) { bootbox.alert(reason); }, + success: function() { $('#datafield').val(''); }, + }); +} + function updateRecsList() { $('#list').unbind('click'); $('#update-list').addClass('fa-spin'); @@ -426,7 +456,9 @@ recordplay.createOffer( { - // By default, it's sendrecv for audio and video... no datachannels + // By default, it's sendrecv for audio and video... no datachannels, + // unless we've passed the query string argument to record those too + media: { data: (recordData != null) }, // If you want to test simulcasting (Chrome and Firefox only), then // pass a ?simulcast=true when opening this demo page: it will turn // the following 'simulcast' property to pass to janus.js to true @@ -444,6 +476,9 @@ // profile as well (e.g., ?vprofile=2 for VP9, or ?vprofile=42e01f for H.264) if(vprofile) body["videoprofile"] = vprofile; + // If we're going to send binary data, let's tell the plugin + if(recordData === "binary") + body["textdata"] = false; recordplay.send({ message: body, jsep: jsep }); }, error: function(error) { diff -Nru janus-0.10.8/html/screensharingtest.js janus-0.10.9/html/screensharingtest.js --- janus-0.10.8/html/screensharingtest.js 2020-11-23 14:19:18.000000000 +0000 +++ janus-0.10.9/html/screensharingtest.js 2020-12-23 11:59:08.000000000 +0000 @@ -166,19 +166,39 @@ if(role === "publisher") { // This is our session, publish our stream Janus.debug("Negotiating WebRTC stream for our screen (capture " + capture + ")"); - screentest.createOffer( - { - media: { video: capture, audioSend: true, videoRecv: false}, // Screen sharing Publishers are sendonly - success: function(jsep) { - Janus.debug("Got publisher SDP!", jsep); - var publish = { request: "configure", audio: true, video: true }; - screentest.send({ message: publish, jsep: jsep }); - }, - error: function(error) { - Janus.error("WebRTC error:", error); - bootbox.alert("WebRTC error... " + error.message); - } + // Safari expects a user gesture to share the screen: see issue #2455 + if(Janus.webRTCAdapter.browserDetails.browser === "safari") { + bootbox.alert("Safari requires a user gesture before the screen can be shared: close this dialog to do that. See issue #2455 for more details", function() { + screentest.createOffer( + { + media: { video: capture, audioSend: true, videoRecv: false}, // Screen sharing Publishers are sendonly + success: function(jsep) { + Janus.debug("Got publisher SDP!", jsep); + var publish = { request: "configure", audio: true, video: true }; + screentest.send({ message: publish, jsep: jsep }); + }, + error: function(error) { + Janus.error("WebRTC error:", error); + bootbox.alert("WebRTC error... " + error.message); + } + }); }); + } else { + // Other browsers should be fine, we try to call getDisplayMedia directly + screentest.createOffer( + { + media: { video: capture, audioSend: true, videoRecv: false}, // Screen sharing Publishers are sendonly + success: function(jsep) { + Janus.debug("Got publisher SDP!", jsep); + var publish = { request: "configure", audio: true, video: true }; + screentest.send({ message: publish, jsep: jsep }); + }, + error: function(error) { + Janus.error("WebRTC error:", error); + bootbox.alert("WebRTC error... " + error.message); + } + }); + } } else { // We're just watching a session, any feed to attach to? if(msg["publishers"]) { @@ -470,7 +490,8 @@ if($('#screenvideo').length === 0) { // No remote video yet $('#screencapture').append('