@saooti/octopus-sdk 35.2.18 → 35.2.20
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/package.json
CHANGED
|
@@ -46,7 +46,9 @@ export const playerLive = defineComponent({
|
|
|
46
46
|
}, 1000);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
50
|
+
const isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
|
|
51
|
+
if (this.audioElement.canPlayType('application/vnd.apple.mpegurl') && !isAndroid) {
|
|
50
52
|
this.audioElement.src = hlsStreamUrl;
|
|
51
53
|
await this.initLiveDownloadId();
|
|
52
54
|
await this.audioElement.play();
|
|
@@ -61,10 +63,9 @@ export const playerLive = defineComponent({
|
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
async initLiveDownloadId(){
|
|
64
|
-
if(!this.playerLive){ return;}
|
|
65
|
-
let downloadId = null;
|
|
66
|
+
if(!this.playerLive || this.downloadId){ return;}
|
|
66
67
|
try {
|
|
67
|
-
downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.playerLive.podcastId, undefined);
|
|
68
|
+
let downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.playerLive.podcastId, undefined);
|
|
68
69
|
await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' +this.playerLive.podcastId +".m3u8",{
|
|
69
70
|
'downloadId': null!==downloadId ? downloadId : undefined,
|
|
70
71
|
'origin':'octopus',
|
|
@@ -72,6 +73,7 @@ export const playerLive = defineComponent({
|
|
|
72
73
|
});
|
|
73
74
|
this.setDownloadId(downloadId);
|
|
74
75
|
} catch (error) {
|
|
76
|
+
this.downloadId = null;
|
|
75
77
|
console.log('ERROR downloadId');
|
|
76
78
|
}
|
|
77
79
|
this.hlsReady = true;
|