@saooti/octopus-sdk 31.0.58 → 31.0.59
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
|
@@ -44,7 +44,6 @@ export const playerLive = defineComponent({
|
|
|
44
44
|
if (this.audioElement.canPlayType('application/vnd.apple.mpegurl')) {
|
|
45
45
|
this.audioElement.src = hlsStreamUrl;
|
|
46
46
|
await this.initLiveDownloadId();
|
|
47
|
-
console.log("ios avant play");
|
|
48
47
|
await (this.audioElement as HTMLAudioElement).play();
|
|
49
48
|
this.onPlay();
|
|
50
49
|
}else{
|
|
@@ -173,7 +173,6 @@ export const playerLogic = defineComponent({
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
onTimeUpdate(event: Event): void {
|
|
176
|
-
console.log("timeupdate");
|
|
177
176
|
const mediaTarget = (event.currentTarget as HTMLMediaElement);
|
|
178
177
|
if (this.podcast || this.live) {
|
|
179
178
|
if (!this.downloadId) {
|
|
@@ -191,8 +190,15 @@ export const playerLogic = defineComponent({
|
|
|
191
190
|
mediaTarget.currentTime - this.notListenTime;
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
let streamDuration = mediaTarget.duration;
|
|
194
|
+
if(Infinity===streamDuration){
|
|
195
|
+
const seekable = mediaTarget.seekable;
|
|
196
|
+
if(seekable){
|
|
197
|
+
streamDuration = seekable.end(seekable.length - 1);
|
|
198
|
+
}else{
|
|
199
|
+
streamDuration = mediaTarget.currentTime;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
196
202
|
if (!streamDuration) return;
|
|
197
203
|
if (!mediaTarget.currentTime) return;
|
|
198
204
|
if (!this.live) {
|