@saooti/octopus-sdk 32.0.29 → 32.0.31
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 +9 -1
- package/package.json +1 -1
- package/src/api/classicCrud.ts +2 -2
- package/src/components/display/sharing/PlayerParameters.vue +19 -3
- package/src/components/display/sharing/SharePlayer.vue +35 -8
- package/src/components/form/ClassicLoading.vue +2 -2
- package/src/components/mixins/player/playerLive.ts +35 -19
- package/src/components/mixins/player/playerLogic.ts +15 -5
- package/src/locale/de.ts +1 -0
- package/src/locale/en.ts +1 -0
- package/src/locale/es.ts +1 -0
- package/src/locale/fr.ts +1 -0
- package/src/locale/it.ts +1 -0
- package/src/locale/sl.ts +1 -0
package/README.md
CHANGED
|
@@ -643,6 +643,12 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
643
643
|
* 31.0.50 Améliorations responsive
|
|
644
644
|
* 31.0.51 Newest
|
|
645
645
|
* 31.0.52 Locale
|
|
646
|
+
* 31.0.53 Correction playerLogic
|
|
647
|
+
* 31.0.54 Test live ios
|
|
648
|
+
* 31.0.55 Test live ios
|
|
649
|
+
* 31.0.56 Test live ios
|
|
650
|
+
* 31.0.57 Test live ios
|
|
651
|
+
|
|
646
652
|
|
|
647
653
|
* 32.0.0 Passage en 32
|
|
648
654
|
* 32.0.1 Navigation clavier
|
|
@@ -673,4 +679,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
673
679
|
* 32.0.26 Image Proxy
|
|
674
680
|
* 32.0.27 Image Proxy -> webp
|
|
675
681
|
* 32.0.28 Image Proxy
|
|
676
|
-
* 32.0.29 SpeechToText
|
|
682
|
+
* 32.0.29 SpeechToText
|
|
683
|
+
* 32.0.30 SpeechToText
|
|
684
|
+
* 32.0.31 Merge live IOS
|
package/package.json
CHANGED
package/src/api/classicCrud.ts
CHANGED
|
@@ -16,8 +16,8 @@ enum ModuleApi {
|
|
|
16
16
|
}
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
export default {
|
|
19
|
-
async fetchData<Type>(state: StoreState,moduleName: ModuleApi,wsPath:string): Promise<Type>{
|
|
20
|
-
console.log(state,moduleName,wsPath);
|
|
19
|
+
async fetchData<Type>(state: StoreState,moduleName: ModuleApi,wsPath:string, forceRefresh?:boolean): Promise<Type>{
|
|
20
|
+
console.log(state,moduleName,wsPath,forceRefresh);
|
|
21
21
|
const response = await axios.get('/mock');
|
|
22
22
|
return response.data;
|
|
23
23
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
/>
|
|
83
83
|
</div>
|
|
84
84
|
<div
|
|
85
|
-
v-
|
|
85
|
+
v-if="displayArticleParam"
|
|
86
86
|
class="d-flex flex-column flex-grow-1"
|
|
87
87
|
>
|
|
88
88
|
<ClassicCheckbox
|
|
@@ -91,6 +91,16 @@
|
|
|
91
91
|
:label="$t('Display associated article')"
|
|
92
92
|
/>
|
|
93
93
|
</div>
|
|
94
|
+
<div
|
|
95
|
+
v-if="displayTranscriptParam"
|
|
96
|
+
class="d-flex flex-column flex-grow-1"
|
|
97
|
+
>
|
|
98
|
+
<ClassicCheckbox
|
|
99
|
+
v-model:textInit="displayTranscript"
|
|
100
|
+
id-checkbox="display-transcript-checkbox"
|
|
101
|
+
:label="$t('If the transcript is available, show it')"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
94
104
|
</div>
|
|
95
105
|
</div>
|
|
96
106
|
</div>
|
|
@@ -107,9 +117,11 @@ export default defineComponent({
|
|
|
107
117
|
props: {
|
|
108
118
|
isVisible: { default: false, type: Boolean},
|
|
109
119
|
choseNumberEpisode: {default: false, type: Boolean},
|
|
110
|
-
displayChoiceAllEpisodes: {default: false, type: Boolean}
|
|
120
|
+
displayChoiceAllEpisodes: {default: false, type: Boolean},
|
|
121
|
+
displayTranscriptParam: {default: false, type: Boolean},
|
|
122
|
+
displayArticleParam: {default: false, type: Boolean},
|
|
111
123
|
},
|
|
112
|
-
emits: ['episodeNumbers', 'proceedReading', 'isVisible', 'iFrameNumber', 'displayArticle'],
|
|
124
|
+
emits: ['episodeNumbers', 'proceedReading', 'isVisible', 'iFrameNumber', 'displayArticle', 'displayTranscript'],
|
|
113
125
|
|
|
114
126
|
data() {
|
|
115
127
|
return {
|
|
@@ -118,6 +130,7 @@ export default defineComponent({
|
|
|
118
130
|
iFrameNumberPriv: '3' as string,
|
|
119
131
|
isVisibleTemp: this.isVisible as boolean,
|
|
120
132
|
displayArticle: true as boolean,
|
|
133
|
+
displayTranscript:true as boolean,
|
|
121
134
|
};
|
|
122
135
|
},
|
|
123
136
|
computed: {
|
|
@@ -151,6 +164,9 @@ export default defineComponent({
|
|
|
151
164
|
},
|
|
152
165
|
displayArticle(): void{
|
|
153
166
|
this.$emit('displayArticle', this.displayArticle);
|
|
167
|
+
},
|
|
168
|
+
displayTranscript(): void{
|
|
169
|
+
this.$emit('displayTranscript', this.displayTranscript);
|
|
154
170
|
}
|
|
155
171
|
},
|
|
156
172
|
})
|
|
@@ -44,7 +44,10 @@
|
|
|
44
44
|
:is-visible="isVisible"
|
|
45
45
|
:chose-number-episode="displayChoiceAllEpisodes|| isLargeSuggestion"
|
|
46
46
|
:display-choice-all-episodes="displayChoiceAllEpisodes"
|
|
47
|
+
:displayTranscriptParam="displayTranscriptParam"
|
|
48
|
+
:displayArticleParam="displayArticleParam"
|
|
47
49
|
@displayArticle="displayArticle = $event"
|
|
50
|
+
@displayTranscript="displayTranscript = $event"
|
|
48
51
|
@episodeNumbers="episodeNumbers = $event"
|
|
49
52
|
@proceedReading="proceedReading = $event"
|
|
50
53
|
@isVisible="isVisible = $event"
|
|
@@ -119,17 +122,32 @@ export default defineComponent({
|
|
|
119
122
|
iFrameNumber: '3' as string,
|
|
120
123
|
isVisible: false as boolean,
|
|
121
124
|
displayArticle: true as boolean,
|
|
125
|
+
displayTranscript: true as boolean,
|
|
122
126
|
colors: ['#000000', '#ffffff'],
|
|
127
|
+
orgaAttributes: undefined as{[key: string]:string|number|boolean|undefined}|undefined,
|
|
123
128
|
};
|
|
124
129
|
},
|
|
125
130
|
|
|
126
131
|
computed: {
|
|
132
|
+
displayArticleParam():boolean{
|
|
133
|
+
return undefined!==this.podcast && undefined!==this.podcast.article && 0 !== this.podcast.article.length;
|
|
134
|
+
},
|
|
135
|
+
displayTranscriptParam():boolean{
|
|
136
|
+
return this.isTranscriptionAuthorize && (this.isDefault || this.isEmission);
|
|
137
|
+
},
|
|
138
|
+
isTranscriptionAuthorize(): boolean{
|
|
139
|
+
if(!this.orgaAttributes){return false;}
|
|
140
|
+
return this.orgaAttributes && Object.prototype.hasOwnProperty.call(this.orgaAttributes,'speechtotext.active')?(this.orgaAttributes['speechtotext.active'] as boolean): false;
|
|
141
|
+
},
|
|
127
142
|
displayChoiceAllEpisodes():boolean{
|
|
128
143
|
return !this.podcast || this.isEmission || this.isLargeEmission;
|
|
129
144
|
},
|
|
130
145
|
baseUrl(): string{
|
|
131
146
|
return (state.podcastPage.MiniplayerUri as string);
|
|
132
147
|
},
|
|
148
|
+
isDefault(): boolean {
|
|
149
|
+
return 'default' === this.iFrameModel;
|
|
150
|
+
},
|
|
133
151
|
isEmission(): boolean {
|
|
134
152
|
return 'emission' === this.iFrameModel;
|
|
135
153
|
},
|
|
@@ -193,6 +211,9 @@ export default defineComponent({
|
|
|
193
211
|
if(!this.displayArticle){
|
|
194
212
|
url.push('&article=false');
|
|
195
213
|
}
|
|
214
|
+
if(!this.displayTranscript){
|
|
215
|
+
url.push('&transcript=false');
|
|
216
|
+
}
|
|
196
217
|
if (this.isVisible) {
|
|
197
218
|
url.push('&key=' + window.btoa(this.dataTitle.toString()));
|
|
198
219
|
}
|
|
@@ -247,26 +268,32 @@ export default defineComponent({
|
|
|
247
268
|
return 0;
|
|
248
269
|
},
|
|
249
270
|
isPlayerParameter(): boolean{
|
|
250
|
-
return (!this.podcast ||
|
|
271
|
+
return (!this.podcast ||
|
|
272
|
+
(this.displayArticle) ||
|
|
273
|
+
this.isEmission || this.isLargeEmission || this.isLargeSuggestion ||
|
|
274
|
+
(this.displayTranscriptParam))
|
|
275
|
+
&& !this.playlist;
|
|
251
276
|
}
|
|
252
277
|
},
|
|
253
278
|
async created() {
|
|
279
|
+
await this.fetchOrgaAttributes();
|
|
254
280
|
await this.initColor();
|
|
255
281
|
if (this.isLiveReadyToRecord) {
|
|
256
282
|
this.iFrameModel = 'large';
|
|
257
283
|
}
|
|
258
284
|
},
|
|
259
285
|
methods: {
|
|
260
|
-
async
|
|
261
|
-
if (!this.authenticated) return;
|
|
262
|
-
let data;
|
|
286
|
+
async fetchOrgaAttributes(): Promise<void>{
|
|
263
287
|
if(this.$store.state.organisation?.attributes && Object.keys(this.$store.state.organisation.attributes).length > 1){
|
|
264
|
-
|
|
288
|
+
this.orgaAttributes = this.$store.state.organisation.attributes;
|
|
265
289
|
}else{
|
|
266
|
-
|
|
290
|
+
this.orgaAttributes= await octopusApi.fetchData<{[key:string]:string}>(0, 'organisation/attributes/'+this.myOrganisationId);
|
|
267
291
|
}
|
|
268
|
-
|
|
269
|
-
|
|
292
|
+
},
|
|
293
|
+
initColor(): void {
|
|
294
|
+
if(!this.orgaAttributes){return;}
|
|
295
|
+
this.color = Object.prototype.hasOwnProperty.call(this.orgaAttributes,'COLOR') ? (this.orgaAttributes.COLOR as string) : '#40a372';
|
|
296
|
+
this.theme = Object.prototype.hasOwnProperty.call(this.orgaAttributes,'THEME') ? (this.orgaAttributes.THEME as string) : '#000000';
|
|
270
297
|
},
|
|
271
298
|
},
|
|
272
299
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="loadingText"
|
|
4
|
-
class="d-flex justify-content-center"
|
|
4
|
+
class="d-flex align-items-center justify-content-center"
|
|
5
5
|
>
|
|
6
|
-
<div class="spinner-border me-3" />
|
|
6
|
+
<div class="spinner-border me-3 flex-shrink-0" />
|
|
7
7
|
<div class="h3 mt-2">
|
|
8
8
|
{{ loadingText }}
|
|
9
9
|
</div>
|
|
@@ -14,6 +14,7 @@ export const playerLive = defineComponent({
|
|
|
14
14
|
lastSend: 0 as number,
|
|
15
15
|
hlsReady: false as boolean,
|
|
16
16
|
downloadId: null as string|null,
|
|
17
|
+
audioElement: null as HTMLAudioElement|null
|
|
17
18
|
};
|
|
18
19
|
},
|
|
19
20
|
computed: {
|
|
@@ -33,14 +34,43 @@ export const playerLive = defineComponent({
|
|
|
33
34
|
this.live.conferenceId +
|
|
34
35
|
'/index.m3u8';
|
|
35
36
|
try {
|
|
36
|
-
|
|
37
|
+
this.audioElement = (document.getElementById('audio-player') as HTMLAudioElement);
|
|
38
|
+
if(null===this.audioElement){
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
this.playLive();
|
|
41
|
+
}, 1000);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (this.audioElement.canPlayType('application/vnd.apple.mpegurl')) {
|
|
45
|
+
this.audioElement.src = hlsStreamUrl;
|
|
46
|
+
await this.initLiveDownloadId();
|
|
47
|
+
await (this.audioElement as HTMLAudioElement).play();
|
|
48
|
+
this.onPlay();
|
|
49
|
+
}else{
|
|
50
|
+
await this.initHls(hlsStreamUrl);
|
|
51
|
+
}
|
|
37
52
|
} catch (error) {
|
|
38
|
-
console.log(error);
|
|
39
53
|
setTimeout(() => {
|
|
40
54
|
this.playLive();
|
|
41
55
|
}, 1000);
|
|
42
56
|
}
|
|
43
57
|
},
|
|
58
|
+
async initLiveDownloadId(){
|
|
59
|
+
if(!this.live){ return;}
|
|
60
|
+
let downloadId = null;
|
|
61
|
+
try {
|
|
62
|
+
downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.live.livePodcastId, undefined);
|
|
63
|
+
await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' + this.live.livePodcastId+".m3u8",{
|
|
64
|
+
'downloadId': null!==downloadId ? downloadId : undefined,
|
|
65
|
+
'origin':'octopus',
|
|
66
|
+
'distributorId':this.$store.state.authentication.organisationId
|
|
67
|
+
});
|
|
68
|
+
this.setDownloadId(downloadId);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.log('ERROR downloadId');
|
|
71
|
+
}
|
|
72
|
+
this.hlsReady = true;
|
|
73
|
+
},
|
|
44
74
|
async initHls(hlsStreamUrl: string): Promise<void> {
|
|
45
75
|
return new Promise<void>(async(resolve, reject) => {
|
|
46
76
|
if(null === Hls){
|
|
@@ -65,23 +95,9 @@ export const playerLive = defineComponent({
|
|
|
65
95
|
);
|
|
66
96
|
} */
|
|
67
97
|
hls.on(Hls.Events.MANIFEST_PARSED, async () => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.live.livePodcastId, undefined);
|
|
72
|
-
await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' + this.live.livePodcastId+".m3u8",{
|
|
73
|
-
'downloadId': null!==downloadId ? downloadId : undefined,
|
|
74
|
-
'origin':'octopus',
|
|
75
|
-
'distributorId':this.$store.state.authentication.organisationId
|
|
76
|
-
});
|
|
77
|
-
this.setDownloadId(downloadId);
|
|
78
|
-
} catch (error) {
|
|
79
|
-
console.log('ERROR downloadId');
|
|
80
|
-
}
|
|
81
|
-
this.hlsReady = true;
|
|
82
|
-
const audio: HTMLElement|null = document.getElementById('audio-player');
|
|
83
|
-
hls.attachMedia((audio as HTMLAudioElement));
|
|
84
|
-
await (audio as HTMLAudioElement).play();
|
|
98
|
+
await this.initLiveDownloadId();
|
|
99
|
+
hls.attachMedia((this.audioElement as HTMLAudioElement));
|
|
100
|
+
await (this.audioElement as HTMLAudioElement).play();
|
|
85
101
|
this.onPlay();
|
|
86
102
|
resolve();
|
|
87
103
|
});
|
|
@@ -63,10 +63,12 @@ export const playerLogic = defineComponent({
|
|
|
63
63
|
},
|
|
64
64
|
live: {
|
|
65
65
|
deep: true,
|
|
66
|
-
|
|
67
|
-
this
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
handler(){
|
|
67
|
+
this.$nextTick(async () => {
|
|
68
|
+
this.hlsReady = false;
|
|
69
|
+
this.reInitPlayer();
|
|
70
|
+
await this.playLive();
|
|
71
|
+
});
|
|
70
72
|
}
|
|
71
73
|
},
|
|
72
74
|
async listenTime(newVal): Promise<void> {
|
|
@@ -188,7 +190,15 @@ export const playerLogic = defineComponent({
|
|
|
188
190
|
mediaTarget.currentTime - this.notListenTime;
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
|
-
|
|
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
|
+
}
|
|
192
202
|
if (!streamDuration) return;
|
|
193
203
|
if (!mediaTarget.currentTime) return;
|
|
194
204
|
if (!this.live) {
|
package/src/locale/de.ts
CHANGED
package/src/locale/en.ts
CHANGED
package/src/locale/es.ts
CHANGED
package/src/locale/fr.ts
CHANGED
package/src/locale/it.ts
CHANGED