diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 381f1d40b..a2436754f 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-01-14, Support api_port to specify the WebRTC API port. v4.0.224 * v4.0, 2022-01-13, Merge [#2873](https://github.com/ossrs/srs/pull/2873): LiveSource: Refine fetch for external exposed interface. (#2873). v4.0.223 * v4.0, 2022-01-13, Add conf/lighthouse.conf for LightHouse. v4.0.222 * v4.0, 2022-01-12, Refine the running homepage. v4.0.221 diff --git a/trunk/research/api-server/static-dir/index.html b/trunk/research/api-server/static-dir/index.html index d54b70289..684848da3 100755 --- a/trunk/research/api-server/static-dir/index.html +++ b/trunk/research/api-server/static-dir/index.html @@ -63,8 +63,8 @@ if (true) { const prefix = `players/?schema=${window.location.protocol.replace(':', '')}`; const httpPort = window.location.port || (window.location.protocol === 'http:' ? 80 : 443); - // If not 8080, user should proxy to the default port. - const query = parseInt(window.location.port) === 8080 ? '' : `&port=${httpPort}`; + // If not 8080, user should proxy both stream and API to the default port. + const query = parseInt(window.location.port) === 8080 ? '' : `&port=${httpPort}&api_port=${httpPort}`; document.getElementById("enPlayer").setAttribute('href', `${prefix}${query}`); document.getElementById("cnPlayer").setAttribute('href', `${prefix}${query}`); } diff --git a/trunk/research/players/js/srs.sdk.js b/trunk/research/players/js/srs.sdk.js index ed5276b50..af4f48837 100644 --- a/trunk/research/players/js/srs.sdk.js +++ b/trunk/research/players/js/srs.sdk.js @@ -267,6 +267,7 @@ function SrsRtcPlayerAsync() { // webrtc://r.ossrs.net/live/livestream // or specifies the API port: // webrtc://r.ossrs.net:11985/live/livestream + // webrtc://r.ossrs.net/live/livestream?api_port=11985 // or autostart the play: // webrtc://r.ossrs.net/live/livestream?autostart=true // or change the app from live to myapp: @@ -438,8 +439,9 @@ function SrsRtcPlayerAsync() { } else if (window.location.href.indexOf('https://') === 0) { ret.port = 443; } else { + // Allow use api_port to specify the WebRTC API port. // For WebRTC, SRS use 1985 as default API port. - ret.port = 1985; + ret.port = ret.user_query.api_port || 1985; } } } diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index c67b5f8ee..c9415a650 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 223 +#define VERSION_REVISION 224 #endif