@saooti/octopus-sdk 33.0.1 → 33.0.3
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 -0
- package/package.json +1 -1
- package/public/img/ACPM.png +0 -0
- package/src/assets/general.scss +1 -1
- package/src/assets/share.scss +0 -5
- package/src/components/display/emission/EmissionItem.vue +8 -8
- package/src/components/display/participant/ParticipantItem.vue +6 -6
- package/src/components/display/playlist/PlaylistItem.vue +6 -6
- package/src/components/misc/ErrorMessage.vue +3 -5
- package/src/components/misc/TopBar.vue +1 -1
- package/src/components/misc/player/Player.vue +1 -0
- package/src/components/misc/player/PlayerLarge.vue +10 -6
- package/src/components/mixins/functions.ts +3 -2
- package/src/components/mixins/player/playerDisplay.ts +3 -0
- package/src/components/mixins/player/playerLogic.ts +53 -0
- package/src/main.ts +1 -1
- package/src/sass/_variables.scss +1 -1
- package/src/store/AppStore.ts +3 -0
- package/src/store/class/general/player.ts +1 -0
- package/public/img/caution.png +0 -0
- package/public/img/play-podcast.png +0 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/public/img/ACPM.png
CHANGED
|
Binary file
|
package/src/assets/general.scss
CHANGED
package/src/assets/share.scss
CHANGED
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
:alt="$t('Emission name image', {name:emission.name})"
|
|
19
19
|
>
|
|
20
20
|
<div class="emission-item-text">
|
|
21
|
-
<div
|
|
22
|
-
|
|
23
|
-
>
|
|
24
|
-
<img
|
|
21
|
+
<div class="d-flex align-items-center">
|
|
22
|
+
<span
|
|
25
23
|
v-if="!activeEmission && !isPodcastmaker && editRight"
|
|
26
|
-
class="icon-caution"
|
|
27
|
-
src="/img/caution.png"
|
|
28
24
|
:title="$t('Emission have not podcasts')"
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
class="saooti-warning text-danger me-1"/>
|
|
26
|
+
<div
|
|
27
|
+
class="emission-name"
|
|
28
|
+
>
|
|
29
|
+
{{ emission.name }}
|
|
30
|
+
</div>
|
|
31
31
|
</div>
|
|
32
32
|
<div
|
|
33
33
|
ref="descriptionEmissionContainer"
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
:alt="$t('Animator image')"
|
|
19
19
|
class="img-box-circle"
|
|
20
20
|
>
|
|
21
|
-
<div class="
|
|
22
|
-
<
|
|
21
|
+
<div class="d-flex align-items-center">
|
|
22
|
+
<span
|
|
23
23
|
v-if="!activeParticipant && !isPodcastmaker && editRight"
|
|
24
|
-
src="/img/caution.png"
|
|
25
|
-
class="icon-caution"
|
|
26
24
|
:title="$t('Participant have not podcasts')"
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
class="saooti-warning text-danger me-1"/>
|
|
26
|
+
<div class="participant-name">
|
|
27
|
+
{{ name }}
|
|
28
|
+
</div>
|
|
29
29
|
</div>
|
|
30
30
|
<div
|
|
31
31
|
ref="descriptionParticipantContainer"
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
class="img-box"
|
|
20
20
|
>
|
|
21
21
|
<div class="emission-item-text">
|
|
22
|
-
<div class="
|
|
23
|
-
<
|
|
22
|
+
<div class="d-flex align-items-center">
|
|
23
|
+
<span
|
|
24
24
|
v-if="!activePlaylist && !isPodcastmaker"
|
|
25
|
-
class="icon-caution"
|
|
26
|
-
src="/img/caution.png"
|
|
27
25
|
:title="$t('Playlist have not podcasts')"
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
class="saooti-warning text-danger me-1"/>
|
|
27
|
+
<div class="emission-name">
|
|
28
|
+
{{ name }}
|
|
29
|
+
</div>
|
|
30
30
|
</div>
|
|
31
31
|
<div
|
|
32
32
|
ref="descriptionPlaylistContainer"
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
<div
|
|
7
7
|
class="d-flex align-items-center bg-error-message p-2 rounded my-1"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class="icon-caution"
|
|
13
|
-
>
|
|
9
|
+
<span
|
|
10
|
+
:title="$t('Warning')"
|
|
11
|
+
class="saooti-warning text-danger me-1"/>
|
|
14
12
|
<div class="alert-text">
|
|
15
13
|
{{ message }}
|
|
16
14
|
</div>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@click="onDisplayMenu(true)"
|
|
15
15
|
>
|
|
16
16
|
<img
|
|
17
|
-
:src="!filterOrga || '' === imgUrl ? logoUrl : proxyImageUrl(imgUrl, '
|
|
17
|
+
:src="!filterOrga || '' === imgUrl ? logoUrl : proxyImageUrl(imgUrl, '', '50')"
|
|
18
18
|
:alt="!filterOrga || '' === imgUrl ? $t('Logo of main page') : $t('Visual', {name: $store.state.filter?.name})"
|
|
19
19
|
:class="isEducation ? 'educationLogo' : ''"
|
|
20
20
|
>
|
|
@@ -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>
|
|
@@ -9,12 +9,13 @@ export const selenium ={
|
|
|
9
9
|
};
|
|
10
10
|
export const imageProxy ={
|
|
11
11
|
methods: {
|
|
12
|
-
proxyImageUrl(url:string, width:string): string{
|
|
12
|
+
proxyImageUrl(url:string, width:string, height?:string): string{
|
|
13
13
|
if(!url){
|
|
14
14
|
return "";
|
|
15
15
|
}
|
|
16
16
|
if(state.octopusApi.imageUrl && url.includes('http')){
|
|
17
|
-
|
|
17
|
+
const size = height ? "height="+height:"width="+width;
|
|
18
|
+
return state.octopusApi.imageUrl+"image/"+btoa(url)+"?"+size+"&useWebp=true";
|
|
18
19
|
}
|
|
19
20
|
return url;
|
|
20
21
|
},
|
|
@@ -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/main.ts
CHANGED
|
@@ -10,7 +10,7 @@ import paramStore from '@/store/paramStore';
|
|
|
10
10
|
const nameEQ = 'octopus-language=';
|
|
11
11
|
const ca = document.cookie.split(';');
|
|
12
12
|
let language = "";
|
|
13
|
-
for (let valueCookie
|
|
13
|
+
for (let valueCookie of ca) {
|
|
14
14
|
let c = valueCookie;
|
|
15
15
|
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
16
16
|
if (0 === c.indexOf(nameEQ)){
|
package/src/sass/_variables.scss
CHANGED
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/public/img/caution.png
DELETED
|
Binary file
|
|
Binary file
|