From 8a75e8a1652f43ba49414137ba9363216bd582a2 Mon Sep 17 00:00:00 2001
From: CommanderRoot
Date: Mon, 7 Mar 2022 01:02:27 +0100
Subject: [PATCH] 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
---
trunk/3rdparty/signaling/www/demos/index.html | 2 +-
.../signaling/www/demos/js/srs.sdk.js | 32 +++++++++----------
.../signaling/www/demos/js/srs.sig.js | 8 ++---
trunk/research/console/js/srs.console.js | 4 +--
trunk/research/console/js/winlin.utility.js | 22 ++++++-------
trunk/research/players/js/srs.page.js | 4 +--
trunk/research/players/js/srs.sdk.js | 32 +++++++++----------
trunk/research/players/js/winlin.utility.js | 22 ++++++-------
trunk/research/players/srs_gb28181.html | 14 ++++----
trunk/research/players/srs_publisher.html | 2 +-
.../research/players/srs_publisher_flash.html | 2 +-
11 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/trunk/3rdparty/signaling/www/demos/index.html b/trunk/3rdparty/signaling/www/demos/index.html
index 20f2f9a00..b8dc32d65 100644
--- a/trunk/3rdparty/signaling/www/demos/index.html
+++ b/trunk/3rdparty/signaling/www/demos/index.html
@@ -15,7 +15,7 @@
点击进入SRS多人通话演示
diff --git a/trunk/research/players/srs_publisher_flash.html b/trunk/research/players/srs_publisher_flash.html
index f0f6dec37..808a27664 100644
--- a/trunk/research/players/srs_publisher_flash.html
+++ b/trunk/research/players/srs_publisher_flash.html
@@ -335,7 +335,7 @@
$("#btn_publish").click(on_user_publish);
// for publish, we use randome stream name.
- $("#txt_url").val($("#txt_url").val() + "." + Number(parseInt(new Date().getTime()*Math.random()*100)).toString(16).substr(0, 7));
+ $("#txt_url").val($("#txt_url").val() + "." + Number(parseInt(new Date().getTime()*Math.random()*100)).toString(16).slice(0, 7));
// start the publisher.
srs_publisher = new SrsPublisher("local_publisher", 430, 185);