@saooti/octopus-sdk 33.0.2 → 33.0.4
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 +3 -0
- package/package.json +1 -1
- package/public/img/403.webp +0 -0
- package/public/img/ACPM.webp +0 -0
- package/public/img/emptypodcast.webp +0 -0
- package/public/img/logo_education.webp +0 -0
- package/src/assets/general.scss +1 -1
- package/src/components/display/organisation/OrganisationChooser.vue +1 -1
- package/src/components/misc/Footer.vue +1 -1
- package/src/components/misc/TopBar.vue +1 -1
- package/src/components/misc/player/Player.vue +1 -0
- package/src/components/misc/player/PlayerCompact.vue +2 -2
- package/src/components/misc/player/PlayerLarge.vue +10 -6
- package/src/components/mixins/player/playerDisplay.ts +3 -0
- package/src/components/mixins/player/playerLogic.ts +53 -0
- package/src/components/pages/Error403Page.vue +1 -1
- package/src/store/AppStore.ts +3 -0
- package/src/store/class/general/player.ts +1 -0
- package/src/store/paramStore.ts +5 -5
- package/public/img/403.jpeg +0 -0
- package/public/img/ACPM.png +0 -0
- package/public/img/emptypodcast.png +0 -0
- package/public/img/logo_education.png +0 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/assets/general.scss
CHANGED
|
@@ -119,7 +119,7 @@ import { Organisation } from '@/store/class/general/organisation';
|
|
|
119
119
|
|
|
120
120
|
const ELEMENTS_COUNT = 50;
|
|
121
121
|
const DEFAULT_ORGANISATION_ID = "";
|
|
122
|
-
const DEFAULT_ORGANISATION_IMAGE = '/img/emptypodcast.
|
|
122
|
+
const DEFAULT_ORGANISATION_IMAGE = '/img/emptypodcast.webp';
|
|
123
123
|
|
|
124
124
|
const getDefaultOrganistion = (defaultName: string) => {
|
|
125
125
|
if(''===defaultName){
|
|
@@ -117,7 +117,7 @@ export default defineComponent({
|
|
|
117
117
|
return undefined;
|
|
118
118
|
},
|
|
119
119
|
logoUrl(): string {
|
|
120
|
-
return this.isEducation ?'/img/logo_education.
|
|
120
|
+
return this.isEducation ?'/img/logo_education.webp': '/img/logo_octopus_final.svg';
|
|
121
121
|
},
|
|
122
122
|
isPodcastmaker(): boolean {
|
|
123
123
|
return (state.generalParameters.podcastmaker as boolean);
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
</div>
|
|
61
61
|
<button
|
|
62
62
|
:title="$t('Enlarge')"
|
|
63
|
-
class="btn play-button-box
|
|
63
|
+
class="btn play-button-box saooti-up"
|
|
64
64
|
@click="changePlayerLargeVersion"
|
|
65
65
|
/>
|
|
66
66
|
<button
|
|
67
67
|
:title="$t('Close')"
|
|
68
|
-
class="btn play-button-box
|
|
68
|
+
class="btn play-button-box saooti-remove"
|
|
69
69
|
@click="stopPlayer"
|
|
70
70
|
/>
|
|
71
71
|
<PlayerTimeline
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
:to="podcastShareUrl"
|
|
13
13
|
>
|
|
14
14
|
<img
|
|
15
|
-
v-lazy="proxyImageUrl(podcastImage,'
|
|
15
|
+
v-lazy="proxyImageUrl(podcastImage,'200')"
|
|
16
16
|
:alt="$t('Podcast image')"
|
|
17
17
|
class="img-box"
|
|
18
18
|
>
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
<div>{{ totalTime }}</div>
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
49
|
-
<div class="d-flex align-items-center">
|
|
49
|
+
<div class="flex-grow-1 d-flex align-items-center w-100" v-if="''!=transcriptText">
|
|
50
|
+
<div class="flex-grow-1 p-1 text-center mx-3 transcript-bg rounded">{{transcriptText}}</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="d-flex align-items-center flex-grow-1">
|
|
50
53
|
<button
|
|
51
54
|
class="btn fs-1 bg-transparent text-light saooti-backward"
|
|
52
55
|
@click="seekClick(-15)"
|
|
@@ -131,10 +134,8 @@ export default defineComponent({
|
|
|
131
134
|
<style lang="scss">
|
|
132
135
|
.octopus-app{
|
|
133
136
|
.player-container .img-box{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
height: 10rem;
|
|
137
|
-
}
|
|
137
|
+
width: 10rem;
|
|
138
|
+
height: 10rem;
|
|
138
139
|
}
|
|
139
140
|
.player-reduce-button{
|
|
140
141
|
position: absolute;
|
|
@@ -163,5 +164,8 @@ export default defineComponent({
|
|
|
163
164
|
flex-shrink: 0;
|
|
164
165
|
cursor: pointer;
|
|
165
166
|
}
|
|
167
|
+
.transcript-bg{
|
|
168
|
+
background: #3e3e3e;
|
|
169
|
+
}
|
|
166
170
|
}
|
|
167
171
|
</style>
|
|
@@ -68,6 +68,9 @@ export const playerDisplay = defineComponent({
|
|
|
68
68
|
if (this.$store.state.player.podcast) return this.$store.state.player.podcast.emission.name;
|
|
69
69
|
return '';
|
|
70
70
|
},
|
|
71
|
+
transcriptText():string{
|
|
72
|
+
return this.$store.state.player.transcript?.actualText ?? "";
|
|
73
|
+
}
|
|
71
74
|
},
|
|
72
75
|
created(){
|
|
73
76
|
window.addEventListener('keydown', this.addKeyboardControl);
|
|
@@ -59,6 +59,7 @@ export const playerLogic = defineComponent({
|
|
|
59
59
|
deep: true,
|
|
60
60
|
handler(){
|
|
61
61
|
this.reInitPlayer();
|
|
62
|
+
this.getTranscription();
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
live: {
|
|
@@ -95,6 +96,40 @@ export const playerLogic = defineComponent({
|
|
|
95
96
|
},
|
|
96
97
|
|
|
97
98
|
methods: {
|
|
99
|
+
async getTranscription(): Promise<void>{
|
|
100
|
+
if(!this.podcast){
|
|
101
|
+
this.$store.commit('playerTranscript',undefined);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const result = await octopusApi.fetchDataPublic<string>(11 , `response/${this.podcast.podcastId}`);
|
|
105
|
+
const arrayTranscript = this.parseSrt(result);
|
|
106
|
+
const actualText = arrayTranscript?.[0]?.startTime === 0 ? arrayTranscript[0].text : "";
|
|
107
|
+
this.$store.commit('playerTranscript',{actual: 0,actualText:actualText, value : arrayTranscript});
|
|
108
|
+
},
|
|
109
|
+
parseSrt(transcript: string){
|
|
110
|
+
var pattern = /(\d+)\n([\d:,]+)\s+-{2}\>\s+([\d:,]+)\n([\s\S]*?(?=\n{2}|$))/gm;
|
|
111
|
+
var result = [];
|
|
112
|
+
if (typeof(transcript) != 'string'){
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (transcript == null){
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
transcript = transcript.replace(/\r\n|\r|\n|\t/g, '\n');
|
|
119
|
+
let matches;
|
|
120
|
+
while ((matches = pattern.exec(transcript)) != null) {
|
|
121
|
+
result.push({
|
|
122
|
+
startTime: this.srtTimeToSeconds(matches[2]),
|
|
123
|
+
endTime: this.srtTimeToSeconds(matches[3]),
|
|
124
|
+
text: matches[4]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return result;
|
|
128
|
+
},
|
|
129
|
+
srtTimeToSeconds(time:string): number{
|
|
130
|
+
var a = time.split(':');
|
|
131
|
+
return (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+parseFloat(a[2]));
|
|
132
|
+
},
|
|
98
133
|
getDomain(): string{
|
|
99
134
|
let domain = "";
|
|
100
135
|
const domainArray: RegExpExecArray | null = /\.(.+)/.exec(window.location.host);
|
|
@@ -184,11 +219,18 @@ export const playerLogic = defineComponent({
|
|
|
184
219
|
}
|
|
185
220
|
return streamDuration;
|
|
186
221
|
},
|
|
222
|
+
onTimeUpdateTranscript(currentTime:number){
|
|
223
|
+
if((this.$store.state.player.transcript?.value[this.$store.state.player.transcript?.actual]?.endTime ?? Infinity) < currentTime){
|
|
224
|
+
this.$store.state.player.transcript.actual +=1;
|
|
225
|
+
this.$store.state.player.transcript.actualText = this.$store.state.player.transcript?.value[this.$store.state.player.transcript?.actual].text ?? "";
|
|
226
|
+
}
|
|
227
|
+
},
|
|
187
228
|
onTimeUpdatePodcast(streamDuration:number, currentTime:number){
|
|
188
229
|
this.displayAlertBar = false;
|
|
189
230
|
this.percentLiveProgress = 100;
|
|
190
231
|
this.$store.commit('playerTotalTime', streamDuration);
|
|
191
232
|
this.$store.commit('playerElapsed', currentTime / streamDuration);
|
|
233
|
+
this.onTimeUpdateTranscript(currentTime);
|
|
192
234
|
},
|
|
193
235
|
onTimeUpdateLive(streamDuration: number, currentTime:number){
|
|
194
236
|
if(!this.live){return;}
|
|
@@ -236,6 +278,17 @@ export const playerLogic = defineComponent({
|
|
|
236
278
|
}
|
|
237
279
|
this.onTimeUpdateLive(streamDuration,mediaTarget.currentTime);
|
|
238
280
|
},
|
|
281
|
+
onSeeked(event: Event):void {
|
|
282
|
+
const mediaTarget = (event.currentTarget as HTMLMediaElement);
|
|
283
|
+
const currentTime = mediaTarget.currentTime;
|
|
284
|
+
if(this.$store.state.player.transcript){
|
|
285
|
+
let newActual = 0;
|
|
286
|
+
while (currentTime > (this.$store.state.player.transcript.value[newActual]?.endTime ?? Infinity)){
|
|
287
|
+
newActual +=1;
|
|
288
|
+
}
|
|
289
|
+
this.$store.state.player.transcript.actual = newActual;
|
|
290
|
+
}
|
|
291
|
+
},
|
|
239
292
|
onFinished(): void {
|
|
240
293
|
this.setDownloadId(null);
|
|
241
294
|
if (this.live) {
|
package/src/store/AppStore.ts
CHANGED
|
@@ -80,6 +80,9 @@ export default createStore({
|
|
|
80
80
|
playerSeekTime(state, seekTime) {
|
|
81
81
|
state.player.seekTime = seekTime;
|
|
82
82
|
},
|
|
83
|
+
playerTranscript(state, transcript) {
|
|
84
|
+
state.player.transcript = transcript;
|
|
85
|
+
},
|
|
83
86
|
|
|
84
87
|
filterOrga(state, filter) {
|
|
85
88
|
state.filter.organisationId = filter.orgaId;
|
package/src/store/paramStore.ts
CHANGED
|
@@ -78,15 +78,15 @@ const state:ParamStore = {
|
|
|
78
78
|
contactLink: undefined,
|
|
79
79
|
},
|
|
80
80
|
organisation: {
|
|
81
|
-
imageUrl: '/img/emptypodcast.
|
|
81
|
+
imageUrl: '/img/emptypodcast.webp',
|
|
82
82
|
name: 'Saooti',
|
|
83
83
|
userName: '',
|
|
84
84
|
},
|
|
85
85
|
octopusApi: {
|
|
86
|
-
url: '
|
|
87
|
-
commentsUrl: '
|
|
88
|
-
imageUrl:'
|
|
89
|
-
studioUrl: '
|
|
86
|
+
url: 'https://api.dev2.saooti.org/',
|
|
87
|
+
commentsUrl: 'https://comments.dev2.saooti.org/',
|
|
88
|
+
imageUrl:'https://imageproxy.dev2.saooti.org/',
|
|
89
|
+
studioUrl: 'https://studio.dev2.saooti.org/',
|
|
90
90
|
playerUrl: 'https://playerbeta.dev2.saooti.org/',
|
|
91
91
|
speechToTextUrl:'https://speech2text.dev2.saooti.org/',
|
|
92
92
|
recoUrl: 'https://reco.dev2.saooti.org/',
|
package/public/img/403.jpeg
DELETED
|
Binary file
|
package/public/img/ACPM.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|