@saooti/octopus-sdk 38.0.19 → 38.0.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
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
>
|
|
7
7
|
<template #body>
|
|
8
8
|
<div class="d-flex flex-column">
|
|
9
|
-
<
|
|
9
|
+
<button
|
|
10
10
|
v-for="(chapter, index) in playerChapteringPercent"
|
|
11
11
|
:key="chapter"
|
|
12
|
-
class="c-hand text-truncate mb-1"
|
|
12
|
+
class="btn d-flex flex-nowrap align-items-center p-2 mt-1 c-hand text-truncate mb-1 border"
|
|
13
13
|
@click="goToChapter(index)"
|
|
14
14
|
>
|
|
15
|
-
{{
|
|
16
|
-
|
|
15
|
+
<div class="me-auto">{{ index + 1 + " - " + chapter.title }}</div>
|
|
16
|
+
<div>{{ chapter.startDisplay }}</div>
|
|
17
|
+
</button>
|
|
17
18
|
</div>
|
|
18
19
|
</template>
|
|
19
20
|
<template #footer>
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
class="btn-transparent d-flex align-items-center text-truncate medium-text text-light"
|
|
5
5
|
@click="showChaptering = !showChaptering"
|
|
6
6
|
>
|
|
7
|
-
<div class="text-truncate">
|
|
7
|
+
<div class="text-truncate">
|
|
8
|
+
{{ actualIndex + 1 + " - " + actualChapter.title }}
|
|
9
|
+
</div>
|
|
8
10
|
<span class="saooti-right small-text" />
|
|
9
11
|
</button>
|
|
10
12
|
<ChapteringModal v-if="showChaptering" @close="showChaptering = false" />
|
|
@@ -27,6 +29,7 @@ export default defineComponent({
|
|
|
27
29
|
data() {
|
|
28
30
|
return {
|
|
29
31
|
actualChapter: undefined as ChapterPercent | undefined,
|
|
32
|
+
actualIndex: 0 as number,
|
|
30
33
|
showChaptering: false as boolean,
|
|
31
34
|
};
|
|
32
35
|
},
|
|
@@ -57,6 +60,7 @@ export default defineComponent({
|
|
|
57
60
|
this.isInChapter(progressPercent, this.playerChapteringPercent[i])
|
|
58
61
|
) {
|
|
59
62
|
this.actualChapter = this.playerChapteringPercent[i];
|
|
63
|
+
this.actualIndex = i;
|
|
60
64
|
return;
|
|
61
65
|
}
|
|
62
66
|
}
|
package/src/helper/duration.ts
CHANGED
|
@@ -13,6 +13,6 @@ export default {
|
|
|
13
13
|
const hours = Math.floor(totalSeconds / 3600);
|
|
14
14
|
const minutes = Math.floor((totalSeconds - hours * 3600) / 60);
|
|
15
15
|
const seconds = totalSeconds - hours * 3600 - minutes * 60;
|
|
16
|
-
return (hours > 0? this.formatToString(hours)+separator:"") + this.formatToString(minutes) +separator+ this.formatToString(seconds) + (isLast?separator:
|
|
16
|
+
return (hours > 0? this.formatToString(hours)+separator:"") + this.formatToString(minutes) +separator+ this.formatToString(seconds) + (isLast?separator:'' );
|
|
17
17
|
},
|
|
18
18
|
};
|
|
@@ -46,14 +46,14 @@ export const usePlayerStore = defineStore("PlayerStore", {
|
|
|
46
46
|
if(!this.playerChaptering || 0===this.playerTotal){
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
const chapteringKeys = Object.keys(this.playerChaptering);
|
|
50
49
|
let chapteringPercent: ChapteringPercent = [];
|
|
51
|
-
for (let i = 0, len =
|
|
50
|
+
for (let i = 0, len = this.playerChaptering.chapters.length; i < len; i++) {
|
|
52
51
|
chapteringPercent.push({
|
|
53
|
-
startTime :
|
|
54
|
-
|
|
52
|
+
startTime : this.playerChaptering.chapters[i].startTime,
|
|
53
|
+
startDisplay: DurationHelper.formatDuration(this.playerChaptering.chapters[i].startTime, ':', false),
|
|
54
|
+
startPercent: (this.playerChaptering.chapters[i].startTime * 100 ) / (Math.round(this.playerTotal)),
|
|
55
55
|
endPercent:100,
|
|
56
|
-
title: this.playerChaptering[
|
|
56
|
+
title: this.playerChaptering.chapters[i].title
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
for (let i = 0, len = chapteringPercent.length; i < len; i++) {
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
//https://github.com/Podcastindex-org/podcast-namespace/blob/main/chapters/jsonChapters.md
|
|
1
2
|
export interface Chaptering {
|
|
2
|
-
|
|
3
|
+
version: string;
|
|
4
|
+
chapters: Array<Chapter>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Chapter{
|
|
8
|
+
startTime: number;
|
|
9
|
+
title: string;
|
|
10
|
+
img?: string;
|
|
11
|
+
url?:string
|
|
3
12
|
}
|
|
4
13
|
|
|
5
14
|
export interface ChapterPercent {
|
|
6
|
-
startTime:
|
|
15
|
+
startTime: number;
|
|
16
|
+
startDisplay: string;
|
|
7
17
|
startPercent: number;
|
|
8
18
|
endPercent: number;
|
|
9
19
|
title: string;
|
|
10
20
|
}
|
|
11
21
|
|
|
22
|
+
|
|
12
23
|
export type ChapteringPercent = Array<ChapterPercent>;
|