From 0e9dc50d119eeedd4703ca3b590225bea13dfab0 Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 4 Feb 2022 15:54:05 +0800 Subject: [PATCH 1/4] Support TCR docker images --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 492aecc7a..67ad47f4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -189,9 +189,9 @@ jobs: * Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }}) * Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }}) ## Docker - * China: [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:latest](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) - * China: [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_MAJOR }}](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) - * China: [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) + * China: [docker pull ccr.ccs.tencentyun.com/ossrs/srs:latest](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) + * China: [docker pull ccr.ccs.tencentyun.com/ossrs/srs:${{ env.SRS_MAJOR }}](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) + * China: [docker pull ccr.ccs.tencentyun.com/ossrs/srs:${{ env.SRS_TAG }}](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) * Global: [docker pull ossrs/srs:latest](https://github.com/ossrs/srs/wiki/v4_EN_Home#docker) * Global: [docker pull ossrs/srs:${{ env.SRS_MAJOR }}](https://github.com/ossrs/srs/wiki/v4_EN_Home#docker) * Global: [docker pull ossrs/srs:${{ env.SRS_TAG }}](https://github.com/ossrs/srs/wiki/v4_EN_Home#docker) From e27b658ef98d9ee9c29bd0726b71517a3f38f82c Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 8 Feb 2022 11:54:04 +0800 Subject: [PATCH 2/4] Refine the error for WebRTC H5 publisher. v4.0.239 --- trunk/doc/CHANGELOG.md | 1 + trunk/research/players/js/srs.sdk.js | 10 +++++++++- trunk/research/players/rtc_publisher.html | 19 +++++++++++++++++++ trunk/src/core/srs_core_version4.hpp | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 23b115425..1c74e51a9 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2022-02-08, Refine the error for WebRTC H5 publisher. v4.0.239 * v4.0, 2022-02-04, Push docker to docker, acr and tcr. v4.0.238 * v4.0, 2022-02-03, Merge [#2888](https://github.com/ossrs/srs/pull/2888): Fix bug when the value of http header is empty. (#2888). v4.0.237 * v4.0, 2022-01-30, Refine docker console, preview by players at the same server. v4.0.236 diff --git a/trunk/research/players/js/srs.sdk.js b/trunk/research/players/js/srs.sdk.js index 5cda7947c..2edcaa4b8 100644 --- a/trunk/research/players/js/srs.sdk.js +++ b/trunk/research/players/js/srs.sdk.js @@ -7,6 +7,14 @@ 'use strict'; +function SrsError(name, message) { + this.name = name; + this.message = message; + this.stack = (new Error()).stack; +} +SrsError.prototype = Object.create(Error.prototype); +SrsError.prototype.constructor = SrsError; + // Depends on adapter-7.4.0.min.js from https://github.com/webrtc/adapter // Async-awat-prmise based SRS RTC Publisher. function SrsRtcPublisherAsync() { @@ -48,7 +56,7 @@ function SrsRtcPublisherAsync() { self.pc.addTransceiver("video", {direction: "sendonly"}); if (!navigator.mediaDevices && window.location.protocol === 'http:' && window.location.hostname !== 'localhost') { - throw new Error(`Please use HTTPS or localhost to publish, read https://github.com/ossrs/srs/issues/2762#issuecomment-983147576`); + throw new SrsError('HttpsRequiredError', `Please use HTTPS or localhost to publish, read https://github.com/ossrs/srs/issues/2762#issuecomment-983147576`); } var stream = await navigator.mediaDevices.getUserMedia(self.constraints); diff --git a/trunk/research/players/rtc_publisher.html b/trunk/research/players/rtc_publisher.html index 4c1fe76dd..e7b6984b7 100644 --- a/trunk/research/players/rtc_publisher.html +++ b/trunk/research/players/rtc_publisher.html @@ -99,6 +99,25 @@ $(function(){ $('#sessionid').html(session.sessionid); $('#simulator-drop').attr('href', session.simulator + '?drop=1&username=' + session.sessionid); }).catch(function (reason) { + // Throw by sdk. + if (reason instanceof SrsError) { + if (reason.name === 'HttpsRequiredError') { + alert(`WebRTC推流必须是HTTPS或者localhost:${reason.name} ${reason.message}`); + } else { + alert(`${reason.name} ${reason.message}`); + } + } + // See https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#exceptions + if (reason instanceof DOMException) { + if (reason.name === 'NotFoundError') { + alert(`找不到麦克风和摄像头设备:getUserMedia ${reason.name} ${reason.message}`); + } else if (reason.name === 'NotAllowedError') { + alert(`你禁止了网页访问摄像头和麦克风:getUserMedia ${reason.name} ${reason.message}`); + } else if (['AbortError', 'NotAllowedError', 'NotFoundError', 'NotReadableError', 'OverconstrainedError', 'SecurityError', 'TypeError'].includes(reason.name)) { + alert(`getUserMedia ${reason.name} ${reason.message}`); + } + } + sdk.close(); $('#rtc_media_player').hide(); console.error(reason); diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 64173e810..fc349fb92 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 238 +#define VERSION_REVISION 239 #endif From ff93bdd14f6a94a1efa97664cbd5e74bf1a69b05 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 9 Feb 2022 11:42:02 +0800 Subject: [PATCH 3/4] Mirror docker images in TCR Singapore. v4.0.240 --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++--- trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version4.hpp | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67ad47f4f..0030b358f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,14 +113,44 @@ jobs: docker tag ossrs/lighthouse:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/lighthouse:latest docker push --all-tags registry.cn-hangzhou.aliyuncs.com/ossrs/lighthouse - # Tencent TCR hub - - name: Login Tencent docker hub + # Tencent TCR Singapore hub + - name: Login Tencent Singapore docker hub + uses: docker/login-action@v1 + with: + registry: sgccr.ccs.tencentyun.com + username: "${{ secrets.TCR_USERNAME }}" + password: "${{ secrets.TCR_PASSWORD }}" + - name: Push to Tencent Singapore docker hub + run: | + docker tag ossrs/srs:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/srs:$SRS_TAG + docker tag ossrs/srs:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/srs:$SRS_VERSION + docker tag ossrs/srs:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/srs:v$SRS_MAJOR + docker tag ossrs/srs:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/srs:$SRS_MAJOR + docker tag ossrs/srs:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/srs:latest + docker push --all-tags sgccr.ccs.tencentyun.com/ossrs/srs + # + docker tag ossrs/droplet:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/droplet:$SRS_TAG + docker tag ossrs/droplet:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/droplet:$SRS_VERSION + docker tag ossrs/droplet:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/droplet:v$SRS_MAJOR + docker tag ossrs/droplet:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/droplet:$SRS_MAJOR + docker tag ossrs/droplet:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/droplet:latest + docker push --all-tags sgccr.ccs.tencentyun.com/ossrs/droplet + # + docker tag ossrs/lighthouse:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/lighthouse:$SRS_TAG + docker tag ossrs/lighthouse:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/lighthouse:$SRS_VERSION + docker tag ossrs/lighthouse:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/lighthouse:v$SRS_MAJOR + docker tag ossrs/lighthouse:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/lighthouse:$SRS_MAJOR + docker tag ossrs/lighthouse:$SRS_TAG sgccr.ccs.tencentyun.com/ossrs/lighthouse:latest + docker push --all-tags sgccr.ccs.tencentyun.com/ossrs/lighthouse + + # Tencent TCR Beijing hub + - name: Login Tencent Beijing docker hub uses: docker/login-action@v1 with: registry: ccr.ccs.tencentyun.com username: "${{ secrets.TCR_USERNAME }}" password: "${{ secrets.TCR_PASSWORD }}" - - name: Push to Tencent docker hub + - name: Push to Tencent Beijing docker hub run: | docker tag ossrs/srs:$SRS_TAG ccr.ccs.tencentyun.com/ossrs/srs:$SRS_TAG docker tag ossrs/srs:$SRS_TAG ccr.ccs.tencentyun.com/ossrs/srs:$SRS_VERSION diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 1c74e51a9..fa41087f2 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2022-02-09, Mirror docker images in TCR Singapore. v4.0.240 * v4.0, 2022-02-08, Refine the error for WebRTC H5 publisher. v4.0.239 * v4.0, 2022-02-04, Push docker to docker, acr and tcr. v4.0.238 * v4.0, 2022-02-03, Merge [#2888](https://github.com/ossrs/srs/pull/2888): Fix bug when the value of http header is empty. (#2888). v4.0.237 diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index fc349fb92..80f29b78e 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 239 +#define VERSION_REVISION 240 #endif From c9dcee778fc5ced8c76736dfc0504343523fee34 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 9 Feb 2022 11:53:06 +0800 Subject: [PATCH 4/4] Release v4.0-b7, 4.0 beta7, v4.0.240, 144437 lines. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 137bb5dd0..8200967d1 100755 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ A big THANK YOU goes to: ## Releases +* 2022-02-09, Release [v4.0-b7](https://github.com/ossrs/srs/releases/tag/v4.0-b7), v4.0-b7, 4.0 beta7, v4.0.240, 144437 lines. * 2022-02-04, Release [v4.0-b6](https://github.com/ossrs/srs/releases/tag/v4.0-b6), v4.0-b6, 4.0 beta6, v4.0.238, 144437 lines. * 2022-01-30, Release [v4.0-b5](https://github.com/ossrs/srs/releases/tag/v4.0-b5), v4.0-b5, 4.0 beta5, v4.0.236, 144416 lines. * 2022-01-17, Release [v4.0-b4](https://github.com/ossrs/srs/releases/tag/v4.0-b4), v4.0-b4, 4.0 beta4, v4.0.230, 144393 lines.