@saooti/octopus-sdk 30.0.79 → 30.0.80
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 +2 -1
- package/package.json +1 -1
- package/src/components/misc/Player.vue +15 -27
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -151,7 +151,7 @@ export default defineComponent({
|
|
|
151
151
|
'distributorId=' + this.$store.state.authentication.organisationId
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
return '?' + parameters.join('&');
|
|
154
|
+
return this.podcast.podcastId+'.mp3?' + parameters.join('&');
|
|
155
155
|
},
|
|
156
156
|
organisationId(): string|undefined {
|
|
157
157
|
return state.generalParameters.organisationId;
|
|
@@ -190,6 +190,7 @@ export default defineComponent({
|
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
async listenTime(newVal): Promise<void> {
|
|
193
|
+
console.log(this.lastSend, newVal);
|
|
193
194
|
if ((!this.podcast && !this.live)||(!this.getDownloadId())||(newVal - this.lastSend < 10)) {
|
|
194
195
|
return;
|
|
195
196
|
}
|
|
@@ -208,8 +209,7 @@ export default defineComponent({
|
|
|
208
209
|
this.audioUrlToPlay = this.audioUrl;
|
|
209
210
|
}
|
|
210
211
|
if(!this.podcast){return;}
|
|
211
|
-
const response = await octopusApi.fetchPodcastDownloadUrl("podcast/download/register/"+
|
|
212
|
-
this.setCookie("player_"+this.podcast.podcastId, response.downloadId.toString(), ';domain='+this.getDomain());
|
|
212
|
+
const response = await octopusApi.fetchPodcastDownloadUrl("podcast/download/register/"+ this.audioUrl);
|
|
213
213
|
this.setDownloadId(response.downloadId.toString());
|
|
214
214
|
this.audioUrlToPlay = response.location;
|
|
215
215
|
}
|
|
@@ -268,9 +268,9 @@ export default defineComponent({
|
|
|
268
268
|
this.downloadId = newValue;
|
|
269
269
|
},
|
|
270
270
|
onError(): void {
|
|
271
|
-
if (this.podcast && !this.listenError) {
|
|
271
|
+
if (this.podcast && ""!==this.audioUrlToPlay && !this.listenError) {
|
|
272
272
|
this.listenError = true;
|
|
273
|
-
} else if (this.podcast || this.media) {
|
|
273
|
+
} else if ((this.podcast && ""!==this.audioUrlToPlay ) || this.media) {
|
|
274
274
|
this.playerError = true;
|
|
275
275
|
}
|
|
276
276
|
},
|
|
@@ -278,7 +278,7 @@ export default defineComponent({
|
|
|
278
278
|
const mediaTarget = (event.currentTarget as HTMLMediaElement);
|
|
279
279
|
if (this.podcast || this.live) {
|
|
280
280
|
if (!this.getDownloadId()) {
|
|
281
|
-
|
|
281
|
+
return;
|
|
282
282
|
}
|
|
283
283
|
if (
|
|
284
284
|
this.live &&
|
|
@@ -339,29 +339,17 @@ export default defineComponent({
|
|
|
339
339
|
this.forceHide = false;
|
|
340
340
|
}
|
|
341
341
|
},
|
|
342
|
-
loadDownloadId(): void {
|
|
343
|
-
if (!this.podcast) return;
|
|
344
|
-
const matching_cookies = document.cookie
|
|
345
|
-
.split(';')
|
|
346
|
-
.map(item => {
|
|
347
|
-
const _return = item.trim().split('=');
|
|
348
|
-
return _return.map(item => item.trim());
|
|
349
|
-
})
|
|
350
|
-
.filter(item => {
|
|
351
|
-
if(!this.podcast){return '';}
|
|
352
|
-
return 'player_' + this.podcast.podcastId === item[0];
|
|
353
|
-
});
|
|
354
|
-
if (1 === matching_cookies.length) {
|
|
355
|
-
this.setDownloadId(matching_cookies[0][1]);
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
342
|
async endListeningProgress(): Promise<void> {
|
|
359
343
|
if (!this.getDownloadId()) return;
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
344
|
+
try {
|
|
345
|
+
await octopusApi.updatePlayerTime(
|
|
346
|
+
this.getDownloadId(),
|
|
347
|
+
Math.round(this.listenTime)
|
|
348
|
+
);
|
|
349
|
+
} catch{
|
|
350
|
+
//Do nothing
|
|
351
|
+
}
|
|
352
|
+
this.downloadId = null;
|
|
365
353
|
this.notListenTime = 0;
|
|
366
354
|
this.lastSend = 0;
|
|
367
355
|
this.listenTime = 0;
|