@saooti/octopus-sdk 41.11.0 → 41.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -24,12 +24,17 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
|
|
|
24
24
|
const apiStore = useApiStore();
|
|
25
25
|
const authStore = useAuthStore();
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function needToAddToken(url: string): boolean {
|
|
28
|
+
if (authStore.authParam.accessToken && ("SECURED" === playerStore.playerLive?.organisation?.privacy || playerStore.playerRadio?.secured)) {
|
|
29
|
+
const baseDomain = apiStore.frontendUrl.replace(/^https?:\/\//, '');
|
|
30
|
+
// Add token only if request is on same domain
|
|
31
|
+
return url.includes(baseDomain);
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
30
35
|
|
|
31
36
|
function onPlay(): void {
|
|
32
|
-
playerStore.playerChangeStatus(PlayerStatus.PAUSED ===playerStore.playerStatus);
|
|
37
|
+
playerStore.playerChangeStatus(PlayerStatus.PAUSED === playerStore.playerStatus);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
function playRadio() {
|
|
@@ -77,7 +82,7 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
|
|
|
77
82
|
!isAndroid
|
|
78
83
|
) {
|
|
79
84
|
let url = playerStore.playerHlsUrl;
|
|
80
|
-
if(needToAddToken
|
|
85
|
+
if(needToAddToken(url)) {
|
|
81
86
|
if (url.includes('?')) {
|
|
82
87
|
url += "&access_token="+authStore.authParam.accessToken;
|
|
83
88
|
} else {
|
|
@@ -123,8 +128,8 @@ export const usePlayerLive = (hlsReady: Ref<boolean>)=>{
|
|
|
123
128
|
backBufferLength:10,
|
|
124
129
|
maxBufferLength:60,
|
|
125
130
|
|
|
126
|
-
xhrSetup: (xhr: XMLHttpRequest) => {
|
|
127
|
-
if (needToAddToken
|
|
131
|
+
xhrSetup: (xhr: XMLHttpRequest, url: string) => {
|
|
132
|
+
if (needToAddToken(url)) {
|
|
128
133
|
xhr.setRequestHeader("Authorization", "Bearer " +authStore.authParam.accessToken);
|
|
129
134
|
}
|
|
130
135
|
}
|
|
@@ -122,17 +122,15 @@ export const useTranslation = () => {
|
|
|
122
122
|
// languages defined on browser, then default, and finally native language
|
|
123
123
|
const languages: string[] = [];
|
|
124
124
|
[userLanguage, ...navigator.languages, DEFAULT_LANGUAGE, translationData.nativeLanguage].forEach(l => {
|
|
125
|
+
// For each language, if it is a variant (for example fr-CH), use
|
|
126
|
+
// only the base language
|
|
127
|
+
if (l.includes('-')) {
|
|
128
|
+
l = l.split('-')[0];
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
if (!languages.includes(l)) {
|
|
126
132
|
languages.push(l);
|
|
127
133
|
}
|
|
128
|
-
// For each language, if it is a variant (for example fr-CH), also
|
|
129
|
-
// add the base language
|
|
130
|
-
if (l.includes('-')) {
|
|
131
|
-
const base = l.split('-')[0];
|
|
132
|
-
if (!languages.includes(base)) {
|
|
133
|
-
languages.push(base);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
134
|
});
|
|
137
135
|
|
|
138
136
|
const podcast = await podcastApi.get(translationData.podcastId);
|
package/tsconfig.json
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
// "strict": true,
|
|
6
6
|
"jsx": "preserve",
|
|
7
7
|
"importHelpers": true,
|
|
8
|
-
"moduleResolution": "
|
|
8
|
+
"moduleResolution": "node",
|
|
9
9
|
"experimentalDecorators": true,
|
|
10
10
|
"skipLibCheck": true,
|
|
11
11
|
"esModuleInterop": true,
|
|
12
12
|
"allowSyntheticDefaultImports": true,
|
|
13
13
|
"sourceMap": true,
|
|
14
|
+
"baseUrl": ".",
|
|
14
15
|
"types": [
|
|
16
|
+
"webpack-env",
|
|
15
17
|
"sockjs-client"
|
|
16
18
|
],
|
|
17
19
|
"paths": {
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
"./src/*"
|
|
20
22
|
],
|
|
21
23
|
"@tests/*": [
|
|
22
|
-
"
|
|
24
|
+
"tests/*"
|
|
23
25
|
]
|
|
24
26
|
},
|
|
25
27
|
"lib": [
|
|
@@ -32,7 +34,9 @@
|
|
|
32
34
|
"include": [
|
|
33
35
|
"src/**/*.ts",
|
|
34
36
|
"src/**/*.tsx",
|
|
35
|
-
"src/**/*.vue"
|
|
37
|
+
"src/**/*.vue",
|
|
38
|
+
"tests/**/*.ts",
|
|
39
|
+
"tests/**/*.tsx"
|
|
36
40
|
],
|
|
37
41
|
"exclude": [
|
|
38
42
|
"node_modules"
|
package/vitest.config.js
CHANGED
package/tsconfig.test.json
DELETED