From 09d92c57eddff1a6bd72696c31d3e143661d8ef4 Mon Sep 17 00:00:00 2001
From: xiewenlong1202
Date: Tue, 2 Jul 2019 10:14:09 +0800
Subject: [PATCH 01/52] improve publish method (#177)
1. when no 'options' publish stream as it is.
2. allow disable audio/video when stream has both
---
src/sdk/conference/channel.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 2c2d2a2a..25a8f236 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -77,20 +77,20 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
publish(stream, options) {
if (options === undefined) {
- options = {audio: !!stream.mediaStream.getAudioTracks(), video: !!stream
- .mediaStream.getVideoTracks()};
+ options = {audio: !!stream.mediaStream.getAudioTracks().length, video: !!stream
+ .mediaStream.getVideoTracks().length};
}
if (typeof options !== 'object') {
return Promise.reject(new TypeError('Options should be an object.'));
}
if (options.audio === undefined) {
- options.audio = !!stream.mediaStream.getAudioTracks();
+ options.audio = !!stream.mediaStream.getAudioTracks().length;
}
if (options.video === undefined) {
- options.video = !!stream.mediaStream.getVideoTracks();
+ options.video = !!stream.mediaStream.getVideoTracks().length;
}
- if (!!options.audio === !stream.mediaStream.getAudioTracks().length || !!
- options.video === !stream.mediaStream.getVideoTracks().length) {
+ if ((!!options.audio && !stream.mediaStream.getAudioTracks().length) ||
+ (!!options.video && !stream.mediaStream.getVideoTracks().length)) {
return Promise.reject(new ConferenceError(
'options.audio/video is inconsistent with tracks presented in the ' +
'MediaStream.'
From 496f416d5072543c26a71cf7751116ccca2e7302 Mon Sep 17 00:00:00 2001
From: zhangyihui1 <42208024+zhangyihui1@users.noreply.github.com>
Date: Thu, 11 Jul 2019 13:38:41 +0800
Subject: [PATCH 02/52] Test p2p js with chrome headless mode. (#183)
---
test/p2ptest/karma_config/chrome-start.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/p2ptest/karma_config/chrome-start.sh b/test/p2ptest/karma_config/chrome-start.sh
index a6732dd4..a945cd2c 100755
--- a/test/p2ptest/karma_config/chrome-start.sh
+++ b/test/p2ptest/karma_config/chrome-start.sh
@@ -17,4 +17,5 @@ fi
# Execute the command
export DISPLAY=:0
-exec "$CMD" --user-data-dir="$USER_DIR" --proxy-auto-detect --window-size=950,450 --use-fake-ui-for-media-stream --disable-user-media-security --no-default-browser-check --no-first-run --disable-default-apps --use-fake-device-for-media-stream "$@"
+exec "$CMD" --user-data-dir="$USER_DIR" --enable-logging --v=1 --allow-file-access-from-files --no-proxy-server --no-sandbox --use-fake-ui-for-media-stream --disable-user-media-security --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --use-fake-device-for-media-stream --headless --remote-debugging-port=9222 "$@"
+#exec "$CMD" --user-data-dir="$USER_DIR" --proxy-auto-detect --window-size=950,450 --use-fake-ui-for-media-stream --disable-user-media-security --no-default-browser-check --no-first-run --disable-default-apps --use-fake-device-for-media-stream "$@"
From 7bfd3db4ed57211d2717a2d1ad1df2ffe13af8b9 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Mon, 15 Jul 2019 13:38:03 +0800
Subject: [PATCH 03/52] Upgrade npm dependencies.
---
package-lock.json | 131 ++++++++++++----------------------------------
1 file changed, 34 insertions(+), 97 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index c43a8ea1..72288170 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1097,8 +1097,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
- "dev": true,
- "optional": true
+ "dev": true
},
"archiver": {
"version": "1.3.0",
@@ -1147,7 +1146,6 @@
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"dev": true,
- "optional": true,
"requires": {
"delegates": "^1.0.0",
"readable-stream": "^2.0.6"
@@ -1308,8 +1306,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
- "dev": true,
- "optional": true
+ "dev": true
},
"assign-symbols": {
"version": "1.0.0",
@@ -1319,7 +1316,7 @@
},
"async": {
"version": "1.5.2",
- "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz",
+ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"dev": true
},
@@ -2090,8 +2087,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
- "dev": true,
- "optional": true
+ "dev": true
},
"coffeescript": {
"version": "1.10.0",
@@ -2155,7 +2151,6 @@
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
"dev": true,
- "optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
@@ -2233,8 +2228,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
- "dev": true,
- "optional": true
+ "dev": true
},
"constants-browserify": {
"version": "1.0.0",
@@ -2526,15 +2520,13 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
- "dev": true,
- "optional": true
+ "dev": true
},
"delegates": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
- "dev": true,
- "optional": true
+ "dev": true
},
"depd": {
"version": "1.1.2",
@@ -3244,8 +3236,7 @@
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
- "dev": true,
- "optional": true
+ "dev": true
},
"eyes": {
"version": "0.1.8",
@@ -3496,8 +3487,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"aproba": {
"version": "1.2.0",
@@ -3518,14 +3508,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -3540,20 +3528,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"core-util-is": {
"version": "1.0.2",
@@ -3670,8 +3655,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"ini": {
"version": "1.3.5",
@@ -3683,7 +3667,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -3698,7 +3681,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -3706,14 +3688,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -3732,7 +3712,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -3813,8 +3792,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"object-assign": {
"version": "4.1.1",
@@ -3826,7 +3804,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"wrappy": "1"
}
@@ -3912,8 +3889,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -3949,7 +3925,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -3969,7 +3944,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
- "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -4013,14 +3987,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
- "dev": true,
- "optional": true
+ "dev": true
}
}
},
@@ -4029,7 +4001,6 @@
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
"dev": true,
- "optional": true,
"requires": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
@@ -4054,7 +4025,6 @@
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"dev": true,
- "optional": true,
"requires": {
"aproba": "^1.0.3",
"console-control-strings": "^1.0.0",
@@ -4651,8 +4621,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
- "dev": true,
- "optional": true
+ "dev": true
},
"has-value": {
"version": "1.0.0",
@@ -5178,7 +5147,6 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
- "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -5335,8 +5303,7 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
- "dev": true,
- "optional": true
+ "dev": true
},
"js-levenshtein": {
"version": "1.1.4",
@@ -5373,8 +5340,7 @@
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
- "dev": true,
- "optional": true
+ "dev": true
},
"jsdoc": {
"version": "3.6.2",
@@ -6268,9 +6234,9 @@
"dev": true
},
"mixin-deep": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
- "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
+ "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
"dev": true,
"requires": {
"for-in": "^1.0.2",
@@ -6587,7 +6553,6 @@
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"dev": true,
- "optional": true,
"requires": {
"are-we-there-yet": "~1.1.2",
"console-control-strings": "~1.1.0",
@@ -7769,13 +7734,12 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
- "dev": true,
- "optional": true
+ "dev": true
},
"set-value": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
- "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
+ "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
"dev": true,
"requires": {
"extend-shallow": "^2.0.1",
@@ -8241,7 +8205,6 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
- "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -8591,7 +8554,6 @@
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true,
- "optional": true,
"requires": {
"safe-buffer": "^5.0.1"
}
@@ -8600,8 +8562,7 @@
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
- "dev": true,
- "optional": true
+ "dev": true
},
"type-check": {
"version": "0.3.2",
@@ -8729,38 +8690,15 @@
"dev": true
},
"union-value": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
- "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
+ "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
"dev": true,
"requires": {
"arr-union": "^3.1.0",
"get-value": "^2.0.6",
"is-extendable": "^0.1.1",
- "set-value": "^0.4.3"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- },
- "set-value": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
- "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=",
- "dev": true,
- "requires": {
- "extend-shallow": "^2.0.1",
- "is-extendable": "^0.1.1",
- "is-plain-object": "^2.0.1",
- "to-object-path": "^0.3.0"
- }
- }
+ "set-value": "^2.0.1"
}
},
"unpipe": {
@@ -8995,7 +8933,6 @@
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"dev": true,
- "optional": true,
"requires": {
"string-width": "^1.0.2 || 2"
}
From a9c6e36a3729b8576c4ed4f6796270588de29920 Mon Sep 17 00:00:00 2001
From: cisco6 <44567104+cisco6@users.noreply.github.com>
Date: Tue, 16 Jul 2019 14:23:12 +0800
Subject: [PATCH 04/52] Enhancement for Conference CI process (#187)
* CIjsupdate
* CIjsupdatejenkinsfile
---
test/conference.jenkinsfile | 63 ++++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 28 deletions(-)
diff --git a/test/conference.jenkinsfile b/test/conference.jenkinsfile
index fd43352d..24da8a0d 100644
--- a/test/conference.jenkinsfile
+++ b/test/conference.jenkinsfile
@@ -1,56 +1,63 @@
void setBuildStatus(String message, String state) {
- step([
- $class: "GitHubCommitStatusSetter",
- reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"],
- contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"],
- errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
- statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
- ]);
+ step([
+ $class: "GitHubCommitStatusSetter",
+ reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"],
+ contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"],
+ errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
+ statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]]
+ ]);
}
+
+
pipeline {
agent any
+ options {
+ buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
+ }
stages {
stage('Unit test') {
steps {
podTemplate(name: 'unit-test', label: 'unit-test', cloud: 'kubernetes', containers: [
- containerTemplate(name: 'unit-test', image: "$env.TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', network: 'host', command: 'cat')
- ]) {
+ containerTemplate(name: 'unit-test', image: "$env.JSMCU_TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', resourceLimitMemory: '1.0Gi', resourceRequestMemory: '0.5Gi', network: 'host', command: 'cat')
+ ]) {
node('unit-test') {
container('unit-test') {
- sh "cd /root/oms-client-javascript/test/unit/karma-test/ && ./start.sh"
+ sh "cd /root/oms-client-javascript/test/unit/karma-test/ && ./start.sh"
}
}
}
}
}
stage('Build package') {
+ options { timeout(time: 10, unit: 'MINUTES') }
steps {
podTemplate(name: 'pack', label: 'pack-mcu', containers: [
- containerTemplate(name: 'pack-on-centos', image: "$env.PACK_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '7000m', resourceLimitCpu: '8000m', network: 'host', command: 'cat')
+ containerTemplate(name: 'pack-on-centos', image: "$env.JS_MCU_BUILD", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '1000m', resourceLimitCpu: '1500m', resourceLimitMemory: '1.5Gi', resourceRequestMemory: '1.0Gi', network: 'host', command: 'cat')
]){
- node ('pack-mcu') {
- container ('pack-on-centos') {
- sh "/root/packSDKInDocker.sh software $env.GIT_COMMIT $env.GIT_BRANCH $env.CHANGE_ID"
- }
+ node('pack-mcu') {
+ container('pack-on-centos') {
+ sh "/root/packSDKInDocker.sh $env.GIT_COMMIT $env.GIT_BRANCH $env.CHANGE_ID"
+ }
}
}
}
}
stage('Start test') {
+ options { timeout(time: 60, unit: 'MINUTES') }
parallel {
stage('API test') {
steps {
podTemplate(name: 'api-test', label: 'api-test', cloud: 'kubernetes', containers: [
- containerTemplate(name: 'api-test', image: "$env.TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '3000m', resourceLimitCpu: '4000m', network: 'host', command: 'cat'),
- ]) {
-
+ containerTemplate(name: 'api-test', image: "$env.JSMCU_TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
+ ]) {
+
node('api-test') {
- container('api-test') {
- sh "/root/start.sh ${env.GIT_COMMIT}1 ConferenceClient_api"
- }
+ container('api-test') {
+ sh "/root/start.sh ${env.GIT_COMMIT}1 ConferenceClient_api"
+ }
}
}
}
@@ -58,14 +65,14 @@ pipeline {
stage('Subscribe test') {
steps {
- podTemplate(name:'subscribe-test', label: 'subscribe-test', cloud: 'kubernetes', containers: [
- containerTemplate(name: 'subscribe-test', image: "$env.TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '3000m', resourceLimitCpu: '4000m', network: 'host', command: 'cat'),
- ]) {
-
+ podTemplate(name: 'subscribe-test', label: 'subscribe-test', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'subscribe-test', image: "$env.JSMCU_TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
+ ]) {
+
node('subscribe-test') {
- container('subscribe-test') {
- sh "/root/start.sh ${env.GIT_COMMIT}2 ConferenceClient_subscribe"
- }
+ container('subscribe-test') {
+ sh "/root/start.sh ${env.GIT_COMMIT}2 ConferenceClient_subscribe"
+ }
}
}
}
From 8779ba12305ff19d8b39485ff86413c8200d17b5 Mon Sep 17 00:00:00 2001
From: cisco66666 <52657199+cisco66666@users.noreply.github.com>
Date: Mon, 22 Jul 2019 13:35:01 +0800
Subject: [PATCH 05/52] fix unit test (#190)
---
test/conference.jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/conference.jenkinsfile b/test/conference.jenkinsfile
index 24da8a0d..504b5a13 100644
--- a/test/conference.jenkinsfile
+++ b/test/conference.jenkinsfile
@@ -24,7 +24,7 @@ pipeline {
]) {
node('unit-test') {
container('unit-test') {
- sh "cd /root/oms-client-javascript/test/unit/karma-test/ && ./start.sh"
+ sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh"
}
}
}
From 69423f5cb805c524696daf0d5f8012d705add787 Mon Sep 17 00:00:00 2001
From: cisco66666 <52657199+cisco66666@users.noreply.github.com>
Date: Fri, 26 Jul 2019 16:20:25 +0800
Subject: [PATCH 06/52] Add ubuntu jenkinsfile with js (#195)
---
test/ubuntuconference.jenkinsfile | 92 +++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 test/ubuntuconference.jenkinsfile
diff --git a/test/ubuntuconference.jenkinsfile b/test/ubuntuconference.jenkinsfile
new file mode 100644
index 00000000..0874d742
--- /dev/null
+++ b/test/ubuntuconference.jenkinsfile
@@ -0,0 +1,92 @@
+void setBuildStatus(String message, String state) {
+ step([
+ $class: "GitHubCommitStatusSetter",
+ reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"],
+ contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"],
+ errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
+ statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]]
+ ]);
+}
+
+
+
+
+pipeline {
+ agent any
+ options {
+ buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
+ }
+ stages {
+ stage('Unit test') {
+ steps {
+ podTemplate(name: 'unit-test', label: 'unit-test', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'unit-test', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', resourceLimitMemory: '1.0Gi', resourceRequestMemory: '0.5Gi', network: 'host', command: 'cat')
+ ]) {
+ node('unit-test') {
+ container('unit-test') {
+ sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh"
+ }
+ }
+ }
+ }
+ }
+ stage('Build package') {
+ options { timeout(time: 20, unit: 'MINUTES') }
+ steps {
+ podTemplate(name: 'pack', label: 'pack-mcu', containers: [
+ containerTemplate(name: 'pack-on-centos', image: "$env.JS_MCU_BUILD_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '1000m', resourceLimitCpu: '1500m', resourceLimitMemory: '1.5Gi', resourceRequestMemory: '1.0Gi', network: 'host', command: 'cat')
+ ]){
+ node('pack-mcu') {
+ container('pack-on-centos') {
+ sh "/root/packSDKInDocker.sh $env.GIT_COMMIT $env.GIT_BRANCH $env.CHANGE_ID"
+ }
+ }
+ }
+ }
+ }
+
+ stage('Start test') {
+ options { timeout(time: 100, unit: 'MINUTES') }
+ parallel {
+ stage('API test') {
+ steps {
+ podTemplate(name: 'api-test', label: 'api-test', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'api-test', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
+ ]) {
+
+ node('api-test') {
+ container('api-test') {
+ sh "/root/start.sh ${env.GIT_COMMIT}1 ConferenceClient_api"
+ }
+ }
+ }
+ }
+ }
+
+ stage('Subscribe test') {
+ steps {
+ podTemplate(name: 'subscribe-test', label: 'subscribe-test', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'subscribe-test', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
+ ]) {
+
+ node('subscribe-test') {
+ container('subscribe-test') {
+ sh "/root/start.sh ${env.GIT_COMMIT}2 ConferenceClient_subscribe"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ post {
+ success {
+ setBuildStatus("Build succeeded", "SUCCESS");
+ }
+ failure {
+ setBuildStatus("Build failed", "FAILURE");
+ }
+ }
+}
From 5ce7796cef429c496459e6f9e2cc962fe8b47ba0 Mon Sep 17 00:00:00 2001
From: cisco66666 <52657199+cisco66666@users.noreply.github.com>
Date: Mon, 29 Jul 2019 15:48:49 +0800
Subject: [PATCH 07/52] Update ubuntu's Jenkins file on JS to create a new
podTemplate (#198)
* Update ubuntu's Jenkins file on JS to create a new podTemplate and not conflict with centos's podTemplate
* fix timeout
---
test/conference.jenkinsfile | 4 ++--
test/ubuntuconference.jenkinsfile | 35 ++++++++++++++++---------------
2 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/test/conference.jenkinsfile b/test/conference.jenkinsfile
index 504b5a13..cdc69413 100644
--- a/test/conference.jenkinsfile
+++ b/test/conference.jenkinsfile
@@ -31,7 +31,7 @@ pipeline {
}
}
stage('Build package') {
- options { timeout(time: 10, unit: 'MINUTES') }
+ options { timeout(time: 20, unit: 'MINUTES') }
steps {
podTemplate(name: 'pack', label: 'pack-mcu', containers: [
containerTemplate(name: 'pack-on-centos', image: "$env.JS_MCU_BUILD", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '1000m', resourceLimitCpu: '1500m', resourceLimitMemory: '1.5Gi', resourceRequestMemory: '1.0Gi', network: 'host', command: 'cat')
@@ -46,7 +46,7 @@ pipeline {
}
stage('Start test') {
- options { timeout(time: 60, unit: 'MINUTES') }
+ options { timeout(time: 40, unit: 'MINUTES') }
parallel {
stage('API test') {
steps {
diff --git a/test/ubuntuconference.jenkinsfile b/test/ubuntuconference.jenkinsfile
index 0874d742..68eee9f2 100644
--- a/test/ubuntuconference.jenkinsfile
+++ b/test/ubuntuconference.jenkinsfile
@@ -19,11 +19,11 @@ pipeline {
stages {
stage('Unit test') {
steps {
- podTemplate(name: 'unit-test', label: 'unit-test', cloud: 'kubernetes', containers: [
- containerTemplate(name: 'unit-test', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', resourceLimitMemory: '1.0Gi', resourceRequestMemory: '0.5Gi', network: 'host', command: 'cat')
+ podTemplate(name: 'unit-test-ubuntu', label: 'unit-test-ubuntu', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'unit-test-ubuntu', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', resourceLimitMemory: '1.0Gi', resourceRequestMemory: '0.5Gi', network: 'host', command: 'cat')
]) {
- node('unit-test') {
- container('unit-test') {
+ node('unit-test-ubuntu') {
+ container('unit-test-ubuntu') {
sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh"
}
}
@@ -33,11 +33,11 @@ pipeline {
stage('Build package') {
options { timeout(time: 20, unit: 'MINUTES') }
steps {
- podTemplate(name: 'pack', label: 'pack-mcu', containers: [
- containerTemplate(name: 'pack-on-centos', image: "$env.JS_MCU_BUILD_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '1000m', resourceLimitCpu: '1500m', resourceLimitMemory: '1.5Gi', resourceRequestMemory: '1.0Gi', network: 'host', command: 'cat')
+ podTemplate(name: 'pack-ubuntu', label: 'pack-mcu-ubuntu', containers: [
+ containerTemplate(name: 'pack-on-ubuntu', image: "$env.JS_MCU_BUILD_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '1000m', resourceLimitCpu: '1500m', resourceLimitMemory: '1.5Gi', resourceRequestMemory: '1.0Gi', network: 'host', command: 'cat')
]){
- node('pack-mcu') {
- container('pack-on-centos') {
+ node('pack-mcu-ubuntu') {
+ container('pack-on-ubuntu') {
sh "/root/packSDKInDocker.sh $env.GIT_COMMIT $env.GIT_BRANCH $env.CHANGE_ID"
}
}
@@ -46,16 +46,16 @@ pipeline {
}
stage('Start test') {
- options { timeout(time: 100, unit: 'MINUTES') }
+ options { timeout(time: 40, unit: 'MINUTES') }
parallel {
stage('API test') {
steps {
- podTemplate(name: 'api-test', label: 'api-test', cloud: 'kubernetes', containers: [
- containerTemplate(name: 'api-test', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
+ podTemplate(name: 'api-test-ubuntu', label: 'api-test-ubuntu', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'api-test-ubuntu', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
]) {
- node('api-test') {
- container('api-test') {
+ node('api-test-ubuntu') {
+ container('api-test-ubuntu') {
sh "/root/start.sh ${env.GIT_COMMIT}1 ConferenceClient_api"
}
}
@@ -65,12 +65,12 @@ pipeline {
stage('Subscribe test') {
steps {
- podTemplate(name: 'subscribe-test', label: 'subscribe-test', cloud: 'kubernetes', containers: [
- containerTemplate(name: 'subscribe-test', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
+ podTemplate(name: 'subscribe-test-ubuntu', label: 'subscribe-test-ubuntu', cloud: 'kubernetes', containers: [
+ containerTemplate(name: 'subscribe-test-ubuntu', image: "$env.JSMCU_TEST_IMAGE_UBUNTU", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'),
]) {
- node('subscribe-test') {
- container('subscribe-test') {
+ node('subscribe-test-ubuntu') {
+ container('subscribe-test-ubuntu') {
sh "/root/start.sh ${env.GIT_COMMIT}2 ConferenceClient_subscribe"
}
}
@@ -90,3 +90,4 @@ pipeline {
}
}
}
+
From b1c112269e2bf217eff96e5e60a82445d14bb8ca Mon Sep 17 00:00:00 2001
From: archer <2232502139@qq.com>
Date: Fri, 2 Aug 2019 16:36:36 +0800
Subject: [PATCH 08/52] add checks function (#199)
* add checks function
* add ubutun config
---
test/conference.jenkinsfile | 5 +++++
test/ubuntuconference.jenkinsfile | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/test/conference.jenkinsfile b/test/conference.jenkinsfile
index cdc69413..832de0c7 100644
--- a/test/conference.jenkinsfile
+++ b/test/conference.jenkinsfile
@@ -82,6 +82,11 @@ pipeline {
}
post {
+ always {
+ script {
+ sh "curl -H \"Content-Type: application/json\" -X POST --data '{\"commit_id\":\"'$GIT_COMMIT'\",\"job_path\":\"'${env.JS_CHECK_PATH}'\",\"job_name\":\"'$JOB_BASE_NAME'\",\"build_num\":\"'$BUILD_NUMBER'\",\"os_version\":\"'$env.CENTOS_VERSION'\"}' '${env.checkServerUrl}'/runServer/JS_BUILD_CONFERENCE_STEPS"
+ }
+ }
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
diff --git a/test/ubuntuconference.jenkinsfile b/test/ubuntuconference.jenkinsfile
index 68eee9f2..394b9a28 100644
--- a/test/ubuntuconference.jenkinsfile
+++ b/test/ubuntuconference.jenkinsfile
@@ -2,7 +2,7 @@ void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"],
- contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"],
+ contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/ubuntuconference"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]]
]);
@@ -82,6 +82,12 @@ pipeline {
}
post {
+
+ always {
+ script {
+ sh "curl -H \"Content-Type: application/json\" -X POST --data '{\"commit_id\":\"'$GIT_COMMIT'\",\"job_path\":\"'${env.JS_CHECK_UBUNTU_PATH}'\",\"job_name\":\"'$JOB_BASE_NAME'\",\"build_num\":\"'$BUILD_NUMBER'\",\"os_version\":\"'$env.UBUTUN_VERSION'\"}' '${env.checkServerUrl}'/runServer/JS_BUILD_CONFERENCE_STEPS"
+ }
+ }
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
From 120f9ae9a01f665176d93275a69624d0ae061454 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Mon, 12 Aug 2019 17:51:48 +0800
Subject: [PATCH 09/52] Publish method accepts RTCRtpEncodingParameters as
options.
This change makes simulcast possibile.
---
docs/mdfiles/changelog.md | 3 ++
src/sdk/base/publication.js | 6 ++-
src/sdk/conference/channel.js | 91 ++++++++++++++++++++++++++---------
3 files changed, 76 insertions(+), 24 deletions(-)
diff --git a/docs/mdfiles/changelog.md b/docs/mdfiles/changelog.md
index 00560c03..47374314 100644
--- a/docs/mdfiles/changelog.md
+++ b/docs/mdfiles/changelog.md
@@ -1,5 +1,8 @@
Change Log
==========
+# 4.3
+* The type of `conferenceClient.publish` method's option is changed from `AudioEncodingParameters` and `VideoEncodingParameters` to `RTCRtpSendParameters`.
+
# 4.0.2
* Fix a compatibility issue for Chrome 69 beta.
diff --git a/src/sdk/base/publication.js b/src/sdk/base/publication.js
index 8775986a..fa52d595 100644
--- a/src/sdk/base/publication.js
+++ b/src/sdk/base/publication.js
@@ -171,15 +171,17 @@ export class PublishOptions {
// eslint-disable-next-line require-jsdoc
constructor(audio, video) {
/**
- * @member {?Array} audio
+ * @member {?Array | ?Array} audio
* @instance
* @memberof Owt.Base.PublishOptions
+ * @desc Parameters for audio RtpSender.
*/
this.audio = audio;
/**
- * @member {?Array} video
+ * @member {?Array | ?Array} video
* @instance
* @memberof Owt.Base.PublishOptions
+ * @desc Parameters for video RtpSender.
*/
this.video = video;
}
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 25a8f236..7dedd9ca 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -83,6 +83,13 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
if (typeof options !== 'object') {
return Promise.reject(new TypeError('Options should be an object.'));
}
+ if ((this._isRtpEncodingParameters(options.audio) &&
+ this._isOwtEncodingParameters(options.video)) ||
+ (this._isOwtEncodingParameters(options.audio) &&
+ this._isRtpEncodingParameters(options.video))) {
+ return Promise.reject(new ConferenceError(
+ 'Mixing RTCRtpEncodingParameters and AudioEncodingParameters/VideoEncodingParameters is not allowed.'))
+ }
if (options.audio === undefined) {
options.audio = !!stream.mediaStream.getAudioTracks().length;
}
@@ -115,18 +122,20 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
}
}
- if (typeof options.video === 'object') {
- if (!Array.isArray(options.video)) {
- return Promise.reject(new TypeError(
- 'options.video should be a boolean or an array.'));
- }
+ if (typeof options.video === 'object' && !Array.isArray(options.video)) {
+ return Promise.reject(new TypeError(
+ 'options.video should be a boolean or an array.'));
+ }
+ if (this._isOwtEncodingParameters(options.video)) {
for (const parameters of options.video) {
- if (!parameters.codec || typeof parameters.codec.name !== 'string' || (
- parameters.maxBitrate !== undefined && typeof parameters.maxBitrate
- !== 'number') || (parameters.codec.profile !== undefined
- && typeof parameters.codec.profile !== 'string')) {
+ if (!parameters.codec || typeof parameters.codec.name !== 'string' ||
+ (
+ parameters.maxBitrate !== undefined && typeof parameters
+ .maxBitrate !==
+ 'number') || (parameters.codec.profile !== undefined &&
+ typeof parameters.codec.profile !== 'string')) {
return Promise.reject(new TypeError(
- 'options.video has incorrect parameters.'));
+ 'options.video has incorrect parameters.'));
}
}
}
@@ -149,9 +158,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
mediaOptions.audio = {};
mediaOptions.audio.source = stream.source.audio;
- for (const track of stream.mediaStream.getAudioTracks()) {
- this._pc.addTrack(track, stream.mediaStream);
- }
} else {
mediaOptions.audio = false;
}
@@ -174,9 +180,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
},
framerate: trackSettings.frameRate,
};
- for (const track of stream.mediaStream.getVideoTracks()) {
- this._pc.addTrack(track, stream.mediaStream);
- }
} else {
mediaOptions.video = false;
}
@@ -197,15 +200,31 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
};
if (typeof this._pc.addTransceiver === 'function') {
// |direction| seems not working on Safari.
- if (mediaOptions.audio && stream.mediaStream.getAudioTracks() > 0) {
- this._pc.addTransceiver('audio', {direction: 'sendonly'});
+ if (mediaOptions.audio && stream.mediaStream.getAudioTracks().length >
+ 0) {
+ const transceiverInit = {
+ direction: 'sendonly'
+ };
+ if (this._isRtpEncodingParameters(options.audio)) {
+ transceiverInit.sendEncodings = options.audio;
+ }
+ this._pc.addTransceiver(stream.mediaStream.getAudioTracks()[0],
+ transceiverInit);
}
- if (mediaOptions.video && stream.mediaStream.getVideoTracks() > 0) {
- this._pc.addTransceiver('video', {direction: 'sendonly'});
+ if (mediaOptions.video && stream.mediaStream.getVideoTracks().length >
+ 0) {
+ const transceiverInit = {
+ direction: 'sendonly'
+ };
+ if (this._isRtpEncodingParameters(options.video)) {
+ transceiverInit.sendEncodings = options.video;
+ }
+ this._pc.addTransceiver(stream.mediaStream.getVideoTracks()[0],
+ transceiverInit);
}
}
let localDesc;
- this._pc.createOffer(offerOptions).then((desc) => {
+ this._pc.createOffer().then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
}
@@ -332,7 +351,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this._pc.addTransceiver('video', {direction: 'recvonly'});
}
}
- this._pc.createOffer(offerOptions).then((desc) => {
+ this._pc.createOffer().then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
}
@@ -645,11 +664,20 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
_setRtpSenderOptions(sdp, options) {
+ // SDP mugling is deprecated, moving to `setParameters`.
+ if (this._isRtpEncodingParameters(options.audio) ||
+ this._isRtpEncodingParameters(options.video)) {
+ return sdp;
+ }
sdp = this._setMaxBitrate(sdp, options);
return sdp;
}
_setRtpReceiverOptions(sdp, options) {
+ if (this._isRtpEncodingParameters(options.audio) ||
+ this._isRtpEncodingParameters(options.video)) {
+ return sdp;
+ }
sdp = this._setCodecOrder(sdp, options);
return sdp;
}
@@ -683,4 +711,23 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
Logger.warning('Invalid data value for stream update info.');
}
}
+
+ _isRtpEncodingParameters(obj) {
+ if (!Array.isArray(obj)) {
+ return false;
+ }
+ // Only check the first one.
+ const param = obj[0];
+ return param.codecPayloadType || param.dtx || param.active || param
+ .ptime || param.maxFramerate || param.scaleResolutionDownBy || param.rid;
+ }
+
+ _isOwtEncodingParameters(obj) {
+ if (!Array.isArray(obj)) {
+ return false;
+ }
+ // Only check the first one.
+ const param = obj[0];
+ return !!param.codec;
+ }
}
From 2e81905d960ca97ed51ef6e136d0edbdb69f5519 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Fri, 16 Aug 2019 16:18:57 +0800
Subject: [PATCH 10/52] Upgrade conference protocol version to 1.1.
---
docs/mdfiles/changelog.md | 1 +
src/sdk/base/publication.js | 13 ++++++--
src/sdk/conference/client.js | 2 +-
src/sdk/conference/streamutils.js | 51 +++++++++++++++----------------
4 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/docs/mdfiles/changelog.md b/docs/mdfiles/changelog.md
index 47374314..26d613c4 100644
--- a/docs/mdfiles/changelog.md
+++ b/docs/mdfiles/changelog.md
@@ -2,6 +2,7 @@ Change Log
==========
# 4.3
* The type of `conferenceClient.publish` method's option is changed from `AudioEncodingParameters` and `VideoEncodingParameters` to `RTCRtpSendParameters`.
+* `audio` and `video` of `PublicationSettings` is changed from `AudioPublicationSettings` and `VideoPublicationSettings` to `AudioPublicationSettings` array and `VideoPublicationSettings` array.
# 4.0.2
* Fix a compatibility issue for Chrome 69 beta.
diff --git a/src/sdk/base/publication.js b/src/sdk/base/publication.js
index fa52d595..889cefaa 100644
--- a/src/sdk/base/publication.js
+++ b/src/sdk/base/publication.js
@@ -34,7 +34,7 @@ export class AudioPublicationSettings {
*/
export class VideoPublicationSettings {
// eslint-disable-next-line require-jsdoc
- constructor(codec, resolution, frameRate, bitrate, keyFrameInterval) {
+ constructor(codec, resolution, frameRate, bitrate, keyFrameInterval, rid) {
/**
* @member {?Owt.Base.VideoCodecParameters} codec
* @instance
@@ -67,6 +67,13 @@ export class VideoPublicationSettings {
* @memberof Owt.Base.VideoPublicationSettings
*/
this.keyFrameInterval=keyFrameInterval;
+ /**
+ * @member {?number} rid
+ * @instance
+ * @classDesc Restriction identifier to identify the RTP Streams within an RTP session.
+ * @memberof Owt.Base.VideoPublicationSettings
+ */
+ this.rid=rid;
}
}
@@ -80,13 +87,13 @@ export class PublicationSettings {
// eslint-disable-next-line require-jsdoc
constructor(audio, video) {
/**
- * @member {Owt.Base.AudioPublicationSettings} audio
+ * @member {Owt.Base.AudioPublicationSettings[]} audio
* @instance
* @memberof Owt.Base.PublicationSettings
*/
this.audio=audio;
/**
- * @member {Owt.Base.VideoPublicationSettings} video
+ * @member {Owt.Base.VideoPublicationSettings[]} video
* @instance
* @memberof Owt.Base.PublicationSettings
*/
diff --git a/src/sdk/conference/client.js b/src/sdk/conference/client.js
index 6237482a..7fe29a00 100644
--- a/src/sdk/conference/client.js
+++ b/src/sdk/conference/client.js
@@ -29,7 +29,7 @@ const SignalingState = {
CONNECTED: 3,
};
-const protocolVersion = '1.0';
+const protocolVersion = '1.1';
/* eslint-disable valid-jsdoc */
/**
diff --git a/src/sdk/conference/streamutils.js b/src/sdk/conference/streamutils.js
index 40207cd0..0f44941d 100644
--- a/src/sdk/conference/streamutils.js
+++ b/src/sdk/conference/streamutils.js
@@ -47,41 +47,38 @@ function sortResolutions(x, y) {
* @private
*/
export function convertToPublicationSettings(mediaInfo) {
- let audio;
- let audioCodec;
- let video;
- let videoCodec;
- let resolution;
- let framerate;
- let bitrate;
- let keyFrameInterval;
+ let audio = [],
+ video = [];
+ let audioCodec, videoCodec, resolution, framerate, bitrate, keyFrameInterval,
+ rid;
if (mediaInfo.audio) {
if (mediaInfo.audio.format) {
audioCodec = new CodecModule.AudioCodecParameters(
- mediaInfo.audio.format.codec, mediaInfo.audio.format.channelNum,
- mediaInfo.audio.format.sampleRate
- );
+ mediaInfo.audio.format.codec, mediaInfo.audio.format.channelNum,
+ mediaInfo.audio.format.sampleRate);
}
- audio = new PublicationModule.AudioPublicationSettings(audioCodec);
+ audio.push(new PublicationModule.AudioPublicationSettings(audioCodec));
}
if (mediaInfo.video) {
- if (mediaInfo.video.format) {
- videoCodec = new CodecModule.VideoCodecParameters(
- mediaInfo.video.format.codec, mediaInfo.video.format.profile);
- }
- if (mediaInfo.video.parameters) {
- if (mediaInfo.video.parameters.resolution) {
- resolution = new MediaFormatModule.Resolution(
- mediaInfo.video.parameters.resolution.width,
- mediaInfo.video.parameters.resolution.height);
+ for (const videoInfo of mediaInfo.video.original) {
+ if (videoInfo.format) {
+ videoCodec = new CodecModule.VideoCodecParameters(
+ videoInfo.format.codec, videoInfo.format.profile);
+ }
+ if (videoInfo.parameters) {
+ if (videoInfo.parameters.resolution) {
+ resolution = new MediaFormatModule.Resolution(
+ videoInfo.parameters.resolution.width,
+ videoInfo.parameters.resolution.height);
+ }
+ framerate = videoInfo.parameters.framerate;
+ bitrate = videoInfo.parameters.bitrate * 1000;
+ keyFrameInterval = videoInfo.parameters.keyFrameInterval;
+ rid = videoInfo.parameters.simulcastRid;
}
- framerate = mediaInfo.video.parameters.framerate;
- bitrate = mediaInfo.video.parameters.bitrate * 1000;
- keyFrameInterval = mediaInfo.video.parameters.keyFrameInterval;
+ video.push(new PublicationModule.VideoPublicationSettings(
+ videoCodec, resolution, framerate, bitrate, keyFrameInterval, rid));
}
- video = new PublicationModule.VideoPublicationSettings(videoCodec,
- resolution, framerate, bitrate, keyFrameInterval
- );
}
return new PublicationModule.PublicationSettings(audio, video);
}
From 54924a6eba77adc2b6bbd5be6f5c6603fcc9f2bf Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Mon, 19 Aug 2019 10:14:46 +0800
Subject: [PATCH 11/52] Remove offerToReceiveAudio/offerToReceiveVideo. (#174)
These are legacy configurations.
---
src/sdk/conference/channel.js | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 25a8f236..64dc268c 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -191,10 +191,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
});
this.dispatchEvent(messageEvent);
this._internalId = data.id;
- const offerOptions = {
- offerToReceiveAudio: false,
- offerToReceiveVideo: false,
- };
if (typeof this._pc.addTransceiver === 'function') {
// |direction| seems not working on Safari.
if (mediaOptions.audio && stream.mediaStream.getAudioTracks() > 0) {
@@ -205,7 +201,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
}
let localDesc;
- this._pc.createOffer(offerOptions).then((desc) => {
+ this._pc.createOffer().then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
}
@@ -319,10 +315,6 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this.dispatchEvent(messageEvent);
this._internalId = data.id;
this._createPeerConnection();
- const offerOptions = {
- offerToReceiveAudio: !!options.audio,
- offerToReceiveVideo: !!options.video,
- };
if (typeof this._pc.addTransceiver === 'function') {
// |direction| seems not working on Safari.
if (mediaOptions.audio) {
@@ -332,7 +324,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this._pc.addTransceiver('video', {direction: 'recvonly'});
}
}
- this._pc.createOffer(offerOptions).then((desc) => {
+ this._pc.createOffer().then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
}
From 92a8a17da670235553b87d02c562da8085c81b57 Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Mon, 19 Aug 2019 10:16:29 +0800
Subject: [PATCH 12/52] Add a test case for removeEventListener. (#188)
---
test/unit/resources/scripts/conference.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/test/unit/resources/scripts/conference.js b/test/unit/resources/scripts/conference.js
index f28e3be1..1a4af0b6 100644
--- a/test/unit/resources/scripts/conference.js
+++ b/test/unit/resources/scripts/conference.js
@@ -35,5 +35,17 @@ describe('Unit tests for ConferenceClient', function() {
});
conf2.dispatchEvent(new EventModule.OwtEvent('test'));
});
+
+ it('Event listener should not be triggered after removeEventListener.',
+ done => {
+ const conf1 = new ConferenceClient({});
+ const listener = () => {
+ done('Event listener should not be fired.');
+ };
+ conf1.addEventListener('test', listener);
+ conf1.removeEventListener('test', listener);
+ conf1.dispatchEvent(new EventModule.OwtEvent('test'));
+ done();
+ });
});
});
From 68dc9c08a066311ad4f3a2fd0a7c587be4b9a340 Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Mon, 19 Aug 2019 10:17:09 +0800
Subject: [PATCH 13/52] Upgrade npm dependencies. (#189)
---
package-lock.json | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 72288170..23f94a70 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5917,9 +5917,9 @@
}
},
"lodash": {
- "version": "4.17.11",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
- "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==",
"dev": true
},
"lodash.clonedeep": {
@@ -5965,9 +5965,9 @@
"dev": true
},
"lodash.mergewith": {
- "version": "4.6.1",
- "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz",
- "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==",
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz",
+ "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==",
"dev": true
},
"lolex": {
From ca9d28db342e7f1148b452bf43753d99187cbf4a Mon Sep 17 00:00:00 2001
From: zhangyihui1 <42208024+zhangyihui1@users.noreply.github.com>
Date: Mon, 19 Aug 2019 13:26:31 +0800
Subject: [PATCH 14/52] Using more-accurate method --git-branch to get PR ID.
(#184)
---
test/p2p.jenkinsfile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/p2p.jenkinsfile b/test/p2p.jenkinsfile
index 1908cb57..2f2d17e6 100644
--- a/test/p2p.jenkinsfile
+++ b/test/p2p.jenkinsfile
@@ -27,7 +27,7 @@ pipeline {
withEnv(['JENKINS_NODE_COOKIE=dontkill']) {
sh "python ${env.startServerScript} --p2p-server-path ${env.p2pServerPath} \
--owner open-webrtc-toolkit --repo owt-client-javascript --commit-id ${GIT_COMMIT} \
- --github-script ${env.serverGithubScriptPath} --mode p2p"
+ --git-branch ${GIT_BRANCH} --github-script ${env.serverGithubScriptPath} --mode p2p --workspace ${WORKSPACE}"
}
}
}
@@ -43,7 +43,7 @@ pipeline {
steps {
sh "python ${env.jsCiScriptPath}/runTest.py --mode ci --source-path ${env.jsSourcePath} \
--browsers chrome --mode ci --owner open-webrtc-toolkit --repo owt-client-javascript \
- --commit-id ${GIT_COMMIT} --github-script ${env.jsP2PTestGithubScriptPath}"
+ --git-branch ${GIT_BRANCH} --github-script ${env.jsP2PTestGithubScriptPath}"
}
}
}
@@ -56,4 +56,4 @@ pipeline {
setBuildStatus("${env.jsUrl}", "Build failed", "FAILURE");
}
}
-}
+}
\ No newline at end of file
From f1146bcd35edcb9956ef6848089e3b7cb7ae50d0 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Fri, 16 Aug 2019 16:57:12 +0800
Subject: [PATCH 15/52] Add rid to VideoSubscriptionConstraints.
---
docs/mdfiles/changelog.md | 1 +
src/sdk/conference/channel.js | 1 +
src/sdk/conference/subscription.js | 9 ++++++++-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs/mdfiles/changelog.md b/docs/mdfiles/changelog.md
index 26d613c4..572a7ef3 100644
--- a/docs/mdfiles/changelog.md
+++ b/docs/mdfiles/changelog.md
@@ -3,6 +3,7 @@ Change Log
# 4.3
* The type of `conferenceClient.publish` method's option is changed from `AudioEncodingParameters` and `VideoEncodingParameters` to `RTCRtpSendParameters`.
* `audio` and `video` of `PublicationSettings` is changed from `AudioPublicationSettings` and `VideoPublicationSettings` to `AudioPublicationSettings` array and `VideoPublicationSettings` array.
+* Add `rid` to `VideoSubscriptionConstraints`. When `rid` is specified, other constraints will be ignored.
# 4.0.2
* Fix a compatibility issue for Chrome 69 beta.
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 7dedd9ca..adc679f5 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -322,6 +322,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
bitrate: options.video.bitrateMultiplier ? 'x'
+ options.video.bitrateMultiplier.toString() : undefined,
keyFrameInterval: options.video.keyFrameInterval,
+ simulcastRid: options.video.rid
};
}
} else {
diff --git a/src/sdk/conference/subscription.js b/src/sdk/conference/subscription.js
index 347d7052..21e269a4 100644
--- a/src/sdk/conference/subscription.js
+++ b/src/sdk/conference/subscription.js
@@ -121,7 +121,7 @@ export class AudioSubscriptionConstraints {
export class VideoSubscriptionConstraints {
// eslint-disable-next-line require-jsdoc
constructor(codecs, resolution, frameRate, bitrateMultiplier,
- keyFrameInterval) {
+ keyFrameInterval, rid) {
/**
* @member {?Array.} codecs
* @instance
@@ -157,6 +157,13 @@ export class VideoSubscriptionConstraints {
* @desc Only keyFrameIntervals listed in Owt.Conference.VideoSubscriptionCapabilities are allowed.
*/
this.keyFrameInterval = keyFrameInterval;
+ /**
+ * @member {?number} rid
+ * @instance
+ * @memberof Owt.Conference.VideoSubscriptionConstraints
+ * @desc Restriction identifier to identify the RTP Streams within an RTP session. When rid is specified, other constraints will be ignored.
+ */
+ this.rid = rid;
}
}
From 34861f09432b338465f7a679f450947ada240420 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Fri, 16 Aug 2019 18:43:36 +0800
Subject: [PATCH 16/52] Enable simulcast in conference sample.
---
src/samples/conference/public/scripts/index.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/samples/conference/public/scripts/index.js b/src/samples/conference/public/scripts/index.js
index 82eca356..085bcdcc 100644
--- a/src/samples/conference/public/scripts/index.js
+++ b/src/samples/conference/public/scripts/index.js
@@ -147,7 +147,11 @@ const runSocketIOSample = function() {
mediaStream, new Owt.Base.StreamSourceInfo(
'mic', 'camera'));
$('.local video').get(0).srcObject = stream;
- conference.publish(localStream).then(publication => {
+ conference.publish(localStream, {video:[
+ {rid: 'q', active: true, scaleResolutionDownBy: 4.0},
+ {rid: 'h', active: true, scaleResolutionDownBy: 2.0},
+ {rid: 'f', active: true}
+ ]}).then(publication => {
publicationGlobal = publication;
mixStream(myRoom, publication.id, 'common')
publication.addEventListener('error', (err) => {
From 3bb7ed7160f34cd3495f1237eca623e31f9622d4 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Mon, 19 Aug 2019 17:34:43 +0800
Subject: [PATCH 17/52] Replace capabilities with extraCapabilities.
The relationship of each properties in capabilities is OR. When simulcast
is enabled, transcoding will be disabled. In this case, capabilities cannot
represent a stream's settings, which should be included in capabilites.
extraCapabilities doesn't include settings, it only includes transcoding
formats for now. "Transcoding formats" means the formats described in
optional property of a stream.
---
.../conference/public/scripts/index.js | 6 +++--
src/sdk/base/stream.js | 6 ++---
src/sdk/conference/channel.js | 12 +++++-----
src/sdk/conference/client.js | 6 +++--
src/sdk/conference/mixedstream.js | 3 ++-
src/sdk/conference/streamutils.js | 23 -------------------
6 files changed, 19 insertions(+), 37 deletions(-)
diff --git a/src/samples/conference/public/scripts/index.js b/src/samples/conference/public/scripts/index.js
index 085bcdcc..ff62b4fc 100644
--- a/src/samples/conference/public/scripts/index.js
+++ b/src/samples/conference/public/scripts/index.js
@@ -65,7 +65,8 @@ const runSocketIOSample = function() {
});
}
let $p = $(`
`)
- for (const resolution of stream.capabilities.video.resolutions) {
+ // TODO: Add resolutions from settings.
+ for (const resolution of stream.extraCapabilities.video.resolutions) {
const button = $('', {
text: resolution.width + 'x' +
resolution.height,
@@ -180,7 +181,8 @@ const runSocketIOSample = function() {
console.log('Subscription error: ' + err.error.message);
})
});
- for (const resolution of stream.capabilities.video.resolutions) {
+ // TODO: Add resolutions from settings.
+ for (const resolution of stream.extraCapabilities.video.resolutions) {
const button = $('', {
text: resolution.width + 'x' +
resolution.height,
diff --git a/src/sdk/base/stream.js b/src/sdk/base/stream.js
index 4e93ce9e..ffd3cf29 100644
--- a/src/sdk/base/stream.js
+++ b/src/sdk/base/stream.js
@@ -168,12 +168,12 @@ export class RemoteStream extends Stream {
*/
this.settings = undefined;
/**
- * @member {Owt.Conference.SubscriptionCapabilities} capabilities
+ * @member {Owt.Conference.SubscriptionCapabilities} extraCapabilities
* @instance
* @memberof Owt.Base.RemoteStream
- * @desc Capabilities remote endpoint provides for subscription. This property is only valid in conference mode.
+ * @desc Extra capabilities remote endpoint provides for subscription. Extra capabilities don't include original settings. This property is only valid in conference mode.
*/
- this.capabilities = undefined;
+ this.extraCapabilities = undefined;
}
}
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index adc679f5..2574df28 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -258,18 +258,18 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
subscribe(stream, options) {
if (options === undefined) {
options = {
- audio: !!stream.capabilities.audio,
- video: !!stream.capabilities.video,
+ audio: !!stream.settings.audio,
+ video: !!stream.settings.video,
};
}
if (typeof options !== 'object') {
return Promise.reject(new TypeError('Options should be an object.'));
}
if (options.audio === undefined) {
- options.audio = !!stream.capabilities.audio;
+ options.audio = !!stream.settings.audio;
}
if (options.video === undefined) {
- options.video = !!stream.capabilities.video;
+ options.video = !!stream.settings.video;
}
if ((options.audio !== undefined && typeof options.audio !== 'object' &&
typeof options.audio !== 'boolean' && options.audio !== null) || (
@@ -277,8 +277,8 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
typeof options.video !== 'boolean' && options.video !== null)) {
return Promise.reject(new TypeError('Invalid options type.'));
}
- if (options.audio && !stream.capabilities.audio || (options.video &&
- !stream.capabilities.video)) {
+ if (options.audio && !stream.settings.audio || (options.video &&
+ !stream.settings.video)) {
return Promise.reject(new ConferenceError(
'options.audio/video cannot be true or an object if there is no '
+ 'audio/video track in remote stream.'
diff --git a/src/sdk/conference/client.js b/src/sdk/conference/client.js
index 7fe29a00..d229af6f 100644
--- a/src/sdk/conference/client.js
+++ b/src/sdk/conference/client.js
@@ -260,7 +260,8 @@ export const ConferenceClient = function(config, signalingImpl) {
const stream = remoteStreams.get(streamInfo.id);
stream.settings = StreamUtilsModule.convertToPublicationSettings(streamInfo
.media);
- stream.capabilities = StreamUtilsModule.convertToSubscriptionCapabilities(
+ stream.extraCapabilities = StreamUtilsModule
+ .convertToSubscriptionCapabilities(
streamInfo.media);
const streamEvent = new EventModule.OwtEvent('updated');
stream.dispatchEvent(streamEvent);
@@ -283,7 +284,8 @@ export const ConferenceClient = function(config, signalingImpl) {
audioSourceInfo, videoSourceInfo), streamInfo.info.attributes);
stream.settings = StreamUtilsModule.convertToPublicationSettings(
streamInfo.media);
- stream.capabilities = StreamUtilsModule.convertToSubscriptionCapabilities(
+ stream.extraCapabilities = StreamUtilsModule
+ .convertToSubscriptionCapabilities(
streamInfo.media);
return stream;
}
diff --git a/src/sdk/conference/mixedstream.js b/src/sdk/conference/mixedstream.js
index bc821f1e..73383313 100644
--- a/src/sdk/conference/mixedstream.js
+++ b/src/sdk/conference/mixedstream.js
@@ -33,7 +33,8 @@ export class RemoteMixedStream extends StreamModule.RemoteStream {
this.settings = StreamUtilsModule.convertToPublicationSettings(info.media);
- this.capabilities = new StreamUtilsModule.convertToSubscriptionCapabilities(
+ this.extraCapabilities = new StreamUtilsModule
+ .convertToSubscriptionCapabilities(
info.media);
}
}
diff --git a/src/sdk/conference/streamutils.js b/src/sdk/conference/streamutils.js
index 0f44941d..bd3d31e9 100644
--- a/src/sdk/conference/streamutils.js
+++ b/src/sdk/conference/streamutils.js
@@ -92,11 +92,6 @@ export function convertToSubscriptionCapabilities(mediaInfo) {
let audio; let video;
if (mediaInfo.audio) {
const audioCodecs = [];
- if (mediaInfo.audio && mediaInfo.audio.format) {
- audioCodecs.push(new CodecModule.AudioCodecParameters(
- mediaInfo.audio.format.codec, mediaInfo.audio.format.channelNum,
- mediaInfo.audio.format.sampleRate));
- }
if (mediaInfo.audio && mediaInfo.audio.optional &&
mediaInfo.audio.optional.format) {
for (const audioCodecInfo of mediaInfo.audio.optional.format) {
@@ -111,10 +106,6 @@ export function convertToSubscriptionCapabilities(mediaInfo) {
}
if (mediaInfo.video) {
const videoCodecs = [];
- if (mediaInfo.video && mediaInfo.video.format) {
- videoCodecs.push(new CodecModule.VideoCodecParameters(
- mediaInfo.video.format.codec, mediaInfo.video.format.profile));
- }
if (mediaInfo.video && mediaInfo.video.optional &&
mediaInfo.video.optional.format) {
for (const videoCodecInfo of mediaInfo.video.optional.format) {
@@ -127,12 +118,6 @@ export function convertToSubscriptionCapabilities(mediaInfo) {
const resolutions = Array.from(
mediaInfo.video.optional.parameters.resolution,
(r) => new MediaFormatModule.Resolution(r.width, r.height));
- if (mediaInfo.video && mediaInfo.video.parameters &&
- mediaInfo.video.parameters.resolution) {
- resolutions.push(new MediaFormatModule.Resolution(
- mediaInfo.video.parameters.resolution.width,
- mediaInfo.video.parameters.resolution.height));
- }
resolutions.sort(sortResolutions);
const bitrates = Array.from(
mediaInfo.video.optional.parameters.bitrate,
@@ -141,17 +126,9 @@ export function convertToSubscriptionCapabilities(mediaInfo) {
bitrates.sort(sortNumbers);
const frameRates = JSON.parse(
JSON.stringify(mediaInfo.video.optional.parameters.framerate));
- if (mediaInfo.video && mediaInfo.video.parameters &&
- mediaInfo.video.parameters.framerate) {
- frameRates.push(mediaInfo.video.parameters.framerate);
- }
frameRates.sort(sortNumbers);
const keyFrameIntervals = JSON.parse(
JSON.stringify(mediaInfo.video.optional.parameters.keyFrameInterval));
- if (mediaInfo.video && mediaInfo.video.parameters &&
- mediaInfo.video.parameters.keyFrameInterval) {
- keyFrameIntervals.push(mediaInfo.video.parameters.keyFrameInterval);
- }
keyFrameIntervals.sort(sortNumbers);
video = new SubscriptionModule.VideoSubscriptionCapabilities(
videoCodecs, resolutions, frameRates, bitrates, keyFrameIntervals);
From b9bd1a699848b5ef468e154fc3e3df0b5b232c04 Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Mon, 26 Aug 2019 23:56:45 +0800
Subject: [PATCH 18/52] Include hidden files in release package. (#201)
---
scripts/Gruntfile.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/Gruntfile.js b/scripts/Gruntfile.js
index 463e3c86..66aa7201 100644
--- a/scripts/Gruntfile.js
+++ b/scripts/Gruntfile.js
@@ -227,7 +227,8 @@ window.L = L;\n\
expand: true,
cwd: 'dist/',
src:['samples/**','screen-sharing-chrome-extension/**','sdk/**','ThirdpartyLicenses.txt'],
- dest:'./'
+ dest:'./',
+ dot: true
}]
}
},
From 64125eefe352c360becfb2c08c0d73435c58d5a8 Mon Sep 17 00:00:00 2001
From: Jianjun Zhu
Date: Mon, 26 Aug 2019 22:05:01 +0800
Subject: [PATCH 19/52] Allow video codec preference when publishing with
RTCRtpEncodingParameters.
As per Lei's request, codec preference is a mandatory feature for simulcast.
This parameter is a workaround for setting video codecs. We'll move to
RTCRtpSendParameters in the future.
---
src/sdk/base/publication.js | 4 ++--
src/sdk/conference/channel.js | 9 ++++++++-
src/sdk/conference/client.js | 5 +++--
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/sdk/base/publication.js b/src/sdk/base/publication.js
index 889cefaa..7df94980 100644
--- a/src/sdk/base/publication.js
+++ b/src/sdk/base/publication.js
@@ -181,14 +181,14 @@ export class PublishOptions {
* @member {?Array | ?Array} audio
* @instance
* @memberof Owt.Base.PublishOptions
- * @desc Parameters for audio RtpSender.
+ * @desc Parameters for audio RtpSender. Publishing with RTCRtpEncodingParameters is an experimental feature. It is subject to change.
*/
this.audio = audio;
/**
* @member {?Array | ?Array} video
* @instance
* @memberof Owt.Base.PublishOptions
- * @desc Parameters for video RtpSender.
+ * @desc Parameters for video RtpSender. Publishing with RTCRtpEncodingParameters is an experimental feature. It is subject to change.
*/
this.video = video;
}
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 2574df28..d968ed7c 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -34,6 +34,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
super();
this._config = config;
this._options = null;
+ this._videoCodecs = undefined;
this._signaling = signaling;
this._pc = null;
this._internalId = null; // It's publication ID or subscription ID.
@@ -75,7 +76,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
}
- publish(stream, options) {
+ publish(stream, options, videoCodecs) {
if (options === undefined) {
options = {audio: !!stream.mediaStream.getAudioTracks().length, video: !!stream
.mediaStream.getVideoTracks().length};
@@ -218,6 +219,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
};
if (this._isRtpEncodingParameters(options.video)) {
transceiverInit.sendEncodings = options.video;
+ this._videoCodecs = videoCodecs;
}
this._pc.addTransceiver(stream.mediaStream.getVideoTracks()[0],
transceiverInit);
@@ -675,6 +677,11 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
_setRtpReceiverOptions(sdp, options) {
+ // _videoCodecs is a workaround for setting video codecs. It will be moved to RTCRtpSendParameters.
+ if (this._isRtpEncodingParameters(options.video) && this._videoCodecs) {
+ sdp = SdpUtils.reorderCodecs(sdp, 'video', this._videoCodecs);
+ return sdp;
+ }
if (this._isRtpEncodingParameters(options.audio) ||
this._isRtpEncodingParameters(options.video)) {
return sdp;
diff --git a/src/sdk/conference/client.js b/src/sdk/conference/client.js
index d229af6f..2d8b1a7b 100644
--- a/src/sdk/conference/client.js
+++ b/src/sdk/conference/client.js
@@ -394,9 +394,10 @@ export const ConferenceClient = function(config, signalingImpl) {
* @desc Publish a LocalStream to conference server. Other participants will be able to subscribe this stream when it is successfully published.
* @param {Owt.Base.LocalStream} stream The stream to be published.
* @param {Owt.Base.PublishOptions} options Options for publication.
+ * @param {string[]} videoCodecs Video codec names for publishing. Valid values are 'VP8', 'VP9' and 'H264'. This parameter only valid when options.video is RTCRtpEncodingParameters. Publishing with RTCRtpEncodingParameters is an experimental feature. This parameter is subject to change.
* @returns {Promise} Returned promise will be resolved with a newly created Publication once specific stream is successfully published, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully published means PeerConnection is established and server is able to process media data.
*/
- this.publish = function(stream, options) {
+ this.publish = function(stream, options, videoCodecs) {
if (!(stream instanceof StreamModule.LocalStream)) {
return Promise.reject(new ConferenceError('Invalid stream.'));
}
@@ -405,7 +406,7 @@ export const ConferenceClient = function(config, signalingImpl) {
'Cannot publish a published stream.'));
}
const channel = createPeerConnectionChannel();
- return channel.publish(stream, options);
+ return channel.publish(stream, options, videoCodecs);
};
/**
From 9f4fc39df26800e3ee92c3bf7a2842e9670ae27e Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Fri, 30 Aug 2019 14:39:09 +0800
Subject: [PATCH 20/52] Fix rid setting in signaling (#213)
---
src/sdk/conference/channel.js | 6 ++++--
src/sdk/conference/streamutils.js | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index e4f401b3..e237720d 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -319,10 +319,12 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
framerate: options.video.frameRate,
bitrate: options.video.bitrateMultiplier ? 'x'
+ options.video.bitrateMultiplier.toString() : undefined,
- keyFrameInterval: options.video.keyFrameInterval,
- simulcastRid: options.video.rid
+ keyFrameInterval: options.video.keyFrameInterval
};
}
+ if (options.video.rid) {
+ mediaOptions.video.simulcastRid = options.video.rid;
+ }
} else {
mediaOptions.video = false;
}
diff --git a/src/sdk/conference/streamutils.js b/src/sdk/conference/streamutils.js
index bd3d31e9..585ef269 100644
--- a/src/sdk/conference/streamutils.js
+++ b/src/sdk/conference/streamutils.js
@@ -74,7 +74,9 @@ export function convertToPublicationSettings(mediaInfo) {
framerate = videoInfo.parameters.framerate;
bitrate = videoInfo.parameters.bitrate * 1000;
keyFrameInterval = videoInfo.parameters.keyFrameInterval;
- rid = videoInfo.parameters.simulcastRid;
+ }
+ if (videoInfo.simulcastRid) {
+ rid = videoInfo.simulcastRid;
}
video.push(new PublicationModule.VideoPublicationSettings(
videoCodec, resolution, framerate, bitrate, keyFrameInterval, rid));
From 3a4aa61747e03052ce40e1bfd7a9e09ded482d44 Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Thu, 5 Sep 2019 09:33:31 +0800
Subject: [PATCH 21/52] Add simulcast parameter in sample page (#220)
---
.../conference/public/scripts/index.js | 144 +++++++++---------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/src/samples/conference/public/scripts/index.js b/src/samples/conference/public/scripts/index.js
index ff62b4fc..aead63d7 100644
--- a/src/samples/conference/public/scripts/index.js
+++ b/src/samples/conference/public/scripts/index.js
@@ -48,11 +48,44 @@ const runSocketIOSample = function() {
var subscribeForward = getParameterByName('forward') === 'true'?true:false;
var isSelf = getParameterByName('self') === 'false'?false:true;
conference = new Owt.Conference.ConferenceClient();
- function renderVideo(stream){
- let subscirptionForward=null;
- function subscribeDifferentResolutionForward(forward, resolution){
- subscirptionForward && subscirptionForward.stop();
- subscirptionForward = null;
+ function createResolutionButtons(stream, subscribeResolutionCallback) {
+ let $p = $(`#${stream.id}resolutions`);
+ if ($p.length === 0) {
+ $p = $(`
`);
+ $p.appendTo($('body'));
+ }
+ // Resolutions from settings.
+ for (const videoSetting of stream.settings.video) {
+ const resolution = videoSetting.resolution;
+ if (resolution) {
+ const button = $('', {
+ text: resolution.width + 'x' +
+ resolution.height,
+ click: () => {
+ subscribeResolutionCallback(stream, resolution);
+ }
+ });
+ button.prependTo($p);
+ }
+ }
+ // Resolutions from extraCapabilities.
+ for (const resolution of stream.extraCapabilities.video.resolutions) {
+ const button = $('', {
+ text: resolution.width + 'x' +
+ resolution.height,
+ click: () => {
+ subscribeResolutionCallback(stream, resolution);
+ }
+ });
+ button.prependTo($p);
+ };
+ return $p;
+ }
+ function subscribeAndRenderVideo(stream){
+ let subscirptionLocal=null;
+ function subscribeDifferentResolution(stream, resolution){
+ subscirptionLocal && subscirptionLocal.stop();
+ subscirptionLocal = null;
const videoOptions = {};
videoOptions.resolution = resolution;
conference.subscribe(stream, {
@@ -60,26 +93,14 @@ const runSocketIOSample = function() {
video: videoOptions
}).then((
subscription) => {
- subscirptionForward = subscription;
+ subscirptionLocal = subscription;
$(`#${stream.id}`).get(0).srcObject = stream.mediaStream;
});
}
- let $p = $(`
`)
- // TODO: Add resolutions from settings.
- for (const resolution of stream.extraCapabilities.video.resolutions) {
- const button = $('', {
- text: resolution.width + 'x' +
- resolution.height,
- click: () => {
- subscribeDifferentResolutionForward(stream, resolution);
- }
- });
- button.appendTo($p);
- };
- $p.appendTo($('body'));
+ let $p = createResolutionButtons(stream, subscribeDifferentResolution);
conference.subscribe(stream)
.then((subscription)=>{
- subscirptionForward = subscription;
+ subscirptionLocal = subscription;
let $video = $(``);
$video.get(0).srcObject = stream.mediaStream;
$p.append($video);
@@ -89,29 +110,20 @@ const runSocketIOSample = function() {
removeUi(stream.id);
$(`#${stream.id}resolutions`).remove();
});
+ stream.addEventListener('updated', () => {
+ // Update resolution buttons
+ $p.children('button').remove();
+ createResolutionButtons(stream, subscribeDifferentResolution);
+ });
}
function removeUi(id){
$(`#${id}`).remove();
}
- function subscribeDifferentResolution(stream, resolution) {
- subscriptionForMixedStream.stop();
- subscriptionForMixedStream = null;
- const videoOptions = {};
- videoOptions.resolution = resolution;
- conference.subscribe(stream, {
- audio: true,
- video: videoOptions
- }).then((
- subscription) => {
- subscriptionForMixedStream = subscription;
- $(`#${stream.id}`).get(0).srcObject = stream.mediaStream;
- });
- }
conference.addEventListener('streamadded', (event) => {
console.log('A new stream is added ', event.stream.id);
isSelf = isSelf?isSelf:event.stream.id != publicationGlobal.id;
- subscribeForward && isSelf && renderVideo(event.stream);
+ subscribeForward && isSelf && subscribeAndRenderVideo(event.stream);
mixStream(myRoom, event.stream.id, 'common');
event.stream.addEventListener('ended', () => {
console.log(event.stream.id + ' is ended.');
@@ -120,10 +132,7 @@ const runSocketIOSample = function() {
window.onload = function() {
- var myResolution = getParameterByName('resolution') || {
- width: 1280,
- height: 720
- };
+ var simulcast = getParameterByName('simulcast') || false;
var shareScreen = getParameterByName('screen') || false;
myRoom = getParameterByName('room');
var isHttps = (location.protocol === 'https:');
@@ -138,21 +147,34 @@ const runSocketIOSample = function() {
startStreamingIn(myRoom, mediaUrl);
}
if (isPublish !== 'false') {
- const audioConstraintsForMic = new Owt.Base.AudioTrackConstraints(Owt.Base.AudioSourceInfo.MIC);
- const videoConstraintsForCamera = new Owt.Base.VideoTrackConstraints(Owt.Base.VideoSourceInfo.CAMERA);
+ // audioConstraintsForMic
+ let audioConstraints = new Owt.Base.AudioTrackConstraints(Owt.Base.AudioSourceInfo.MIC);
+ // videoConstraintsForCamera
+ let videoConstraints = new Owt.Base.VideoTrackConstraints(Owt.Base.VideoSourceInfo.CAMERA);
+ if (shareScreen) {
+ // audioConstraintsForScreen
+ audioConstraints = new Owt.Base.AudioTrackConstraints(Owt.Base.AudioSourceInfo.SCREENCAST);
+ // videoConstraintsForScreen
+ videoConstraints = new Owt.Base.VideoTrackConstraints(Owt.Base.VideoSourceInfo.SCREENCAST);
+ }
+
let mediaStream;
Owt.Base.MediaStreamFactory.createMediaStream(new Owt.Base.StreamConstraints(
- audioConstraintsForMic, videoConstraintsForCamera)).then(stream => {
+ audioConstraints, videoConstraints)).then(stream => {
+ let publishOption;
+ if (simulcast) {
+ publishOption = {video:[
+ {rid: 'q', active: true/*, scaleResolutionDownBy: 4.0*/},
+ {rid: 'h', active: true/*, scaleResolutionDownBy: 2.0*/},
+ {rid: 'f', active: true}
+ ]};
+ }
mediaStream = stream;
localStream = new Owt.Base.LocalStream(
mediaStream, new Owt.Base.StreamSourceInfo(
'mic', 'camera'));
$('.local video').get(0).srcObject = stream;
- conference.publish(localStream, {video:[
- {rid: 'q', active: true, scaleResolutionDownBy: 4.0},
- {rid: 'h', active: true, scaleResolutionDownBy: 2.0},
- {rid: 'f', active: true}
- ]}).then(publication => {
+ conference.publish(localStream, publishOption).then(publication => {
publicationGlobal = publication;
mixStream(myRoom, publication.id, 'common')
publication.addEventListener('error', (err) => {
@@ -169,32 +191,10 @@ const runSocketIOSample = function() {
if(!subscribeForward){
if (stream.source.audio === 'mixed' || stream.source.video ===
'mixed') {
- conference.subscribe(stream, {
- audio: {codecs:[{name:'opus'}]},
- video: true
- }).then((subscription) => {
- subscriptionForMixedStream = subscription;
- let $video = $(``);
- $video.get(0).srcObject = stream.mediaStream;
- $('body').append($video);
- subscription.addEventListener('error', (err) => {
- console.log('Subscription error: ' + err.error.message);
- })
- });
- // TODO: Add resolutions from settings.
- for (const resolution of stream.extraCapabilities.video.resolutions) {
- const button = $('', {
- text: resolution.width + 'x' +
- resolution.height,
- click: () => {
- subscribeDifferentResolution(stream, resolution);
- }
- });
- button.appendTo($('body'));
- };
+ subscribeAndRenderVideo(stream);
}
- }else if(stream.source.audio !== 'mixed'){
- subscribeForward && renderVideo(stream);
+ } else if (stream.source.audio !== 'mixed') {
+ subscribeAndRenderVideo(stream);
}
}
console.log('Streams in conference:', streams.length);
From c9fb0a82e3e18bbb44e135261a6a2f28284c63ce Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Thu, 5 Sep 2019 10:19:31 +0800
Subject: [PATCH 22/52] Bump version number to 4.3. (#202)
---
docs/jsdoc/config.json | 2 +-
package-lock.json | 2 +-
package.json | 2 +-
src/samples/conference/package.json | 2 +-
src/samples/p2p/js/sc.websocket.js | 2 +-
src/sdk/base/utils.js | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/jsdoc/config.json b/docs/jsdoc/config.json
index 2bb62cd8..ae88a8f0 100644
--- a/docs/jsdoc/config.json
+++ b/docs/jsdoc/config.json
@@ -17,7 +17,7 @@
"dateFormat": "ddd MMM Do YYYY",
"outputSourceFiles": false,
"outputSourcePath": false,
- "systemName": "Intel® Collaboration Suite for WebRTC version 4.2.1",
+ "systemName": "Intel® Collaboration Suite for WebRTC version 4.3",
"footer": "",
"copyright": "Copyright © 2019 Intel Corporation. All Rights Reserved.",
"navType": "vertical",
diff --git a/package-lock.json b/package-lock.json
index 23f94a70..6cb6d433 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "owt-client-javascript",
- "version": "4.2.1",
+ "version": "4.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index b539a488..6310d147 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "owt-client-javascript",
"title": "Open WebRTC Toolkit JavaScript SDK",
"description": "Open WebRTC Toolkit JavaScript SDK",
- "version": "4.2.1",
+ "version": "4.3",
"homepage": "https://webrtc.intel.com",
"author": "Intel WebRTC team",
"contributors": [
diff --git a/src/samples/conference/package.json b/src/samples/conference/package.json
index 7c098325..186df070 100644
--- a/src/samples/conference/package.json
+++ b/src/samples/conference/package.json
@@ -2,7 +2,7 @@
"name": "oms-sample-conference",
"title": "Open WebRTC Toolkit Conference Sample",
"description": "Open WebRTC Toolkit JavaScript Conference Sample",
- "version": "4.2.1",
+ "version": "4.3",
"homepage": "http://webrtc.intel.com",
"author": "Intel WebRTC team",
"keywords": [
diff --git a/src/samples/p2p/js/sc.websocket.js b/src/samples/p2p/js/sc.websocket.js
index da775d77..c425e8d1 100644
--- a/src/samples/p2p/js/sc.websocket.js
+++ b/src/samples/p2p/js/sc.websocket.js
@@ -13,7 +13,7 @@ function SignalingChannel() {
this.onServerDisconnected = null;
var clientType = 'Web';
- var clientVersion = '4.2.1';
+ var clientVersion = '4.3';
var wsServer = null;
diff --git a/src/sdk/base/utils.js b/src/sdk/base/utils.js
index 59e0427f..13f80aa7 100644
--- a/src/sdk/base/utils.js
+++ b/src/sdk/base/utils.js
@@ -5,7 +5,7 @@
/* global navigator, window */
'use strict';
-const sdkVersion = '4.2.1';
+const sdkVersion = '4.3';
// eslint-disable-next-line require-jsdoc
export function isFirefox() {
From 662f33f5d7013ed5b139511b77a2997f82ab59c9 Mon Sep 17 00:00:00 2001
From: cisco66666 <52657199+cisco66666@users.noreply.github.com>
Date: Thu, 5 Sep 2019 20:50:35 +0800
Subject: [PATCH 23/52] User correct version format for package.json (#224)
The "version" field must be in the form `x.x.x`.
---
package.json | 2 +-
src/samples/conference/package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 6310d147..0c53ca92 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "owt-client-javascript",
"title": "Open WebRTC Toolkit JavaScript SDK",
"description": "Open WebRTC Toolkit JavaScript SDK",
- "version": "4.3",
+ "version": "4.3.0",
"homepage": "https://webrtc.intel.com",
"author": "Intel WebRTC team",
"contributors": [
diff --git a/src/samples/conference/package.json b/src/samples/conference/package.json
index 186df070..d34f90f3 100644
--- a/src/samples/conference/package.json
+++ b/src/samples/conference/package.json
@@ -2,7 +2,7 @@
"name": "oms-sample-conference",
"title": "Open WebRTC Toolkit Conference Sample",
"description": "Open WebRTC Toolkit JavaScript Conference Sample",
- "version": "4.3",
+ "version": "4.3.0",
"homepage": "http://webrtc.intel.com",
"author": "Intel WebRTC team",
"keywords": [
From 78633a3d0cbdfc5a6e78ad24573f9a1af61a3cd4 Mon Sep 17 00:00:00 2001
From: Chunbo
Date: Thu, 12 Sep 2019 11:19:15 +0800
Subject: [PATCH 24/52] Enabled Microsoft Edge JS SDK (#234)
---
src/sdk/conference/channel.js | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index e237720d..2d380bc6 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -220,9 +220,24 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this._pc.addTransceiver(stream.mediaStream.getVideoTracks()[0],
transceiverInit);
}
+ } else {
+ if (mediaOptions.audio && stream.mediaStream.getAudioTracks().length > 0) {
+ for (const track of stream.mediaStream.getAudioTracks())
+ this._pc.addTrack(track, stream.mediaStream);
+ }
+
+ if (mediaOptions.video && stream.mediaStream.getVideoTracks().length > 0) {
+ for (const track of stream.mediaStream.getVideoTracks())
+ this._pc.addTrack(track, stream.mediaStream);
+ }
}
+
let localDesc;
- this._pc.createOffer().then((desc) => {
+ const offerOptions = {
+ offerToReceiveAudio: false,
+ offerToReceiveVideo: false,
+ };
+ this._pc.createOffer(offerOptions).then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
}
@@ -328,6 +343,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
} else {
mediaOptions.video = false;
}
+
this._subscribedStream = stream;
this._signaling.sendSignalingMessage('subscribe', {
media: mediaOptions,
@@ -348,7 +364,11 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this._pc.addTransceiver('video', {direction: 'recvonly'});
}
}
- this._pc.createOffer().then((desc) => {
+ const offerOptions = {
+ offerToReceiveAudio: !!options.audio,
+ offerToReceiveVideo: !!options.video,
+ };
+ this._pc.createOffer(offerOptions).then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
}
From c1d2167a135008947b53360c08f7e53463e9e70a Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Fri, 13 Sep 2019 01:30:26 +0800
Subject: [PATCH 25/52] Add detailed type info for SubscribeOptions. (#232)
---
src/sdk/conference/subscription.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sdk/conference/subscription.js b/src/sdk/conference/subscription.js
index 21e269a4..f0f18449 100644
--- a/src/sdk/conference/subscription.js
+++ b/src/sdk/conference/subscription.js
@@ -176,13 +176,13 @@ export class SubscribeOptions {
// eslint-disable-next-line require-jsdoc
constructor(audio, video) {
/**
- * @member {?AudioSubscriptionConstraints} audio
+ * @member {?Owt.Conference.AudioSubscriptionConstraints} audio
* @instance
* @memberof Owt.Conference.SubscribeOptions
*/
this.audio = audio;
/**
- * @member {?VideoSubscriptionConstraints} video
+ * @member {?Owt.Conference.VideoSubscriptionConstraints} video
* @instance
* @memberof Owt.Conference.SubscribeOptions
*/
From 59416337687706631a9398a1c687ae495fae8aa4 Mon Sep 17 00:00:00 2001
From: Chunbo
Date: Mon, 16 Sep 2019 19:26:37 +0800
Subject: [PATCH 26/52] Updated the owt js version (#244)
---
package-lock.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package-lock.json b/package-lock.json
index 6cb6d433..d60fb174 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "owt-client-javascript",
- "version": "4.3",
+ "version": "4.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
From 162cd7eb760ea5928b71277615913b8d6b431b61 Mon Sep 17 00:00:00 2001
From: Chunbo
Date: Tue, 17 Sep 2019 15:20:12 +0800
Subject: [PATCH 27/52] Applied offerOptions only when there is no
addTransceiver in PeerConnection implementation (#249)
---
src/sdk/conference/channel.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 2d380bc6..d3faa4fd 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -195,6 +195,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
});
this.dispatchEvent(messageEvent);
this._internalId = data.id;
+ const offerOptions = {};
if (typeof this._pc.addTransceiver === 'function') {
// |direction| seems not working on Safari.
if (mediaOptions.audio && stream.mediaStream.getAudioTracks().length >
@@ -230,13 +231,12 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
for (const track of stream.mediaStream.getVideoTracks())
this._pc.addTrack(track, stream.mediaStream);
}
+
+ offerOptions.offerToReceiveAudio = false;
+ offerOptions.offerToReceiveVideo = false;
}
let localDesc;
- const offerOptions = {
- offerToReceiveAudio: false,
- offerToReceiveVideo: false,
- };
this._pc.createOffer(offerOptions).then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
@@ -355,6 +355,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this.dispatchEvent(messageEvent);
this._internalId = data.id;
this._createPeerConnection();
+ const offerOptions = {};
if (typeof this._pc.addTransceiver === 'function') {
// |direction| seems not working on Safari.
if (mediaOptions.audio) {
@@ -363,11 +364,11 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
if (mediaOptions.video) {
this._pc.addTransceiver('video', {direction: 'recvonly'});
}
+ } else {
+ offerOptions.offerToReceiveAudio = !!options.audio;
+ offerOptions.offerToReceiveVideo = !!options.video;
}
- const offerOptions = {
- offerToReceiveAudio: !!options.audio,
- offerToReceiveVideo: !!options.video,
- };
+
this._pc.createOffer(offerOptions).then((desc) => {
if (options) {
desc.sdp = this._setRtpReceiverOptions(desc.sdp, options);
From b4d2877bf623aba55dd0f2241175fedfe3ed0336 Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Wed, 18 Sep 2019 08:43:20 +0800
Subject: [PATCH 28/52] Ignore other video subscribe options when RID is set
(#248)
* Ignore other video subscribe options when RID is set
* Update comments
---
src/sdk/conference/channel.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index d3faa4fd..5d38e7d8 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -339,6 +339,9 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
if (options.video.rid) {
mediaOptions.video.simulcastRid = options.video.rid;
+ // Ignore other settings when RID set.
+ delete mediaOptions.video.parameters;
+ options.video = true;
}
} else {
mediaOptions.video = false;
From 21bdf18be35cfbb1bfecc71a381f32d89efd0c4b Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Wed, 9 Oct 2019 10:56:51 +0800
Subject: [PATCH 29/52] Change some triggers for events 'error', 'ended' (#267)
* Change some triggers for events 'error', 'ended'
* Fire events when stop() called
---
src/sdk/conference/channel.js | 59 +++++++++++++++++++++++++----------
1 file changed, 42 insertions(+), 17 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 5d38e7d8..d262ba10 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -48,6 +48,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
// Timer for PeerConnection disconnected. Will stop connection after timer.
this._disconnectTimer = null;
this._ended = false;
+ this._stopped = false;
}
/**
@@ -407,24 +408,30 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
_unpublish() {
- this._signaling.sendSignalingMessage('unpublish', {id: this._internalId})
- .catch((e) => {
- Logger.warning('MCU returns negative ack for unpublishing, ' + e);
- });
- if (this._pc && this._pc.signalingState !== 'closed') {
- this._pc.close();
+ if (!this._stopped) {
+ this._stopped = true;
+ this._signaling.sendSignalingMessage('unpublish', {id: this._internalId})
+ .catch((e) => {
+ Logger.warning('MCU returns negative ack for unpublishing, ' + e);
+ });
+ if (this._pc && this._pc.signalingState !== 'closed') {
+ this._pc.close();
+ }
}
}
_unsubscribe() {
- this._signaling.sendSignalingMessage('unsubscribe', {
- id: this._internalId,
- })
- .catch((e) => {
- Logger.warning('MCU returns negative ack for unsubscribing, ' + e);
- });
- if (this._pc && this._pc.signalingState !== 'closed') {
- this._pc.close();
+ if (!this._stopped) {
+ this._stopped = true;
+ this._signaling.sendSignalingMessage('unsubscribe', {
+ id: this._internalId,
+ })
+ .catch((e) => {
+ Logger.warning('MCU returns negative ack for unsubscribing, ' + e);
+ });
+ if (this._pc && this._pc.signalingState !== 'closed') {
+ this._pc.close();
+ }
}
}
@@ -528,10 +535,23 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
if (event.currentTarget.iceConnectionState === 'closed' ||
event.currentTarget.iceConnectionState === 'failed') {
if (event.currentTarget.iceConnectionState === 'failed') {
- this._handleError('ICE connection failed.');
+ this._handleError('connection failed.');
+ } else {
+ // Fire ended event if publication or subscription exists.
+ this._fireEndedEventOnPublicationOrSubscription();
+ }
+ }
+ }
+
+ _onConnectionStateChange(event) {
+ if (this._pc.connectionState === 'closed' ||
+ this._pc.connectionState === 'failed') {
+ if (this._pc.connectionState === 'failed') {
+ this._handleError('connection failed.');
+ } else {
+ // Fire ended event if publication or subscription exists.
+ this._fireEndedEventOnPublicationOrSubscription();
}
- // Fire ended event if publication or subscription exists.
- this._fireEndedEventOnPublicationOrSubscription();
}
}
@@ -564,6 +584,9 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this._pc.oniceconnectionstatechange = (event) => {
this._onIceConnectionStateChange.apply(this, [event]);
};
+ this._pc.onconnectionstatechange = (event) => {
+ this._onConnectionStateChange.apply(this, [event]);
+ };
}
_getStats() {
@@ -645,6 +668,8 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
error: error,
});
dispatcher.dispatchEvent(errorEvent);
+ // Fire ended event when error occured
+ this._fireEndedEventOnPublicationOrSubscription();
}
_setCodecOrder(sdp, options) {
From c2c6435cfbc51f06188bb508d60cc458984d4504 Mon Sep 17 00:00:00 2001
From: cisco66666 <52657199+cisco66666@users.noreply.github.com>
Date: Thu, 10 Oct 2019 10:10:59 +0800
Subject: [PATCH 30/52] fix unit test (#273)
---
test/conference.jenkinsfile | 2 +-
test/ubuntuconference.jenkinsfile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/conference.jenkinsfile b/test/conference.jenkinsfile
index 832de0c7..ac926066 100644
--- a/test/conference.jenkinsfile
+++ b/test/conference.jenkinsfile
@@ -24,7 +24,7 @@ pipeline {
]) {
node('unit-test') {
container('unit-test') {
- sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh"
+ sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh $env.GIT_BRANCH $env.CHANGE_ID"
}
}
}
diff --git a/test/ubuntuconference.jenkinsfile b/test/ubuntuconference.jenkinsfile
index 394b9a28..78aacbeb 100644
--- a/test/ubuntuconference.jenkinsfile
+++ b/test/ubuntuconference.jenkinsfile
@@ -24,7 +24,7 @@ pipeline {
]) {
node('unit-test-ubuntu') {
container('unit-test-ubuntu') {
- sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh"
+ sh "cd /root/owt-client-javascript/test/unit/karma-test/ && ./start.sh $env.GIT_BRANCH $env.CHANGE_ID"
}
}
}
From 907eba4a9693ed38eb0a33e80e0000f531d34dcf Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Wed, 16 Oct 2019 14:12:46 +0800
Subject: [PATCH 31/52] Enable simulcast publish on Firefox (#280)
* Enable simulcast publish on Firefox
* Update comments
* Add audio encoding settings on firefox
---
src/sdk/conference/channel.js | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index d262ba10..2388f6d1 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -198,6 +198,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
this._internalId = data.id;
const offerOptions = {};
if (typeof this._pc.addTransceiver === 'function') {
+ let setPromise = Promise.resolve();
// |direction| seems not working on Safari.
if (mediaOptions.audio && stream.mediaStream.getAudioTracks().length >
0) {
@@ -207,8 +208,15 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
if (this._isRtpEncodingParameters(options.audio)) {
transceiverInit.sendEncodings = options.audio;
}
- this._pc.addTransceiver(stream.mediaStream.getAudioTracks()[0],
+ const transceiver = this._pc.addTransceiver(stream.mediaStream.getAudioTracks()[0],
transceiverInit);
+
+ if (Utils.isFirefox()) {
+ // Firefox does not support encodings setting in addTransceiver.
+ const parameters = transceiver.sender.getParameters();
+ parameters.encodings = transceiverInit.sendEncodings;
+ setPromise = transceiver.sender.setParameters(parameters);
+ }
}
if (mediaOptions.video && stream.mediaStream.getVideoTracks().length >
0) {
@@ -219,24 +227,32 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
transceiverInit.sendEncodings = options.video;
this._videoCodecs = videoCodecs;
}
- this._pc.addTransceiver(stream.mediaStream.getVideoTracks()[0],
+ const transceiver = this._pc.addTransceiver(stream.mediaStream.getVideoTracks()[0],
transceiverInit);
+
+ if (Utils.isFirefox()) {
+ // Firefox does not support encodings setting in addTransceiver.
+ const parameters = transceiver.sender.getParameters();
+ parameters.encodings = transceiverInit.sendEncodings;
+ setPromise = setPromise.then(
+ () => transceiver.sender.setParameters(parameters));
+ }
}
+ return setPromise.then(() => offerOptions);
} else {
if (mediaOptions.audio && stream.mediaStream.getAudioTracks().length > 0) {
for (const track of stream.mediaStream.getAudioTracks())
this._pc.addTrack(track, stream.mediaStream);
}
-
if (mediaOptions.video && stream.mediaStream.getVideoTracks().length > 0) {
for (const track of stream.mediaStream.getVideoTracks())
this._pc.addTrack(track, stream.mediaStream);
}
-
offerOptions.offerToReceiveAudio = false;
offerOptions.offerToReceiveVideo = false;
}
-
+ return offerOptions;
+ }).then((offerOptions) => {
let localDesc;
this._pc.createOffer(offerOptions).then((desc) => {
if (options) {
From b5245fec31791239b5cf85ef195e061c5f94be4e Mon Sep 17 00:00:00 2001
From: zhangyihui1 <42208024+zhangyihui1@users.noreply.github.com>
Date: Wed, 16 Oct 2019 14:46:12 +0800
Subject: [PATCH 32/52] Update browsers version in docs. (#287)
---
docs/mdfiles/index.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/mdfiles/index.md b/docs/mdfiles/index.md
index 1800c646..a32dcdd0 100644
--- a/docs/mdfiles/index.md
+++ b/docs/mdfiles/index.md
@@ -18,9 +18,9 @@ Conference Mode:
| | Windows* | Ubuntu* | macOS* |
| ------------------------------- | -------- | ------- |------- |
-| Chrome* 73 | √ | √ | √ |
-| Firefox* 66 | √ | √ | √ |
-| Safari* 12 | | | √ |
+| Chrome* 77 | √ | √ | √ |
+| Firefox* 69 | √ | √ | √ |
+| Safari* 13 | | | √ |
| Microsoft Edge* 44.17763.1.0 | √ | | | |
*Table 1: Browser requirements for Conference Mode*
@@ -30,9 +30,9 @@ P2P Mode:
| | Windows* | Ubuntu* | macOS* |
| ------------------------------- | -------- | ------- |------- |
-| Chrome* 73 | √ | √ | √ |
-| Firefox* 66 | √ | √ | √ |
-| Safari* 12 | | | √ |
+| Chrome* 77 | √ | √ | √ |
+| Firefox* 69 | √ | √ | √ |
+| Safari* 13 | | | √ |
*Table 2: Browser requirements for P2P Mode*
From 43b45d573ce38714c938111b9782f2e0f9bc2069 Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Thu, 17 Oct 2019 18:28:43 +0800
Subject: [PATCH 33/52] Add legacy simulcast for Safari (#290)
* Add legacy simulcast for safari
* Remove unused variable
---
src/sdk/base/sdputils.js | 82 +++++++++++++++++++++++++++++++++++
src/sdk/conference/channel.js | 7 +++
2 files changed, 89 insertions(+)
diff --git a/src/sdk/base/sdputils.js b/src/sdk/base/sdputils.js
index 3dd010af..ef1a9251 100644
--- a/src/sdk/base/sdputils.js
+++ b/src/sdk/base/sdputils.js
@@ -603,6 +603,88 @@ export function reorderCodecs(sdp, type, codecs) {
return sdp;
}
+// Add legacy simulcast.
+export function addLegacySimulcast(sdp, type, numStreams) {
+ if (!numStreams || !(numStreams > 1)) {
+ return sdp;
+ }
+
+ let sdpLines = sdp.split('\r\n');
+ // Search for m line.
+ const mLineStart = findLine(sdpLines, 'm=', type);
+ if (mLineStart === null) {
+ return sdp;
+ }
+ let mLineEnd = findLineInRange(sdpLines, mLineStart + 1, -1, 'm=');
+ if (mLineEnd === null) {
+ mLineEnd = sdpLines.length;
+ }
+
+ const ssrcGetter = (line) => {
+ const parts = line.split(' ');
+ const ssrc = parts[0].split(':')[1];
+ return ssrc;
+ };
+
+ // Process ssrc lines from mLineIndex.
+ const removes = new Set();
+ const ssrcs = new Set();
+ const gssrcs = new Set();
+ const simLines = [];
+ const simGroupLines = [];
+ let i = mLineStart + 1;
+ while (i < mLineEnd) {
+ const line = sdpLines[i];
+ if (line === '') {
+ break;
+ }
+ if (line.indexOf('a=ssrc:') > -1) {
+ const ssrc = ssrcGetter(sdpLines[i]);
+ ssrcs.add(ssrc);
+ if (line.indexOf('cname') > -1 || line.indexOf('msid') > -1) {
+ for (let j = 1; j < numStreams; j++) {
+ const nssrc = (parseInt(ssrc) + j) + '';
+ simLines.push(line.replace(ssrc, nssrc));
+ }
+ } else {
+ removes.add(line);
+ }
+ }
+ if (line.indexOf('a=ssrc-group:FID') > -1) {
+ const parts = line.split(' ');
+ gssrcs.add(parts[2]);
+ for (let j = 1; j < numStreams; j++) {
+ const nssrc1 = (parseInt(parts[1]) + j) + '';
+ const nssrc2 = (parseInt(parts[2]) + j) + '';
+ simGroupLines.push(
+ line.replace(parts[1], nssrc1).replace(parts[2], nssrc2));
+ }
+ }
+ i++;
+ }
+
+ const insertPos = i;
+ ssrcs.forEach(ssrc => {
+ if (!gssrcs.has(ssrc)) {
+ let groupLine = 'a=ssrc-group:SIM';
+ groupLine = groupLine + ' ' + ssrc;
+ for (let j = 1; j < numStreams; j++) {
+ groupLine = groupLine + ' ' + (parseInt(ssrc) + j);
+ }
+ simGroupLines.push(groupLine);
+ }
+ });
+
+ simLines.sort();
+ // Insert simulcast ssrc lines.
+ sdpLines.splice(insertPos, 0, ...simGroupLines);
+ sdpLines.splice(insertPos, 0, ...simLines);
+ sdpLines = sdpLines.filter(line => !removes.has(line));
+
+ sdp = sdpLines.join('\r\n');
+ return sdp;
+}
+
export function setMaxBitrate(sdp, encodingParametersList) {
for (const encodingParameters of encodingParametersList) {
if (encodingParameters.maxBitrate) {
diff --git a/src/sdk/conference/channel.js b/src/sdk/conference/channel.js
index 2388f6d1..cd41f1a1 100644
--- a/src/sdk/conference/channel.js
+++ b/src/sdk/conference/channel.js
@@ -736,6 +736,13 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
}
_setRtpReceiverOptions(sdp, options) {
+ // Add legacy simulcast in SDP for safari.
+ if (this._isRtpEncodingParameters(options.video) && Utils.isSafari()) {
+ if (options.video.length > 1) {
+ sdp = SdpUtils.addLegacySimulcast(sdp, 'video', options.video.length);
+ }
+ }
+
// _videoCodecs is a workaround for setting video codecs. It will be moved to RTCRtpSendParameters.
if (this._isRtpEncodingParameters(options.video) && this._videoCodecs) {
sdp = SdpUtils.reorderCodecs(sdp, 'video', this._videoCodecs);
From 961f0a69747e05ff31d4fb04185b92dec25e881c Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Fri, 18 Oct 2019 08:18:17 +0800
Subject: [PATCH 34/52] Add description for VideoCodec. (#265)
---
src/sdk/base/codec.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/sdk/base/codec.js b/src/sdk/base/codec.js
index 512874cc..3240182a 100644
--- a/src/sdk/base/codec.js
+++ b/src/sdk/base/codec.js
@@ -79,6 +79,12 @@ export class AudioEncodingParameters {
}
}
+/**
+ * @class VideoCodec
+ * @memberOf Owt.Base
+ * @classDesc Video codec enumeration.
+ * @hideconstructor
+ */
export const VideoCodec = {
VP8: 'vp8',
VP9: 'vp9',
From 95725bdef34d09ca516258133b7ccfa0c8fb6ac8 Mon Sep 17 00:00:00 2001
From: wayunge <47023511+wayunge@users.noreply.github.com>
Date: Thu, 17 Oct 2019 21:36:43 -0400
Subject: [PATCH 35/52] Sort resolution buttons in ascending order. (#291)
---
src/samples/conference/public/scripts/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/samples/conference/public/scripts/index.js b/src/samples/conference/public/scripts/index.js
index aead63d7..fe21eac6 100644
--- a/src/samples/conference/public/scripts/index.js
+++ b/src/samples/conference/public/scripts/index.js
@@ -69,7 +69,7 @@ const runSocketIOSample = function() {
}
}
// Resolutions from extraCapabilities.
- for (const resolution of stream.extraCapabilities.video.resolutions) {
+ for (const resolution of stream.extraCapabilities.video.resolutions.reverse()) {
const button = $('', {
text: resolution.width + 'x' +
resolution.height,
From 1a1cb6e238cbc54ee15bb5d0284455315a3f5413 Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Fri, 18 Oct 2019 16:00:39 +0800
Subject: [PATCH 36/52] Add two cases for SDP utils. (#269)
---
test/unit/resources/scripts/base.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/test/unit/resources/scripts/base.js b/test/unit/resources/scripts/base.js
index bfa1edb0..c94144b5 100644
--- a/test/unit/resources/scripts/base.js
+++ b/test/unit/resources/scripts/base.js
@@ -166,7 +166,18 @@ describe('Unit tests for SDP utils.', function() {
it('Reorder codecs with undefined codec list should leave SDP unchanged.', (done)=>{
let reorderedSdp = SdpUtils.reorderCodecs(sdp, 'video');
expect(reorderedSdp).to.equal(sdp);
- console.log(reorderedSdp);
+ done();
+ });
+
+ it('Reorder codecs with a preferred codec name should only output spcified codec.', (done)=>{
+ let reorderedSdp = SdpUtils.reorderCodecs(sdp, 'video', ['vp9']);
+ expect(reorderedSdp.includes('m=video 9 UDP/TLS/RTP/SAVPF 98 125 108 99 107',0)).to.equal(true);
+ done();
+ });
+
+ it('Reorder codecs with preferred codec names should only output spcified codecs.', (done)=>{
+ let reorderedSdp = SdpUtils.reorderCodecs(sdp, 'video', ['vp9', 'h264']);
+ expect(reorderedSdp.includes('m=video 9 UDP/TLS/RTP/SAVPF 98 100 102 127 125 108 99 101 124 123 107',0)).to.equal(true);
done();
});
});
From a12ba8f9ff5a56fe5f8987de395a4bc41f4150e4 Mon Sep 17 00:00:00 2001
From: Chunbo
Date: Mon, 21 Oct 2019 14:26:19 +0800
Subject: [PATCH 37/52] Updated Edge browser version (#301)
---
docs/mdfiles/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/mdfiles/index.md b/docs/mdfiles/index.md
index a32dcdd0..6a543a44 100644
--- a/docs/mdfiles/index.md
+++ b/docs/mdfiles/index.md
@@ -21,7 +21,7 @@ Conference Mode:
| Chrome* 77 | √ | √ | √ |
| Firefox* 69 | √ | √ | √ |
| Safari* 13 | | | √ |
-| Microsoft Edge* 44.17763.1.0 | √ | | | |
+| Microsoft Edge* 44.18362.387.0 | √ | | | |
*Table 1: Browser requirements for Conference Mode*
From 897a924fa8d57fa829b39a7c33d09db2cd1e4226 Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Mon, 21 Oct 2019 14:33:16 +0800
Subject: [PATCH 38/52] The ended event may not be fired on Safari after
calling (#300)
Publication.stop().
Fix #276.
---
src/sdk/base/publication.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/sdk/base/publication.js b/src/sdk/base/publication.js
index 7df94980..620652ec 100644
--- a/src/sdk/base/publication.js
+++ b/src/sdk/base/publication.js
@@ -107,6 +107,7 @@ export class PublicationSettings {
* @memberOf Owt.Base
* @classDesc Publication represents a sender for publishing a stream. It
* handles the actions on a LocalStream published to a conference.
+ *
* Events:
*
* | Event Name | Argument Type | Fired when |
@@ -116,6 +117,8 @@ export class PublicationSettings {
* | mute | MuteEvent | Publication is muted. Client stopped sending audio and/or video data to remote endpoint. |
* | unmute | MuteEvent | Publication is unmuted. Client continued sending audio and/or video data to remote endpoint. |
*
+ * `ended` event may not be fired on Safari after calling `Publication.stop()`.
+ *
* @hideconstructor
*/
export class Publication extends EventDispatcher {
From b42a41417b5be939c7fb66b6811e9897fd2ba0b6 Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Mon, 21 Oct 2019 21:13:05 +0800
Subject: [PATCH 39/52] Add document for simulcast (#298)
* Add document for simulcast
* Update some comments
* Change some descriptions
* Rewrite some descriptions
---
docs/jsdoc/config.json | 2 +-
docs/mdfiles/simulcast.md | 73 +++++++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+), 1 deletion(-)
create mode 100644 docs/mdfiles/simulcast.md
diff --git a/docs/jsdoc/config.json b/docs/jsdoc/config.json
index ae88a8f0..aea7630a 100644
--- a/docs/jsdoc/config.json
+++ b/docs/jsdoc/config.json
@@ -3,7 +3,7 @@
"recurseDepth": 10,
"source": {
"include": "src/sdk",
- "exclude": ["src/sdk/rest", "src/sdk/nuve", "src/sdk/ui"],
+ "exclude": ["src/sdk/rest", "src/sdk/ui"],
"excludePattern": "w*.legacy.*"
},
"sourceType": "module",
diff --git a/docs/mdfiles/simulcast.md b/docs/mdfiles/simulcast.md
new file mode 100644
index 00000000..3d8fb464
--- /dev/null
+++ b/docs/mdfiles/simulcast.md
@@ -0,0 +1,73 @@
+OWT Simulcast Description
+---------------------
+
+# {#simulcast}
+The conference server supports simulcast. This can be enabled through OWT Client SDK for JavaScript.
+
+1. Publish a simulcast stream
+~~~~~~{.js}
+// Example of simulcast publication.
+conference = new Owt.Conference.ConferenceClient();
+// ...
+conference.join(token).then(resp => {
+ // ...
+ Owt.Base.MediaStreamFactory.createMediaStream(new Owt.Base.StreamConstraints(
+ audioConstraints, videoConstraints)).then(stream => {
+ /*
+ * Use `RTCRtpEncodingParameters` as publish option
+ * (https://w3c.github.io/webrtc-pc/#dom-rtcrtpencodingparameters).
+ * The following option would create 3 streams with resolutions if browser supports:
+ * OriginResolution, OriginResolution/2.0 and OriginResolution/4.0.
+ * For current Firefox, the resolutions must be sorted in descending order.
+ * For current Safari, legacy simulcast is used and the parameters like `rid` won't take effect.
+ * Besides `scaleResolutionDownBy`, other `RTCRtpEncodingParameters` can be set
+ * if browser supports.
+ * The actual output will be determined by browsers, the outcome may not be exactly same
+ * as what is set in publishOption, e.g. For a vga video stream, there may be 2 RTP streams
+ * rather than 3.
+ */
+ const publishOption = {video:[
+ {rid: 'q', active: true, scaleResolutionDownBy: 1.0},
+ {rid: 'h', active: true, scaleResolutionDownBy: 2.0},
+ {rid: 'f', active: true, scaleResolutionDownBy: 4.0}
+ ]};
+ /*
+ * Codec priority list.
+ * Here 'vp8' will be used if enabled.
+ */
+ const codecs = ['vp8', 'h264'];
+ localStream = new Owt.Base.LocalStream(
+ stream, new Owt.Base.StreamSourceInfo(
+ 'mic', 'camera'));
+ conference.publish(localStream, publishOption, codecs).then(publication => {
+ // ...
+ });
+ });
+~~~~~~
+
+2. Subscribe a simulcast stream
+~~~~~~{.js}
+// Example of subscription.
+conference = new Owt.Conference.ConferenceClient();
+// ...
+conference.join(token).then(resp => {
+ // ...
+ /*
+ * Subscribe simulcast stream with specified `rid`
+ * which can be found in `RemoteStream.settings.video[i].rid`.
+ * If `rid` is set when subscribing, other parameters will be ignored.
+ */
+ const subscribeOption = {
+ audio: true,
+ video: {rid: 'q'}
+ };
+ conference.subscribe(remoteStream, subscribeOption).then((subscription) => {
+ // ...
+ });
+~~~~~~
+
+> **Note:**
+1. The simulcast stream published to conference won't be transcoded.
+2. The `rid` attribute may not be present once a 'streamadded' event triggered. Users should listen on stream's `updated`
+event for new `rid` added.
+3. Current browsers(Chrome/Firefox/Safari) can support VP8 simulcast well while H.264 simulcast has some limitations.
From d5d496ef2e36d9ac870cdc4cfa845964ef89302d Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Wed, 23 Oct 2019 17:47:55 +0800
Subject: [PATCH 40/52] Add a section for conference mode. (#303)
---
docs/mdfiles/index.md | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/docs/mdfiles/index.md b/docs/mdfiles/index.md
index 6a543a44..fb265898 100644
--- a/docs/mdfiles/index.md
+++ b/docs/mdfiles/index.md
@@ -68,11 +68,25 @@ Signaling channel is an implementation to transmit signaling data for creating a
In the customized signaling channel, you need to implement `connect`, `disconnect` and `send`, invoke `onMessage` when a new message arrives, and invoke `onServerDisconnected` when the connection is lost. Then include your customized `sc.*.js` into the HTML page.
-# 5 Events
+# 5 Conference mode
-The JavaScript objects fires events using `Ics.Base.EventDispatchers`. For more detailed events, please refer to the specific class description page.
+Conference mode is designed for applications with multiple participants. The JavaScript SDK includes a demo application for this.
-# 6 Privacy and security
+Please refer to [media server user guide](https://software.intel.com/sites/products/documentation/webrtc/conference) for detailed server side features.
+
+To initialize your HTML code, copy and paste the following code into the head section of your HTML document:
+~~~~~~{.js}
+
+
+
+~~~~~~
+After a room and a token are created, the token can then be sent to a client to join the conference using JavaScript APIs.
+
+# 6 Events
+
+The JavaScript objects fires events using `Owt.Base.EventDispatchers`. For more detailed events, please refer to the specific class description page.
+
+# 7 Privacy and security
SDK will send operation system's name and version, browser name, version and abilities, SDK name and version to conference server and P2P endpoints it tries to make connection. SDK does not store this information on disk.
**Note:** \* Other names and brands may be claimed as the property of others.
From 5c97cb0c3bb7f435eca64a5cfd12337af5b8d4c0 Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Wed, 23 Oct 2019 17:49:18 +0800
Subject: [PATCH 41/52] Update simulcast document (#302)
---
docs/mdfiles/simulcast.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/mdfiles/simulcast.md b/docs/mdfiles/simulcast.md
index 3d8fb464..ee1e43a1 100644
--- a/docs/mdfiles/simulcast.md
+++ b/docs/mdfiles/simulcast.md
@@ -18,7 +18,7 @@ conference.join(token).then(resp => {
* (https://w3c.github.io/webrtc-pc/#dom-rtcrtpencodingparameters).
* The following option would create 3 streams with resolutions if browser supports:
* OriginResolution, OriginResolution/2.0 and OriginResolution/4.0.
- * For current Firefox, the resolutions must be sorted in descending order.
+ * For current Firefox, the resolutions should be sorted in descending order(reversed sample's option).
* For current Safari, legacy simulcast is used and the parameters like `rid` won't take effect.
* Besides `scaleResolutionDownBy`, other `RTCRtpEncodingParameters` can be set
* if browser supports.
@@ -27,9 +27,9 @@ conference.join(token).then(resp => {
* rather than 3.
*/
const publishOption = {video:[
- {rid: 'q', active: true, scaleResolutionDownBy: 1.0},
+ {rid: 'q', active: true, scaleResolutionDownBy: 4.0},
{rid: 'h', active: true, scaleResolutionDownBy: 2.0},
- {rid: 'f', active: true, scaleResolutionDownBy: 4.0}
+ {rid: 'f', active: true, scaleResolutionDownBy: 1.0}
]};
/*
* Codec priority list.
@@ -70,4 +70,4 @@ conference.join(token).then(resp => {
1. The simulcast stream published to conference won't be transcoded.
2. The `rid` attribute may not be present once a 'streamadded' event triggered. Users should listen on stream's `updated`
event for new `rid` added.
-3. Current browsers(Chrome/Firefox/Safari) can support VP8 simulcast well while H.264 simulcast has some limitations.
+3. Current browsers support VP8 simulcast well while H.264 simulcast has some limitations.
From 5d84bcc78612b8748bde8edeea1cdccc94a42252 Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Wed, 23 Oct 2019 19:22:17 +0800
Subject: [PATCH 42/52] Add simulcast section in doc (#304)
---
docs/mdfiles/index.md | 76 +++++++++++++++++++++++++++++++++++----
docs/mdfiles/simulcast.md | 73 -------------------------------------
2 files changed, 70 insertions(+), 79 deletions(-)
delete mode 100644 docs/mdfiles/simulcast.md
diff --git a/docs/mdfiles/index.md b/docs/mdfiles/index.md
index fb265898..ef13672a 100644
--- a/docs/mdfiles/index.md
+++ b/docs/mdfiles/index.md
@@ -70,17 +70,81 @@ In the customized signaling channel, you need to implement `connect`, `disconnec
# 5 Conference mode
-Conference mode is designed for applications with multiple participants. The JavaScript SDK includes a demo application for this.
-
-Please refer to [media server user guide](https://software.intel.com/sites/products/documentation/webrtc/conference) for detailed server side features.
-
-To initialize your HTML code, copy and paste the following code into the head section of your HTML document:
+Conference mode is designed for applications with multiple participants through MCU conference server. To enable conference chat, copy and paste the following code into the head section of your HTML document:
~~~~~~{.js}
~~~~~~
-After a room and a token are created, the token can then be sent to a client to join the conference using JavaScript APIs.
+
+The JavaScript SDK includes a demo application for whole conferencing workflow with operations including join room, publish and subscribe streams, etc. Moreover, the conference server also supports simulcast. This can be enabled through JavaScript SDK.
+
+## 5.1 Publish a simulcast stream
+~~~~~~{.js}
+// Example of simulcast publication.
+conference = new Owt.Conference.ConferenceClient();
+// ...
+conference.join(token).then(resp => {
+ // ...
+ Owt.Base.MediaStreamFactory.createMediaStream(new Owt.Base.StreamConstraints(
+ audioConstraints, videoConstraints)).then(stream => {
+ /*
+ * Use `RTCRtpEncodingParameters` as publish option
+ * (https://w3c.github.io/webrtc-pc/#dom-rtcrtpencodingparameters).
+ * The following option would create 3 streams with resolutions if browser supports:
+ * OriginResolution, OriginResolution/2.0 and OriginResolution/4.0.
+ * For current Firefox, the resolutions should be sorted in descending order(reversed sample's option).
+ * For current Safari, legacy simulcast is used and the parameters like `rid` won't take effect.
+ * Besides `scaleResolutionDownBy`, other `RTCRtpEncodingParameters` can be set
+ * if browser supports.
+ * The actual output will be determined by browsers, the outcome may not be exactly same
+ * as what is set in publishOption, e.g. For a vga video stream, there may be 2 RTP streams
+ * rather than 3.
+ */
+ const publishOption = {video:[
+ {rid: 'q', active: true, scaleResolutionDownBy: 4.0},
+ {rid: 'h', active: true, scaleResolutionDownBy: 2.0},
+ {rid: 'f', active: true, scaleResolutionDownBy: 1.0}
+ ]};
+ /*
+ * Codec priority list.
+ * Here 'vp8' will be used if enabled.
+ */
+ const codecs = ['vp8', 'h264'];
+ localStream = new Owt.Base.LocalStream(
+ stream, new Owt.Base.StreamSourceInfo(
+ 'mic', 'camera'));
+ conference.publish(localStream, publishOption, codecs).then(publication => {
+ // ...
+ });
+ });
+~~~~~~
+
+## 5.2 Subscribe a simulcast stream
+~~~~~~{.js}
+// Example of subscription.
+conference = new Owt.Conference.ConferenceClient();
+// ...
+conference.join(token).then(resp => {
+ // ...
+ /*
+ * Subscribe simulcast stream with specified `rid`
+ * which can be found in `RemoteStream.settings.video[i].rid`.
+ * If `rid` is set when subscribing, other parameters will be ignored.
+ */
+ const subscribeOption = {
+ audio: true,
+ video: {rid: 'q'}
+ };
+ conference.subscribe(remoteStream, subscribeOption).then((subscription) => {
+ // ...
+ });
+~~~~~~
+
+**Note**:
+a. The simulcast stream published to conference won't be transcoded.
+b. The `rid` attribute may not be present once a 'streamadded' event triggered. Users should listen on stream's `updated` event for new `rid` added.
+c. Current browsers support VP8 simulcast well while H.264 simulcast has some limitations.
# 6 Events
diff --git a/docs/mdfiles/simulcast.md b/docs/mdfiles/simulcast.md
deleted file mode 100644
index ee1e43a1..00000000
--- a/docs/mdfiles/simulcast.md
+++ /dev/null
@@ -1,73 +0,0 @@
-OWT Simulcast Description
----------------------
-
-# {#simulcast}
-The conference server supports simulcast. This can be enabled through OWT Client SDK for JavaScript.
-
-1. Publish a simulcast stream
-~~~~~~{.js}
-// Example of simulcast publication.
-conference = new Owt.Conference.ConferenceClient();
-// ...
-conference.join(token).then(resp => {
- // ...
- Owt.Base.MediaStreamFactory.createMediaStream(new Owt.Base.StreamConstraints(
- audioConstraints, videoConstraints)).then(stream => {
- /*
- * Use `RTCRtpEncodingParameters` as publish option
- * (https://w3c.github.io/webrtc-pc/#dom-rtcrtpencodingparameters).
- * The following option would create 3 streams with resolutions if browser supports:
- * OriginResolution, OriginResolution/2.0 and OriginResolution/4.0.
- * For current Firefox, the resolutions should be sorted in descending order(reversed sample's option).
- * For current Safari, legacy simulcast is used and the parameters like `rid` won't take effect.
- * Besides `scaleResolutionDownBy`, other `RTCRtpEncodingParameters` can be set
- * if browser supports.
- * The actual output will be determined by browsers, the outcome may not be exactly same
- * as what is set in publishOption, e.g. For a vga video stream, there may be 2 RTP streams
- * rather than 3.
- */
- const publishOption = {video:[
- {rid: 'q', active: true, scaleResolutionDownBy: 4.0},
- {rid: 'h', active: true, scaleResolutionDownBy: 2.0},
- {rid: 'f', active: true, scaleResolutionDownBy: 1.0}
- ]};
- /*
- * Codec priority list.
- * Here 'vp8' will be used if enabled.
- */
- const codecs = ['vp8', 'h264'];
- localStream = new Owt.Base.LocalStream(
- stream, new Owt.Base.StreamSourceInfo(
- 'mic', 'camera'));
- conference.publish(localStream, publishOption, codecs).then(publication => {
- // ...
- });
- });
-~~~~~~
-
-2. Subscribe a simulcast stream
-~~~~~~{.js}
-// Example of subscription.
-conference = new Owt.Conference.ConferenceClient();
-// ...
-conference.join(token).then(resp => {
- // ...
- /*
- * Subscribe simulcast stream with specified `rid`
- * which can be found in `RemoteStream.settings.video[i].rid`.
- * If `rid` is set when subscribing, other parameters will be ignored.
- */
- const subscribeOption = {
- audio: true,
- video: {rid: 'q'}
- };
- conference.subscribe(remoteStream, subscribeOption).then((subscription) => {
- // ...
- });
-~~~~~~
-
-> **Note:**
-1. The simulcast stream published to conference won't be transcoded.
-2. The `rid` attribute may not be present once a 'streamadded' event triggered. Users should listen on stream's `updated`
-event for new `rid` added.
-3. Current browsers support VP8 simulcast well while H.264 simulcast has some limitations.
From 1d8582cd032c4882e53709b21a6fdd7d87a6bf4b Mon Sep 17 00:00:00 2001
From: ChenLi
Date: Thu, 24 Oct 2019 14:52:59 +0800
Subject: [PATCH 43/52] Update browser versions (#305)
---
docs/mdfiles/index.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/mdfiles/index.md b/docs/mdfiles/index.md
index ef13672a..bbd7c9fc 100644
--- a/docs/mdfiles/index.md
+++ b/docs/mdfiles/index.md
@@ -18,8 +18,8 @@ Conference Mode:
| | Windows* | Ubuntu* | macOS* |
| ------------------------------- | -------- | ------- |------- |
-| Chrome* 77 | √ | √ | √ |
-| Firefox* 69 | √ | √ | √ |
+| Chrome* 78 | √ | √ | √ |
+| Firefox* 70 | √ | √ | √ |
| Safari* 13 | | | √ |
| Microsoft Edge* 44.18362.387.0 | √ | | | |
@@ -30,8 +30,8 @@ P2P Mode:
| | Windows* | Ubuntu* | macOS* |
| ------------------------------- | -------- | ------- |------- |
-| Chrome* 77 | √ | √ | √ |
-| Firefox* 69 | √ | √ | √ |
+| Chrome* 78 | √ | √ | √ |
+| Firefox* 70 | √ | √ | √ |
| Safari* 13 | | | √ |
*Table 2: Browser requirements for P2P Mode*
From 27cfd29ec26736510c44c06966b789ac29c12b67 Mon Sep 17 00:00:00 2001
From: HuaChunbo
Date: Mon, 28 Oct 2019 13:58:30 +0800
Subject: [PATCH 44/52] Updated message log info for P2P sample
---
src/samples/p2p/js/sc.websocket.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/samples/p2p/js/sc.websocket.js b/src/samples/p2p/js/sc.websocket.js
index c425e8d1..10a6a46a 100644
--- a/src/samples/p2p/js/sc.websocket.js
+++ b/src/samples/p2p/js/sc.websocket.js
@@ -115,7 +115,7 @@ function SignalingChannel() {
});
wsServer.on('owt-message', function(data) {
- console.info('Received woogeen message.');
+ console.info('Received owt message.');
if (self.onMessage)
self.onMessage(data.from, data.data);
});
From ac6d417aef3210ee57c8cf44cb1aa82b3bcb8d15 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 2 Nov 2019 15:47:07 +0000
Subject: [PATCH 45/52] Bump eslint-utils from 1.3.1 to 1.4.3
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.3)
Signed-off-by: dependabot[bot]
---
package-lock.json | 137 +++++++++++++++++++++++++++++++---------------
1 file changed, 94 insertions(+), 43 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index d60fb174..110f49c8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1097,7 +1097,8 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
- "dev": true
+ "dev": true,
+ "optional": true
},
"archiver": {
"version": "1.3.0",
@@ -1146,6 +1147,7 @@
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"dev": true,
+ "optional": true,
"requires": {
"delegates": "^1.0.0",
"readable-stream": "^2.0.6"
@@ -1306,7 +1308,8 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"assign-symbols": {
"version": "1.0.0",
@@ -1682,7 +1685,7 @@
"dependencies": {
"async": {
"version": "1.5.2",
- "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz",
+ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"dev": true
}
@@ -1725,7 +1728,7 @@
"dependencies": {
"JSONStream": {
"version": "0.10.0",
- "resolved": "http://registry.npmjs.org/JSONStream/-/JSONStream-0.10.0.tgz",
+ "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.10.0.tgz",
"integrity": "sha1-dDSdDYlSK3HzDwoD/5vSDKbxKsA=",
"dev": true,
"requires": {
@@ -1932,7 +1935,7 @@
},
"chalk": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
@@ -2087,7 +2090,8 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"coffeescript": {
"version": "1.10.0",
@@ -2140,7 +2144,7 @@
"dependencies": {
"convert-source-map": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
"integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
"dev": true
}
@@ -2151,6 +2155,7 @@
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
"dev": true,
+ "optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
@@ -2228,7 +2233,8 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"constants-browserify": {
"version": "1.0.0",
@@ -2520,13 +2526,15 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"delegates": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"depd": {
"version": "1.1.2",
@@ -2632,7 +2640,7 @@
"dependencies": {
"domelementtype": {
"version": "1.1.3",
- "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
"integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=",
"dev": true
},
@@ -2751,7 +2759,7 @@
},
"entities": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
"integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=",
"dev": true
},
@@ -2967,10 +2975,21 @@
}
},
"eslint-utils": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz",
- "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==",
- "dev": true
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz",
+ "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz",
+ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==",
+ "dev": true
+ }
+ }
},
"eslint-visitor-keys": {
"version": "1.0.0",
@@ -3236,7 +3255,8 @@
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"eyes": {
"version": "0.1.8",
@@ -3247,7 +3267,7 @@
},
"fast-deep-equal": {
"version": "1.1.0",
- "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=",
"dev": true,
"optional": true
@@ -3487,7 +3507,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -3508,12 +3529,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -3528,17 +3551,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -3655,7 +3681,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -3667,6 +3694,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -3681,6 +3709,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -3688,12 +3717,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -3712,6 +3743,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -3792,7 +3824,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -3804,6 +3837,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -3889,7 +3923,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -3925,6 +3960,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -3944,6 +3980,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -3987,12 +4024,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
@@ -4001,6 +4040,7 @@
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
"dev": true,
+ "optional": true,
"requires": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
@@ -4025,6 +4065,7 @@
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"dev": true,
+ "optional": true,
"requires": {
"aproba": "^1.0.3",
"console-control-strings": "^1.0.0",
@@ -4621,7 +4662,8 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"has-value": {
"version": "1.0.0",
@@ -4754,7 +4796,7 @@
},
"htmlparser2": {
"version": "3.8.3",
- "resolved": "http://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
"integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=",
"dev": true,
"requires": {
@@ -4773,7 +4815,7 @@
},
"readable-stream": {
"version": "1.1.14",
- "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"dev": true,
"requires": {
@@ -5147,6 +5189,7 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -5303,7 +5346,8 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"js-levenshtein": {
"version": "1.1.4",
@@ -5340,7 +5384,8 @@
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"jsdoc": {
"version": "3.6.2",
@@ -6456,7 +6501,7 @@
"dependencies": {
"semver": {
"version": "5.3.0",
- "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=",
"dev": true,
"optional": true
@@ -6481,7 +6526,7 @@
"dependencies": {
"events": {
"version": "1.1.1",
- "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
"dev": true
},
@@ -6553,6 +6598,7 @@
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"dev": true,
+ "optional": true,
"requires": {
"are-we-there-yet": "~1.1.2",
"console-control-strings": "~1.1.0",
@@ -7177,7 +7223,7 @@
},
"progress": {
"version": "1.1.8",
- "resolved": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
"integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=",
"dev": true,
"optional": true
@@ -7318,7 +7364,7 @@
},
"readable-stream": {
"version": "2.3.6",
- "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -7622,7 +7668,7 @@
},
"domelementtype": {
"version": "1.3.0",
- "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
"integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=",
"dev": true
},
@@ -7734,7 +7780,8 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"set-value": {
"version": "2.0.1",
@@ -8205,6 +8252,7 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -8222,7 +8270,7 @@
},
"strip-ansi": {
"version": "3.0.1",
- "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
@@ -8554,6 +8602,7 @@
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.0.1"
}
@@ -8562,7 +8611,8 @@
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"type-check": {
"version": "0.3.2",
@@ -8933,6 +8983,7 @@
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"dev": true,
+ "optional": true,
"requires": {
"string-width": "^1.0.2 || 2"
}
@@ -8954,7 +9005,7 @@
"dependencies": {
"async": {
"version": "1.0.0",
- "resolved": "http://registry.npmjs.org/async/-/async-1.0.0.tgz",
+ "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz",
"integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=",
"dev": true,
"optional": true
From 9fe9f490540e01ffd2e409c4e9c3b44d78802ed9 Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Wed, 20 Nov 2019 16:04:03 +0800
Subject: [PATCH 46/52] Re-enable grunt debug. (#320)
This command was supported in old versions, but replaced by `grunt dev`
in 4.x. It still useful when a debug version of SDK is need.
---
scripts/Gruntfile.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/Gruntfile.js b/scripts/Gruntfile.js
index 66aa7201..48985e80 100644
--- a/scripts/Gruntfile.js
+++ b/scripts/Gruntfile.js
@@ -261,5 +261,6 @@ window.L = L;\n\
grunt.registerTask('prepare', ['browserify:sinon', 'browserify:chai_as_promised']);
grunt.registerTask('pack', ['browserify:dist', 'concat:rest', 'uglify:dist', 'copy:dist', 'string-replace', 'compress:dist', 'jsdoc:dist']);
grunt.registerTask('dev', ['browserify:dev', 'connect:server']);
+ grunt.registerTask('debug', ['browserify:dev']);
grunt.registerTask('default', ['pack']);
};
From f8403a42f4a98070a52cbf40fb715d64646dd68b Mon Sep 17 00:00:00 2001
From: jianjunz
Date: Thu, 28 Nov 2019 10:08:59 +0800
Subject: [PATCH 47/52] Remove adapter.js. (#318)
Conference sample still loads adapter.js when running on Edge.
---
src/samples/conference/public/index.html | 16 ++++++++--------
src/samples/p2p/peercall.html | 8 +-------
test/p2ptest/fetch_dependencies.py | 3 +--
test/p2ptest/karma_config/chrome.config.js | 1 -
test/p2ptest/karma_config/firefox.config.js | 1 -
test/p2ptest/karma_config/safari.config.js | 1 -
6 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/src/samples/conference/public/index.html b/src/samples/conference/public/index.html
index 14d8c43c..3ed2a3ed 100644
--- a/src/samples/conference/public/index.html
+++ b/src/samples/conference/public/index.html
@@ -38,19 +38,19 @@
-
-
@@ -109,7 +108,7 @@ ScreenView