From 982dfea74a8fe4782c506efe970cffb50e2a4a85 Mon Sep 17 00:00:00 2001 From: lastpeony Date: Fri, 29 Mar 2024 12:42:53 +0300 Subject: [PATCH 1/4] dont add security parameters if they already exist. because if its adaptive we modify m3u8 file on server, passing security params. --- src/web_player.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/web_player.js b/src/web_player.js index 40ea147..502dd34 100644 --- a/src/web_player.js +++ b/src/web_player.js @@ -636,19 +636,26 @@ export class WebPlayer { //hls specific calls if (extension == "m3u8") { videojs.Vhs.xhr.beforeRequest = (options) => { + const queryParams = []; - let securityParams = this.getSecurityQueryParams(); - if (!options.uri.includes(securityParams)) - { - if (!options.uri.endsWith("?")) - { - options.uri = options.uri + "?"; - } - options.uri += securityParams; + if (!options.uri.includes("subscriberId") && this.subscriberId != null) { + queryParams.push(`subscriberId=${this.subscriberId}`); + } + + if (!options.uri.includes("subscriberCode") && this.subscriberCode != null) { + queryParams.push(`subscriberCode=${this.subscriberCode}`); } + if (!options.uri.includes("token") && this.token != null) { + queryParams.push(`token=${this.token}`); + } + + if (queryParams.length > 0) { + const queryString = queryParams.join("&"); + options.uri += options.uri.includes("?") ? `&${queryString}` : `?${queryString}`; + } Logger.debug("hls request: " + options.uri); - return options; + }; From ab85e1f73f070275497444c6ccd21bf5032f4092 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Fri, 29 Mar 2024 14:54:31 +0300 Subject: [PATCH 2/4] Update package-lock.json --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 09d0ffc..02c9e3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@antmedia/web_player", - "version": "2.8.0-SNAPSHOT", + "version": "2.8.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@antmedia/web_player", - "version": "2.8.0-SNAPSHOT", + "version": "2.8.2", "license": "ISC", "dependencies": { "@antmedia/videojs-webrtc-plugin": "^1.2.1", From 7a1a73c9c775a747bb0ff8f9f75a5e145b90d630 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Fri, 29 Mar 2024 14:54:38 +0300 Subject: [PATCH 3/4] 2.8.3-ALPHA-29-03-2024 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 02c9e3a..18c3438 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@antmedia/web_player", - "version": "2.8.2", + "version": "2.8.3-ALPHA-29-03-2024", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@antmedia/web_player", - "version": "2.8.2", + "version": "2.8.3-ALPHA-29-03-2024", "license": "ISC", "dependencies": { "@antmedia/videojs-webrtc-plugin": "^1.2.1", diff --git a/package.json b/package.json index 8917e7e..74b55ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antmedia/web_player", - "version": "2.8.2", + "version": "2.8.3-ALPHA-29-03-2024", "description": "Ant Media Server Player that can play WebRTC, HLS, DASH", "main": "dist/index.js", "module": "dist/es/index.js", From 7715ff56c054df0f42c32add6f5a521840a58f80 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Fri, 29 Mar 2024 17:13:29 +0300 Subject: [PATCH 4/4] Revert "2.8.3-ALPHA-29-03-2024" This reverts commit 7a1a73c9c775a747bb0ff8f9f75a5e145b90d630. --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18c3438..02c9e3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@antmedia/web_player", - "version": "2.8.3-ALPHA-29-03-2024", + "version": "2.8.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@antmedia/web_player", - "version": "2.8.3-ALPHA-29-03-2024", + "version": "2.8.2", "license": "ISC", "dependencies": { "@antmedia/videojs-webrtc-plugin": "^1.2.1", diff --git a/package.json b/package.json index 74b55ee..8917e7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antmedia/web_player", - "version": "2.8.3-ALPHA-29-03-2024", + "version": "2.8.2", "description": "Ant Media Server Player that can play WebRTC, HLS, DASH", "main": "dist/index.js", "module": "dist/es/index.js",