1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Replace deprecated String.prototype.substr() (#2948)

String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() or substring() which work similarily but aren't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
CommanderRoot 2022-03-07 01:02:27 +01:00 committed by GitHub
parent 84951cbc74
commit 8a75e8a165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 72 additions and 72 deletions

View file

@ -81,7 +81,7 @@ function build_default_flv_url() {
}
uri += "/" + app + "/" + stream + "?" + queries.join('&');
while (uri.indexOf("?") === uri.length - 1) {
uri = uri.substr(0, uri.length - 1);
uri = uri.slice(0, uri.length - 1);
}
return uri;
@ -110,7 +110,7 @@ function build_default_rtc_url(query) {
var uri = "webrtc://" + server + api + "/" + app + "/" + stream + "?" + queries.join('&');
while (uri.lastIndexOf("?") === uri.length - 1) {
uri = uri.substr(0, uri.length - 1);
uri = uri.slice(0, uri.length - 1);
}
return uri;