@saooti/octopus-sdk 30.0.45 → 30.0.49
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 +5 -1
- package/package.json +3 -2
- package/src/assets/share.scss +19 -0
- package/src/components/display/emission/EmissionInlineList.vue +4 -24
- package/src/components/display/podcasts/PodcastInlineList.vue +15 -3
- package/src/components/display/podcasts/PodcastPlayBar.vue +3 -3
- package/src/components/misc/Player.vue +44 -40
- package/src/components/misc/PlayerButtons.vue +1 -0
- package/src/components/pages/Emission.vue +24 -19
- package/src/store/paramStore.ts +4 -0
package/README.md
CHANGED
|
@@ -541,4 +541,8 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
541
541
|
* 30.0.42 Resize rubriqueList
|
|
542
542
|
* 30.0.43 Resize rubriqueList
|
|
543
543
|
* 30.0.44 ProgressBar pour le soir
|
|
544
|
-
* 30.0.45 ProgressBar pour le soir
|
|
544
|
+
* 30.0.45 ProgressBar pour le soir
|
|
545
|
+
* 30.0.46 Param pour le soir
|
|
546
|
+
* 30.0.47 Live error
|
|
547
|
+
* 30.0.48 Podcastmaker ScrollOverflow PodcastInlineList
|
|
548
|
+
* 30.0.49 Podcastmaker ProgressBar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saooti/octopus-sdk",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.49",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Javascript SDK for using octopus",
|
|
6
6
|
"author": "Saooti",
|
|
@@ -79,7 +79,8 @@
|
|
|
79
79
|
"no-console": "off",
|
|
80
80
|
"no-debugger": "off",
|
|
81
81
|
"@typescript-eslint/ban-ts-ignore": "off",
|
|
82
|
-
"@typescript-eslint/ban-ts-comment": "off"
|
|
82
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
83
|
+
"no-async-promise-executor":"off"
|
|
83
84
|
},
|
|
84
85
|
"parserOptions": {
|
|
85
86
|
"parser": "@typescript-eslint/parser"
|
package/src/assets/share.scss
CHANGED
|
@@ -66,6 +66,25 @@
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
.element-list-inline.overflowScroll {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-wrap: wrap;
|
|
72
|
+
-webkit-overflow-scrolling: touch;
|
|
73
|
+
scroll-behavior: smooth;
|
|
74
|
+
padding-bottom: 1rem;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 80vh;
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
grid-gap: inherit;
|
|
79
|
+
@media (max-width: 960px) {
|
|
80
|
+
overflow-x: hidden;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
flex-wrap: nowrap;
|
|
83
|
+
}
|
|
84
|
+
.item-phone-margin {
|
|
85
|
+
margin: 1rem 0.5rem !important;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
69
88
|
|
|
70
89
|
.emission-list {
|
|
71
90
|
align-self: stretch;
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
/>
|
|
56
56
|
</transition-group>
|
|
57
57
|
<router-link
|
|
58
|
-
v-if="!overflowScroll"
|
|
59
58
|
:to="href"
|
|
60
59
|
class="btn btn-link align-self-center width-fit-content m-4"
|
|
61
60
|
>
|
|
@@ -203,14 +202,14 @@ export default defineComponent({
|
|
|
203
202
|
},
|
|
204
203
|
handleResize(): void {
|
|
205
204
|
if (!this.$el) return;
|
|
206
|
-
if (window.innerWidth <= PHONE_WIDTH) {
|
|
207
|
-
this.size = 10;
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
205
|
if (this.overflowScroll) {
|
|
211
206
|
this.size = 20;
|
|
212
207
|
return;
|
|
213
208
|
}
|
|
209
|
+
if (window.innerWidth <= PHONE_WIDTH) {
|
|
210
|
+
this.size = 10;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
214
213
|
const width = (this.$el as HTMLElement).offsetWidth;
|
|
215
214
|
const sixteen = domHelper.convertRemToPixels(this.itemSize + 0.7);
|
|
216
215
|
this.size = Math.floor(width / sixteen);
|
|
@@ -270,24 +269,5 @@ export default defineComponent({
|
|
|
270
269
|
margin-bottom: 1rem;
|
|
271
270
|
}
|
|
272
271
|
}
|
|
273
|
-
.element-list-inline.overflowScroll {
|
|
274
|
-
display: flex;
|
|
275
|
-
flex-wrap: wrap;
|
|
276
|
-
-webkit-overflow-scrolling: touch;
|
|
277
|
-
scroll-behavior: smooth;
|
|
278
|
-
padding-bottom: 1rem;
|
|
279
|
-
width: 100%;
|
|
280
|
-
height: 80vh;
|
|
281
|
-
overflow-y: auto;
|
|
282
|
-
grid-gap: inherit;
|
|
283
|
-
@media (max-width: 960px) {
|
|
284
|
-
overflow-x: hidden;
|
|
285
|
-
flex-direction: column;
|
|
286
|
-
flex-wrap: nowrap;
|
|
287
|
-
}
|
|
288
|
-
.item-phone-margin {
|
|
289
|
-
margin: 1rem 0.5rem !important;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
272
|
}
|
|
293
273
|
</style>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</button>
|
|
23
23
|
</div>
|
|
24
24
|
<div
|
|
25
|
-
v-if="!isArrow"
|
|
25
|
+
v-if="!isArrow && !overflowScroll"
|
|
26
26
|
class="hide-phone"
|
|
27
27
|
>
|
|
28
28
|
<button
|
|
@@ -51,7 +51,10 @@
|
|
|
51
51
|
:name="transitionName"
|
|
52
52
|
class="element-list-inline"
|
|
53
53
|
tag="ul"
|
|
54
|
-
:class="[
|
|
54
|
+
:class="[
|
|
55
|
+
alignLeft ? 'justify-content-start' : '',
|
|
56
|
+
overflowScroll ? 'overflowScroll' : '',
|
|
57
|
+
]"
|
|
55
58
|
>
|
|
56
59
|
<PodcastItem
|
|
57
60
|
v-for="p in podcasts"
|
|
@@ -106,6 +109,7 @@ export default defineComponent({
|
|
|
106
109
|
rubriqueId: { default: () => [], type: Array as ()=> Array<number> },
|
|
107
110
|
rubriquageId:{ default: () => [], type: Array as ()=> Array<number> },
|
|
108
111
|
noRubriquageId: { default: () => [], type: Array as ()=> Array<number> },
|
|
112
|
+
query: { default: undefined, type: String},
|
|
109
113
|
},
|
|
110
114
|
emits: ['update:isArrow'],
|
|
111
115
|
|
|
@@ -130,6 +134,9 @@ export default defineComponent({
|
|
|
130
134
|
sizeItem(): number {
|
|
131
135
|
return state.generalParameters.podcastItem ? (state.generalParameters.podcastItem as number): 13;
|
|
132
136
|
},
|
|
137
|
+
overflowScroll(): boolean {
|
|
138
|
+
return (state.emissionPage.overflowScroll as boolean);
|
|
139
|
+
},
|
|
133
140
|
filterOrga(): string {
|
|
134
141
|
return this.$store.state.filter.organisationId;
|
|
135
142
|
},
|
|
@@ -170,7 +177,7 @@ export default defineComponent({
|
|
|
170
177
|
return this.direction > 0 ? 'out-left' : 'out-right';
|
|
171
178
|
},
|
|
172
179
|
watchVariable():string{
|
|
173
|
-
return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}`;
|
|
180
|
+
return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}|${this.query}`;
|
|
174
181
|
}
|
|
175
182
|
},
|
|
176
183
|
watch: {
|
|
@@ -210,6 +217,7 @@ export default defineComponent({
|
|
|
210
217
|
rubriquageId: this.rubriquageId.length ?this.rubriquageId : undefined,
|
|
211
218
|
noRubriquageId: this.noRubriquageId.length ? this.noRubriquageId : undefined,
|
|
212
219
|
sort: this.popularSort ? 'POPULARITY' : 'DATE',
|
|
220
|
+
query: this.query,
|
|
213
221
|
});
|
|
214
222
|
this.loading = false;
|
|
215
223
|
this.loaded = true;
|
|
@@ -247,6 +255,10 @@ export default defineComponent({
|
|
|
247
255
|
},
|
|
248
256
|
handleResize(): void {
|
|
249
257
|
if (!this.$el) return;
|
|
258
|
+
if (this.overflowScroll) {
|
|
259
|
+
this.size = 20;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
250
262
|
if (window.innerWidth <= PHONE_WIDTH) {
|
|
251
263
|
this.size = 10;
|
|
252
264
|
return;
|
|
@@ -48,14 +48,14 @@ export default defineComponent({
|
|
|
48
48
|
return (state.emissionsPage.progressBar as boolean);
|
|
49
49
|
},
|
|
50
50
|
percentProgress(): number{
|
|
51
|
-
if(this.podcast !== this.$store.state.player.podcast){
|
|
51
|
+
if(!this.$store.state.player.podcast || this.podcast.podcastId !== this.$store.state.player.podcast.podcastId){
|
|
52
52
|
return 0;
|
|
53
53
|
}
|
|
54
54
|
if(!this.$store.state.player.elapsed){return 0;}
|
|
55
55
|
return this.$store.state.player.elapsed * 100;
|
|
56
56
|
},
|
|
57
57
|
playedTime(): string{
|
|
58
|
-
if(this.podcast === this.$store.state.player.podcast){
|
|
58
|
+
if(this.$store.state.player.podcast && this.podcast.podcastId === this.$store.state.player.podcast.podcastId){
|
|
59
59
|
if (this.$store.state.player.elapsed && this.$store.state.player.elapsed > 0 && this.$store.state.player.total && this.$store.state.player.total > 0) {
|
|
60
60
|
return DurationHelper.formatDuration(
|
|
61
61
|
Math.round(this.$store.state.player.elapsed * this.$store.state.player.total)
|
|
@@ -70,7 +70,7 @@ export default defineComponent({
|
|
|
70
70
|
},
|
|
71
71
|
methods: {
|
|
72
72
|
seekTo(event: MouseEvent): void {
|
|
73
|
-
if(this.podcast!== this.$store.state.player.podcast){return;}
|
|
73
|
+
if(!this.$store.state.player.podcast || this.podcast.podcastId !== this.$store.state.player.podcast.podcastId){return;}
|
|
74
74
|
const rect = (event.currentTarget as Element).getBoundingClientRect();
|
|
75
75
|
const barWidth = (event.currentTarget as Element).clientWidth;
|
|
76
76
|
const x = event.clientX - rect.left;
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
class="d-flex align-items-center flex-grow-1 px-5"
|
|
29
29
|
>
|
|
30
30
|
<audio
|
|
31
|
-
v-if="!live"
|
|
32
31
|
id="audio-player"
|
|
33
32
|
:src="!live? audioUrl: undefined"
|
|
34
33
|
autoplay
|
|
@@ -194,6 +193,9 @@ export default defineComponent({
|
|
|
194
193
|
commentsLoaded(): void {
|
|
195
194
|
this.initComments(true);
|
|
196
195
|
},
|
|
196
|
+
audioUrl(): void{
|
|
197
|
+
this.playerError = false;
|
|
198
|
+
}
|
|
197
199
|
},
|
|
198
200
|
|
|
199
201
|
mounted() {
|
|
@@ -342,47 +344,49 @@ export default defineComponent({
|
|
|
342
344
|
this.listenTime = 0;
|
|
343
345
|
},
|
|
344
346
|
async initHls(hlsStreamUrl: string): Promise<void> {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (!Hls.isSupported()) {
|
|
355
|
-
throw 'Hls is not supported ! ';
|
|
356
|
-
}
|
|
357
|
-
const hls = new Hls();
|
|
358
|
-
hls.on(Hls.Events.MANIFEST_PARSED, async () => {
|
|
359
|
-
if(!this.live){ return; }
|
|
360
|
-
let downloadId = null;
|
|
361
|
-
try {
|
|
362
|
-
downloadId = await octopusApi.requestLiveDownloadId(
|
|
363
|
-
this.live.livePodcastId
|
|
364
|
-
);
|
|
365
|
-
await octopusApi.markPlayingLive(
|
|
366
|
-
this.live.livePodcastId,
|
|
367
|
-
downloadId,
|
|
368
|
-
'octopus',
|
|
369
|
-
this.$store.state.authentication.organisationId
|
|
370
|
-
);
|
|
371
|
-
this.setDownloadId(downloadId);
|
|
372
|
-
} catch (error) {
|
|
373
|
-
console.log('ERROR downloadId');
|
|
347
|
+
return new Promise<void>(async(resolve, reject) => {
|
|
348
|
+
if(null === Hls){
|
|
349
|
+
//TODO -> Version light min quand ce sera possible
|
|
350
|
+
await import('hls.js/dist/hls.js').then((hlsLibrary) => {
|
|
351
|
+
Hls = hlsLibrary.default;
|
|
352
|
+
})
|
|
353
|
+
await import('hls.js').then((hlsLibrary) => {
|
|
354
|
+
Hls = hlsLibrary.default;
|
|
355
|
+
})
|
|
374
356
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
357
|
+
if (!Hls.isSupported()) {
|
|
358
|
+
reject('Hls is not supported ! ');
|
|
359
|
+
}
|
|
360
|
+
const hls = new Hls();
|
|
361
|
+
hls.on(Hls.Events.MANIFEST_PARSED, async () => {
|
|
362
|
+
if(!this.live){ return; }
|
|
363
|
+
let downloadId = null;
|
|
364
|
+
try {
|
|
365
|
+
downloadId = await octopusApi.requestLiveDownloadId(
|
|
366
|
+
this.live.livePodcastId
|
|
367
|
+
);
|
|
368
|
+
await octopusApi.markPlayingLive(
|
|
369
|
+
this.live.livePodcastId,
|
|
370
|
+
downloadId,
|
|
371
|
+
'octopus',
|
|
372
|
+
this.$store.state.authentication.organisationId
|
|
373
|
+
);
|
|
374
|
+
this.setDownloadId(downloadId);
|
|
375
|
+
} catch (error) {
|
|
376
|
+
console.log('ERROR downloadId');
|
|
377
|
+
}
|
|
378
|
+
this.hlsReady = true;
|
|
379
|
+
const audio: HTMLElement|null = document.getElementById('audio-player');
|
|
380
|
+
hls.attachMedia((audio as HTMLAudioElement));
|
|
381
|
+
await (audio as HTMLAudioElement).play();
|
|
382
|
+
this.onPlay();
|
|
383
|
+
resolve();
|
|
384
|
+
});
|
|
385
|
+
hls.on(Hls.Events.ERROR, async() => {
|
|
386
|
+
reject('There is an error while reading media content');
|
|
387
|
+
});
|
|
388
|
+
hls.loadSource(hlsStreamUrl);
|
|
384
389
|
});
|
|
385
|
-
hls.loadSource(hlsStreamUrl);
|
|
386
390
|
},
|
|
387
391
|
async playLive(): Promise<void> {
|
|
388
392
|
if (!this.live) return;
|
|
@@ -70,25 +70,27 @@
|
|
|
70
70
|
:emission-id="emissionId"
|
|
71
71
|
/>
|
|
72
72
|
</div>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
73
|
+
<template v-if="isDisplayPodcasts">
|
|
74
|
+
<LiveHorizontalList
|
|
75
|
+
v-if="!isPodcastmaker"
|
|
76
|
+
:emission-id="emissionId"
|
|
77
|
+
/>
|
|
78
|
+
<PodcastFilterList
|
|
79
|
+
v-if="!isOuestFrance"
|
|
80
|
+
:emission-id="emissionId"
|
|
81
|
+
:category-filter="false"
|
|
82
|
+
:edit-right="editRight"
|
|
83
|
+
:productor-id="emission.orga.id"
|
|
84
|
+
@fetch="fetch"
|
|
85
|
+
/>
|
|
86
|
+
<PodcastList
|
|
87
|
+
v-else
|
|
88
|
+
:first="0"
|
|
89
|
+
:size="15"
|
|
90
|
+
:emission-id="emissionId"
|
|
91
|
+
@fetch="fetch"
|
|
92
|
+
/>
|
|
93
|
+
</template>
|
|
92
94
|
</div>
|
|
93
95
|
<ClassicLoading
|
|
94
96
|
:loading-text="!loaded?$t('Loading content ...'):undefined"
|
|
@@ -172,6 +174,9 @@ export default defineComponent({
|
|
|
172
174
|
isRssButton(): boolean {
|
|
173
175
|
return (state.emissionPage.rssButton as boolean);
|
|
174
176
|
},
|
|
177
|
+
isDisplayPodcasts(): boolean {
|
|
178
|
+
return (state.emissionPage.isDisplayPodcasts as boolean);
|
|
179
|
+
},
|
|
175
180
|
isPodcastmaker(): boolean {
|
|
176
181
|
return (state.generalParameters.podcastmaker as boolean);
|
|
177
182
|
},
|
package/src/store/paramStore.ts
CHANGED
|
@@ -55,6 +55,8 @@ const state:paramStore = {
|
|
|
55
55
|
emissionPage: {
|
|
56
56
|
ouestFranceStyle: false,
|
|
57
57
|
rssButton: false,
|
|
58
|
+
isDisplayPodcasts:true,
|
|
59
|
+
overflowScroll:false
|
|
58
60
|
},
|
|
59
61
|
intervenantPage: {
|
|
60
62
|
lightStyle: false,
|
|
@@ -142,6 +144,8 @@ export interface EmissionsPage{
|
|
|
142
144
|
export interface EmissionPage{
|
|
143
145
|
ouestFranceStyle?: boolean,
|
|
144
146
|
rssButton?: boolean,
|
|
147
|
+
isDisplayPodcasts?:boolean,
|
|
148
|
+
overflowScroll?: boolean,
|
|
145
149
|
}
|
|
146
150
|
export interface IntervenantPage{
|
|
147
151
|
lightStyle?: boolean,
|