@saooti/octopus-sdk 36.0.8 → 36.0.10
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 +1 -1
- package/src/assets/bootstrap.scss +6 -0
- package/src/components/display/live/LiveItem.vue +35 -33
- package/src/components/display/podcasts/PodcastImage.vue +2 -2
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +17 -11
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +13 -7
- package/src/components/misc/ProgressBar.vue +56 -0
- package/src/components/misc/player/Player.vue +7 -1
- package/src/components/misc/player/PlayerCompact.vue +1 -0
- package/src/sass/_variables.scss +1 -1
- package/src/stores/class/general/media.ts +17 -3
package/package.json
CHANGED
|
@@ -240,6 +240,9 @@
|
|
|
240
240
|
.bg-secondary{
|
|
241
241
|
background: #eee !important;
|
|
242
242
|
}
|
|
243
|
+
.bg-complementary{
|
|
244
|
+
background: $octopus-complementary-color !important;
|
|
245
|
+
}
|
|
243
246
|
.w-50-responsive{
|
|
244
247
|
display: flex;
|
|
245
248
|
align-items: center;
|
|
@@ -250,6 +253,9 @@
|
|
|
250
253
|
padding: 0 !important;
|
|
251
254
|
}
|
|
252
255
|
}
|
|
256
|
+
.font-italic{
|
|
257
|
+
font-style: italic;
|
|
258
|
+
}
|
|
253
259
|
}
|
|
254
260
|
|
|
255
261
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="live"
|
|
4
|
-
class="d-flex w-100"
|
|
4
|
+
class="d-flex-column live-item-container w-100"
|
|
5
5
|
>
|
|
6
6
|
<router-link
|
|
7
7
|
class="live-date-box"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}"
|
|
30
30
|
>
|
|
31
31
|
<PodcastImage
|
|
32
|
-
class="me-3"
|
|
32
|
+
class="me-3 flex-shrink-0"
|
|
33
33
|
:podcast="live"
|
|
34
34
|
:hide-play="false"
|
|
35
35
|
:playing-podcast="false"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
:is-animator-live="organisationRight"
|
|
38
38
|
/>
|
|
39
39
|
</router-link>
|
|
40
|
-
<div class="d-flex flex-column
|
|
40
|
+
<div class="d-flex flex-column">
|
|
41
41
|
<router-link
|
|
42
42
|
class="text-uppercase fw-bold text-truncate"
|
|
43
43
|
:to="{
|
|
@@ -246,36 +246,38 @@ export default defineComponent({
|
|
|
246
246
|
|
|
247
247
|
<style lang="scss">
|
|
248
248
|
.octopus-app{
|
|
249
|
-
.live-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
249
|
+
.live-item-container{
|
|
250
|
+
@media (max-width: 960px) {
|
|
251
|
+
align-items: center;
|
|
252
|
+
justify-content: center;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
.live-date-box {
|
|
256
|
+
width: 200px;
|
|
257
|
+
display: flex;
|
|
258
|
+
flex-shrink: 0;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
}
|
|
261
|
+
.font-size-smaller {
|
|
262
|
+
font-size: smaller;
|
|
263
|
+
}
|
|
264
|
+
.live-description-container {
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
margin-top: 0.5em;
|
|
267
|
+
word-break: break-word;
|
|
268
|
+
max-height: 6rem;
|
|
269
|
+
position: relative;
|
|
270
|
+
&.after-live-description:after {
|
|
271
|
+
content: '...';
|
|
272
|
+
position: absolute;
|
|
273
|
+
padding-left: 1rem;
|
|
274
|
+
right: 0;
|
|
275
|
+
bottom: 0;
|
|
276
|
+
width: 100%;
|
|
277
|
+
font-size: 1rem;
|
|
278
|
+
font-weight: bolder;
|
|
279
|
+
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f3f3f3 40%);
|
|
280
|
+
}
|
|
274
281
|
}
|
|
275
|
-
}
|
|
276
|
-
.live-special-width {
|
|
277
|
-
width: 0;
|
|
278
|
-
flex-grow: 1;
|
|
279
|
-
}
|
|
280
282
|
}
|
|
281
283
|
</style>
|
|
@@ -156,19 +156,25 @@ export default defineComponent({
|
|
|
156
156
|
},
|
|
157
157
|
methods: {
|
|
158
158
|
async fetchRecommendations(): Promise<void>{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
159
|
+
try {
|
|
160
|
+
const podcastIdsArray = await octopusApi.fetchDataPublicWithParams<Array<number>>(13, 'get_predicts',{
|
|
161
|
+
reco: this.podcastId,
|
|
162
|
+
n_neightbors: 5,
|
|
163
|
+
});
|
|
164
|
+
for (let podcastIdReco of podcastIdsArray) {
|
|
165
|
+
try {
|
|
166
|
+
const entirePodcast = await octopusApi.fetchData<Podcast>(0, 'podcast/'+podcastIdReco);
|
|
167
|
+
this.allPodcasts.push(entirePodcast);
|
|
168
|
+
} catch {
|
|
169
|
+
//If doesn't exist, do nothing
|
|
170
|
+
}
|
|
169
171
|
}
|
|
172
|
+
this.totalCount = podcastIdsArray.length;
|
|
173
|
+
this.loading = false;
|
|
174
|
+
} catch {
|
|
175
|
+
this.allPodcasts=[];
|
|
176
|
+
this.totalCount = 0;
|
|
170
177
|
}
|
|
171
|
-
this.totalCount = podcastIdsArray.length;
|
|
172
178
|
this.loading = false;
|
|
173
179
|
},
|
|
174
180
|
async fetchNext(): Promise<void> {
|
|
@@ -71,6 +71,7 @@ import { RouteLocationRaw } from 'vue-router';
|
|
|
71
71
|
import { useFilterStore } from '@/stores/FilterStore';
|
|
72
72
|
import { mapState, mapActions } from 'pinia';
|
|
73
73
|
import { Rubrique } from '@/stores/class/rubrique/rubrique';
|
|
74
|
+
import { Rubriquage } from '@/stores/class/rubrique/rubriquage';
|
|
74
75
|
export default defineComponent({
|
|
75
76
|
name: 'PodcastInlineListTemplate',
|
|
76
77
|
|
|
@@ -150,13 +151,18 @@ export default defineComponent({
|
|
|
150
151
|
nameRubrique: ''
|
|
151
152
|
};
|
|
152
153
|
if(this.filterRubriquage.length){
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
this.filterRubriquage.forEach((element:Rubriquage) => {
|
|
155
|
+
const rubriqueChosen = element.rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
|
|
156
|
+
if(rubriqueChosen){
|
|
157
|
+
filterToAdd = {
|
|
158
|
+
rubriquageId: element.rubriquageId??0,
|
|
159
|
+
rubriqueId: rubriqueChosenId,
|
|
160
|
+
nameRubriquage: element.title,
|
|
161
|
+
nameRubrique: rubriqueChosen.name
|
|
162
|
+
};
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
160
166
|
}
|
|
161
167
|
const newFilter: Array<RubriquageFilter> = Array.from(this.filterRubrique);
|
|
162
168
|
newFilter.push(filterToAdd);
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
aria-valuemax="100"
|
|
12
12
|
:style="'width: ' + secondaryProgress + '%'"
|
|
13
13
|
/>
|
|
14
|
+
<template v-if="playerMedia">
|
|
15
|
+
<div
|
|
16
|
+
v-if="mediaCueInPercent > 0"
|
|
17
|
+
class="octopus-progress-bar bg-complementary"
|
|
18
|
+
:style="{'width': + mediaCueInPercent + '%'}"
|
|
19
|
+
/>
|
|
20
|
+
<div
|
|
21
|
+
v-if="mediaCueOutPercent < 100"
|
|
22
|
+
class="octopus-progress-bar end-0 bg-complementary"
|
|
23
|
+
:style="{'width': + 100- mediaCueOutPercent + '%'}"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
14
26
|
<div
|
|
15
27
|
class="octopus-progress-bar bg-primary"
|
|
16
28
|
role="progressbar"
|
|
@@ -19,6 +31,18 @@
|
|
|
19
31
|
aria-valuemax="100"
|
|
20
32
|
:style="'width: ' + mainProgress + '%'"
|
|
21
33
|
/>
|
|
34
|
+
<template v-if="playerMedia">
|
|
35
|
+
<div
|
|
36
|
+
v-if="mediaCueInPercent > 0"
|
|
37
|
+
class="octopus-progress-bar octopus-progress-bar-duration bg-complementary"
|
|
38
|
+
:style="{'left': + mediaCueInPercent + '%'}"
|
|
39
|
+
/>
|
|
40
|
+
<div
|
|
41
|
+
v-if="mediaCueOutPercent < 100"
|
|
42
|
+
class="octopus-progress-bar end-0 octopus-progress-bar-duration bg-complementary"
|
|
43
|
+
:style="{'right': + 100- mediaCueOutPercent + '%'}"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
22
46
|
<div
|
|
23
47
|
v-if="alertBar"
|
|
24
48
|
class="octopus-progress-bar octopus-progress-bar-duration bg-danger"
|
|
@@ -33,6 +57,8 @@
|
|
|
33
57
|
</template>
|
|
34
58
|
|
|
35
59
|
<script lang="ts">
|
|
60
|
+
import { usePlayerStore } from '@/stores/PlayerStore';
|
|
61
|
+
import { mapState } from 'pinia';
|
|
36
62
|
import { defineComponent } from 'vue';
|
|
37
63
|
export default defineComponent({
|
|
38
64
|
name: 'ProgressBar',
|
|
@@ -42,6 +68,33 @@ export default defineComponent({
|
|
|
42
68
|
secondaryProgress: { default: 0, type: Number},
|
|
43
69
|
isProgressCursor: { default: false, type: Boolean},
|
|
44
70
|
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
mediaCueInPercent: 0 as number,
|
|
74
|
+
mediaCueOutPercent: 100 as number,
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
computed:{
|
|
78
|
+
...mapState(usePlayerStore, ['playerMedia']),
|
|
79
|
+
},
|
|
80
|
+
watch:{
|
|
81
|
+
playerMedia: {
|
|
82
|
+
deep: true,
|
|
83
|
+
immediate:true,
|
|
84
|
+
handler(){
|
|
85
|
+
if(this.playerMedia){
|
|
86
|
+
this.mediaCueInPercent = this.timeMediaToPercent(this.playerMedia.cueIn??0);
|
|
87
|
+
this.mediaCueOutPercent = this.timeMediaToPercent(this.playerMedia.cueOut??null);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
methods:{
|
|
93
|
+
timeMediaToPercent(value: number|null):number{
|
|
94
|
+
if(null===value || !this.playerMedia){return 100;}
|
|
95
|
+
return (value*100)/(this.playerMedia?.duration??1);
|
|
96
|
+
},
|
|
97
|
+
}
|
|
45
98
|
})
|
|
46
99
|
</script>
|
|
47
100
|
|
|
@@ -91,6 +144,9 @@ export default defineComponent({
|
|
|
91
144
|
align-self: center;
|
|
92
145
|
position: absolute;
|
|
93
146
|
}
|
|
147
|
+
.end-0{
|
|
148
|
+
right: 0;
|
|
149
|
+
}
|
|
94
150
|
}
|
|
95
151
|
}
|
|
96
152
|
</style>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
@durationChange="onTimeUpdate"
|
|
16
16
|
@error="onError"
|
|
17
17
|
@seeked="onSeeked"
|
|
18
|
+
@pause="onPause"
|
|
18
19
|
/>
|
|
19
20
|
<PlayerCompact
|
|
20
21
|
v-if="!playerLargeVersion"
|
|
@@ -93,13 +94,18 @@ export default defineComponent({
|
|
|
93
94
|
},
|
|
94
95
|
|
|
95
96
|
methods: {
|
|
96
|
-
...mapActions(usePlayerStore, ['playerPlay', 'playerUpdateLargeVersion']),
|
|
97
|
+
...mapActions(usePlayerStore, ['playerPlay', 'playerUpdateLargeVersion', 'playerChangeStatus']),
|
|
97
98
|
onHidden(): void {
|
|
98
99
|
if (this.forceHide) {
|
|
99
100
|
this.playerPlay();
|
|
100
101
|
this.forceHide = false;
|
|
101
102
|
}
|
|
102
103
|
},
|
|
104
|
+
onPause(){
|
|
105
|
+
if("PLAYING"===this.playerStatus){
|
|
106
|
+
this.playerChangeStatus(true);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
103
109
|
},
|
|
104
110
|
})
|
|
105
111
|
</script>
|
package/src/sass/_variables.scss
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export interface Media {
|
|
2
2
|
mediaId: number;
|
|
3
|
-
|
|
4
|
-
organisationId: string;
|
|
3
|
+
organisationId?: string;
|
|
5
4
|
title: string;
|
|
6
5
|
year?: string;
|
|
7
6
|
type?: string;
|
|
@@ -9,6 +8,21 @@ export interface Media {
|
|
|
9
8
|
album?: string;
|
|
10
9
|
creation?: string;
|
|
11
10
|
duration?: number;
|
|
11
|
+
contentType?: string;
|
|
12
12
|
filePath?: string;
|
|
13
13
|
audioUrl?: string;
|
|
14
|
-
|
|
14
|
+
cueIn?: number;
|
|
15
|
+
cueOut?: number;
|
|
16
|
+
bpm?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function emptyMediaData(): Media{
|
|
20
|
+
return {
|
|
21
|
+
mediaId: 0,
|
|
22
|
+
album: '',
|
|
23
|
+
artiste: '',
|
|
24
|
+
title: '',
|
|
25
|
+
type: '',
|
|
26
|
+
year: '',
|
|
27
|
+
}
|
|
28
|
+
}
|