@saooti/octopus-sdk 30.0.78 → 30.0.81
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/README.md +4 -1
- package/package.json +2 -2
- package/src/assets/general.scss +1 -1
- package/src/components/misc/Player.vue +32 -34
- package/src/store/paramStore.ts +7 -7
package/README.md
CHANGED
|
@@ -574,4 +574,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
574
574
|
* 30.0.75 Parlement
|
|
575
575
|
* 30.0.76 Space
|
|
576
576
|
* 30.0.77 V-Calendar bloque version
|
|
577
|
-
* 30.0.78 a -> word-break
|
|
577
|
+
* 30.0.78 a -> word-break
|
|
578
|
+
* 30.0.79 DownloadId player
|
|
579
|
+
* 30.0.80 DownloadId player
|
|
580
|
+
* 30.0.81 DownloadId player
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saooti/octopus-sdk",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.81",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"main": "./dist/octopus.common.js",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@popperjs/core": "^2.11.0",
|
|
18
|
-
"@saooti/octopus-api": "^0.30.
|
|
18
|
+
"@saooti/octopus-api": "^0.30.5",
|
|
19
19
|
"@vue/cli": "^5.0.0-rc.1",
|
|
20
20
|
"@vue/compat": "^3.2.26",
|
|
21
21
|
"axios": "^0.24.0",
|
package/src/assets/general.scss
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
>
|
|
30
30
|
<audio
|
|
31
31
|
id="audio-player"
|
|
32
|
-
:src="!live?
|
|
32
|
+
:src="!live? audioUrlToPlay: undefined"
|
|
33
33
|
autoplay
|
|
34
34
|
@timeupdate="onTimeUpdate"
|
|
35
35
|
@ended="onFinished"
|
|
@@ -108,6 +108,7 @@ export default defineComponent({
|
|
|
108
108
|
hlsReady: false as boolean,
|
|
109
109
|
comments: [] as Array<CommentPodcast>,
|
|
110
110
|
showTimeline: false as boolean,
|
|
111
|
+
audioUrlToPlay: "" as string
|
|
111
112
|
};
|
|
112
113
|
},
|
|
113
114
|
computed: {
|
|
@@ -141,7 +142,6 @@ export default defineComponent({
|
|
|
141
142
|
if (this.listenError) return this.podcast.audioStorageUrl;
|
|
142
143
|
const parameters = [];
|
|
143
144
|
parameters.push('origin=octopus');
|
|
144
|
-
parameters.push('cookieName=player_' + this.podcast.podcastId);
|
|
145
145
|
parameters.push('listenerId='+this.getListenerId());
|
|
146
146
|
if (
|
|
147
147
|
this.$store.state.authentication &&
|
|
@@ -151,7 +151,7 @@ export default defineComponent({
|
|
|
151
151
|
'distributorId=' + this.$store.state.authentication.organisationId
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
return this.podcast.
|
|
154
|
+
return this.podcast.podcastId+'.mp3?' + parameters.join('&');
|
|
155
155
|
},
|
|
156
156
|
organisationId(): string|undefined {
|
|
157
157
|
return state.generalParameters.organisationId;
|
|
@@ -202,8 +202,15 @@ export default defineComponent({
|
|
|
202
202
|
commentsLoaded(): void {
|
|
203
203
|
this.initComments(true);
|
|
204
204
|
},
|
|
205
|
-
audioUrl(): void{
|
|
205
|
+
async audioUrl(): Promise<void>{
|
|
206
206
|
this.playerError = false;
|
|
207
|
+
if(this.media || !this.podcast || !this.podcast.availability.visibility ||this.listenError){
|
|
208
|
+
this.audioUrlToPlay = this.audioUrl;
|
|
209
|
+
}
|
|
210
|
+
if(!this.podcast){return;}
|
|
211
|
+
const response = await octopusApi.fetchPodcastDownloadUrl("podcast/download/register/"+ this.audioUrl);
|
|
212
|
+
this.setDownloadId(response.downloadId.toString());
|
|
213
|
+
this.audioUrlToPlay = response.location;
|
|
207
214
|
}
|
|
208
215
|
},
|
|
209
216
|
|
|
@@ -216,16 +223,19 @@ export default defineComponent({
|
|
|
216
223
|
stopPlayer(): void {
|
|
217
224
|
this.$store.commit('playerPlayPodcast');
|
|
218
225
|
},
|
|
226
|
+
getDomain(): string{
|
|
227
|
+
let domain = "";
|
|
228
|
+
const domainArray: RegExpExecArray | null = /\.(.+)/.exec(window.location.host);
|
|
229
|
+
if(domainArray && null !== domainArray){
|
|
230
|
+
domain = domainArray[1];
|
|
231
|
+
}
|
|
232
|
+
return domain;
|
|
233
|
+
},
|
|
219
234
|
getListenerId(): string{
|
|
220
235
|
let listenerId = this.getCookie("octopus_listenerId");
|
|
221
236
|
if(!listenerId){
|
|
222
237
|
listenerId = new Date().valueOf().toString() + Math.random();
|
|
223
|
-
|
|
224
|
-
const domainArray: RegExpExecArray | null = /\.(.+)/.exec(window.location.host);
|
|
225
|
-
if(domainArray && null !== domainArray){
|
|
226
|
-
domain = domainArray[1];
|
|
227
|
-
}
|
|
228
|
-
this.setCookie("octopus_listenerId", listenerId, ';domain='+domain);
|
|
238
|
+
this.setCookie("octopus_listenerId", listenerId, ';domain='+this.getDomain());
|
|
229
239
|
}
|
|
230
240
|
return listenerId;
|
|
231
241
|
},
|
|
@@ -257,9 +267,9 @@ export default defineComponent({
|
|
|
257
267
|
this.downloadId = newValue;
|
|
258
268
|
},
|
|
259
269
|
onError(): void {
|
|
260
|
-
if (this.podcast && !this.listenError) {
|
|
270
|
+
if (this.podcast && ""!==this.audioUrlToPlay && !this.listenError) {
|
|
261
271
|
this.listenError = true;
|
|
262
|
-
} else if (this.podcast || this.media) {
|
|
272
|
+
} else if ((this.podcast && ""!==this.audioUrlToPlay ) || this.media) {
|
|
263
273
|
this.playerError = true;
|
|
264
274
|
}
|
|
265
275
|
},
|
|
@@ -267,7 +277,7 @@ export default defineComponent({
|
|
|
267
277
|
const mediaTarget = (event.currentTarget as HTMLMediaElement);
|
|
268
278
|
if (this.podcast || this.live) {
|
|
269
279
|
if (!this.getDownloadId()) {
|
|
270
|
-
|
|
280
|
+
return;
|
|
271
281
|
}
|
|
272
282
|
if (
|
|
273
283
|
this.live &&
|
|
@@ -328,29 +338,17 @@ export default defineComponent({
|
|
|
328
338
|
this.forceHide = false;
|
|
329
339
|
}
|
|
330
340
|
},
|
|
331
|
-
loadDownloadId(): void {
|
|
332
|
-
if (!this.podcast) return;
|
|
333
|
-
const matching_cookies = document.cookie
|
|
334
|
-
.split(';')
|
|
335
|
-
.map(item => {
|
|
336
|
-
const _return = item.trim().split('=');
|
|
337
|
-
return _return.map(item => item.trim());
|
|
338
|
-
})
|
|
339
|
-
.filter(item => {
|
|
340
|
-
if(!this.podcast){return '';}
|
|
341
|
-
return 'player_' + this.podcast.podcastId === item[0];
|
|
342
|
-
});
|
|
343
|
-
if (1 === matching_cookies.length) {
|
|
344
|
-
this.setDownloadId(matching_cookies[0][1]);
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
341
|
async endListeningProgress(): Promise<void> {
|
|
348
342
|
if (!this.getDownloadId()) return;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
343
|
+
try {
|
|
344
|
+
await octopusApi.updatePlayerTime(
|
|
345
|
+
this.getDownloadId(),
|
|
346
|
+
Math.round(this.listenTime)
|
|
347
|
+
);
|
|
348
|
+
} catch{
|
|
349
|
+
//Do nothing
|
|
350
|
+
}
|
|
351
|
+
this.downloadId = null;
|
|
354
352
|
this.notListenTime = 0;
|
|
355
353
|
this.lastSend = 0;
|
|
356
354
|
this.listenTime = 0;
|
package/src/store/paramStore.ts
CHANGED
|
@@ -12,7 +12,7 @@ const state:paramStore = {
|
|
|
12
12
|
isPlaylist: false,
|
|
13
13
|
isProduction: true,
|
|
14
14
|
isContribution: true,
|
|
15
|
-
ApiUri: 'https://api.
|
|
15
|
+
ApiUri: 'https://api.preprod.saooti.org/',
|
|
16
16
|
podcastmaker: false,
|
|
17
17
|
buttonPlus: true,
|
|
18
18
|
allCategories: [],
|
|
@@ -26,10 +26,10 @@ const state:paramStore = {
|
|
|
26
26
|
SharePlayer: true,
|
|
27
27
|
ShareButtons: true,
|
|
28
28
|
ShareDistribution: true,
|
|
29
|
-
MiniplayerUri: 'https://playerbeta.
|
|
29
|
+
MiniplayerUri: 'https://playerbeta.preprod.saooti.org/',
|
|
30
30
|
ouestFranceStyle: false,
|
|
31
31
|
downloadButton: false,
|
|
32
|
-
hlsUri: 'https://hls.
|
|
32
|
+
hlsUri: 'https://hls.preprod.saooti.org/',
|
|
33
33
|
mainRubrique: 0,
|
|
34
34
|
resourceUrl: undefined
|
|
35
35
|
},
|
|
@@ -85,10 +85,10 @@ const state:paramStore = {
|
|
|
85
85
|
userName: '',
|
|
86
86
|
},
|
|
87
87
|
octopusApi: {
|
|
88
|
-
url: 'http://api.
|
|
89
|
-
commentsUrl: 'http://comments.
|
|
90
|
-
studioUrl: 'http://studio.
|
|
91
|
-
playerUrl: 'https://playerbeta.
|
|
88
|
+
url: 'http://api.preprod.saooti.org/',
|
|
89
|
+
commentsUrl: 'http://comments.preprod.saooti.org/',
|
|
90
|
+
studioUrl: 'http://studio.preprod.saooti.org/',
|
|
91
|
+
playerUrl: 'https://playerbeta.preprod.saooti.org/',
|
|
92
92
|
organisationId: undefined,
|
|
93
93
|
rubriqueIdFilter: undefined,
|
|
94
94
|
},
|