Support api_port to specify the WebRTC API port. v4.0.224

pull/2872/head
winlin 3 years ago
parent e6ab5db113
commit db3ceb445b

@ -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

@ -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}`);
}

@ -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;
}
}
}

@ -9,6 +9,6 @@
#define VERSION_MAJOR 4
#define VERSION_MINOR 0
#define VERSION_REVISION 223
#define VERSION_REVISION 224
#endif

Loading…
Cancel
Save