@saooti/octopus-sdk 30.0.43 → 30.0.44
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 -1
- package/package.json +1 -1
- package/src/components/display/emission/EmissionPlayerItem.vue +97 -20
- package/src/components/misc/Player.vue +10 -0
- package/src/store/AppStore.ts +3 -0
- package/src/store/class/general/player.ts +1 -0
- package/src/store/paramStore.ts +2 -0
- package/src/store/typeAppStore.ts +1 -0
package/README.md
CHANGED
|
@@ -539,4 +539,5 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
|
539
539
|
* 30.0.39 Listes inline taille item
|
|
540
540
|
* 30.0.41 Inline list arrow
|
|
541
541
|
* 30.0.42 Resize rubriqueList
|
|
542
|
-
* 30.0.43 Resize rubriqueList
|
|
542
|
+
* 30.0.43 Resize rubriqueList
|
|
543
|
+
* 30.0.44 ProgressBar pour le soir
|
package/package.json
CHANGED
|
@@ -53,29 +53,61 @@
|
|
|
53
53
|
class="border-top emission-item-border-color p-2 secondary-bg d-flex"
|
|
54
54
|
>
|
|
55
55
|
<div class="d-flex justify-content-between flex-grow-1">
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<div class="fw-bold text-truncate">
|
|
65
|
-
{{ p.title }}
|
|
66
|
-
</div>
|
|
67
|
-
<div
|
|
68
|
-
:id="'description-podcast-container-' + p.podcastId"
|
|
69
|
-
class="emission-description html-wysiwyg-content"
|
|
56
|
+
<div class="d-flex flex-column">
|
|
57
|
+
<router-link
|
|
58
|
+
:to="{
|
|
59
|
+
name: 'podcast',
|
|
60
|
+
params: { podcastId: p.podcastId },
|
|
61
|
+
query: { productor: $store.state.filter.organisationId },
|
|
62
|
+
}"
|
|
63
|
+
class="d-flex flex-column define-width text-dark"
|
|
70
64
|
>
|
|
71
|
-
|
|
65
|
+
<div class="fw-bold text-truncate">
|
|
66
|
+
{{ p.title }}
|
|
67
|
+
</div>
|
|
72
68
|
<div
|
|
73
|
-
:id="'description-podcast-' + p.podcastId"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
:id="'description-podcast-container-' + p.podcastId"
|
|
70
|
+
class="emission-description html-wysiwyg-content"
|
|
71
|
+
>
|
|
72
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
73
|
+
<div
|
|
74
|
+
:id="'description-podcast-' + p.podcastId"
|
|
75
|
+
v-html="urlify(p.description)"
|
|
76
|
+
/>
|
|
77
|
+
<!-- eslint-enable -->
|
|
78
|
+
</div>
|
|
79
|
+
</router-link>
|
|
80
|
+
<div
|
|
81
|
+
v-if="isProgressBar"
|
|
82
|
+
class="d-flex align-items-center"
|
|
83
|
+
>
|
|
84
|
+
<div class="me-2">
|
|
85
|
+
{{ playedTime(p) }}
|
|
86
|
+
</div>
|
|
87
|
+
<div class="position-relative flex-grow-1">
|
|
88
|
+
<div
|
|
89
|
+
class="progress flex-grow-1 c-hand"
|
|
90
|
+
@mouseup="seekTo($event, p)"
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
class="progress-bar primary-bg"
|
|
94
|
+
role="progressbar"
|
|
95
|
+
aria-valuenow="0"
|
|
96
|
+
aria-valuemin="0"
|
|
97
|
+
aria-valuemax="100"
|
|
98
|
+
:style="'width: ' + percentProgress(p) + '%'"
|
|
99
|
+
/>
|
|
100
|
+
<div
|
|
101
|
+
class="progress-bar-cursor"
|
|
102
|
+
:style="'left:' + percentProgress(p) + '%'"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="ms-2">
|
|
107
|
+
{{ totalTime(p) }}
|
|
108
|
+
</div>
|
|
77
109
|
</div>
|
|
78
|
-
</
|
|
110
|
+
</div>
|
|
79
111
|
<div
|
|
80
112
|
v-if="
|
|
81
113
|
$store.state.player.podcast !== p ||
|
|
@@ -125,6 +157,7 @@ import octopusApi from '@saooti/octopus-api';
|
|
|
125
157
|
import { Emission } from '@/store/class/general/emission';
|
|
126
158
|
import { Podcast } from '@/store/class/general/podcast';
|
|
127
159
|
import { state } from '../../../store/paramStore';
|
|
160
|
+
import DurationHelper from '../../../helper/duration';
|
|
128
161
|
import { displayMethods } from '../../mixins/functions';
|
|
129
162
|
import { defineComponent } from 'vue'
|
|
130
163
|
export default defineComponent({
|
|
@@ -157,6 +190,9 @@ export default defineComponent({
|
|
|
157
190
|
organisationId(): string|undefined {
|
|
158
191
|
return state.generalParameters.organisationId;
|
|
159
192
|
},
|
|
193
|
+
isProgressBar(){
|
|
194
|
+
return (state.emissionsPage.progressBar as boolean);
|
|
195
|
+
},
|
|
160
196
|
editRight(): boolean {
|
|
161
197
|
if (
|
|
162
198
|
(this.authenticated && this.organisationId === this.emission.orga.id) ||
|
|
@@ -185,6 +221,36 @@ export default defineComponent({
|
|
|
185
221
|
}
|
|
186
222
|
},
|
|
187
223
|
methods: {
|
|
224
|
+
seekTo(event: MouseEvent, podcast: Podcast): void {
|
|
225
|
+
if(podcast!== this.$store.state.player.podcast){return;}
|
|
226
|
+
const rect = (event.currentTarget as Element).getBoundingClientRect();
|
|
227
|
+
const barWidth = (event.currentTarget as Element).clientWidth;
|
|
228
|
+
const x = event.clientX - rect.left;
|
|
229
|
+
const percentPosition = x / barWidth;
|
|
230
|
+
if (percentPosition * 100 >= this.percentLiveProgress) return;
|
|
231
|
+
const seekTime = this.$store.state.player.total * percentPosition;
|
|
232
|
+
this.$store.commit("playerSeekTime", seekTime);
|
|
233
|
+
},
|
|
234
|
+
percentProgress(podcast: Podcast): number{
|
|
235
|
+
if(podcast !== this.$store.state.player.podcast){
|
|
236
|
+
return 0;
|
|
237
|
+
}
|
|
238
|
+
if(!this.$store.state.player.elapsed){return 0;}
|
|
239
|
+
return this.$store.state.player.elapsed * 100;
|
|
240
|
+
},
|
|
241
|
+
playedTime(podcast: Podcast): string{
|
|
242
|
+
if(podcast === this.$store.state.player.podcast){
|
|
243
|
+
if (this.$store.state.player.elapsed && this.$store.state.player.elapsed > 0 && this.$store.state.player.total && this.$store.state.player.total > 0) {
|
|
244
|
+
return DurationHelper.formatDuration(
|
|
245
|
+
Math.round(this.$store.state.player.elapsed * this.$store.state.player.total)
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return '00:00';
|
|
250
|
+
},
|
|
251
|
+
totalTime(podcast: Podcast): string {
|
|
252
|
+
return DurationHelper.formatDuration(Math.round(podcast.duration/1000));
|
|
253
|
+
},
|
|
188
254
|
async loadPodcasts(): Promise<void> {
|
|
189
255
|
const nb = this.nbPodcasts ? this.nbPodcasts : 2;
|
|
190
256
|
const data = await octopusApi.fetchPodcasts({
|
|
@@ -238,6 +304,17 @@ export default defineComponent({
|
|
|
238
304
|
height: min-content;
|
|
239
305
|
border-radius: 0.8rem;
|
|
240
306
|
overflow: hidden;
|
|
307
|
+
.progress{
|
|
308
|
+
height: 6px;
|
|
309
|
+
}
|
|
310
|
+
.progress-bar-cursor{
|
|
311
|
+
width: 10px;
|
|
312
|
+
height: 10px;
|
|
313
|
+
border-radius: 50%;
|
|
314
|
+
background: black;
|
|
315
|
+
align-self: center;
|
|
316
|
+
position: absolute;
|
|
317
|
+
}
|
|
241
318
|
.emission-item-border-color {
|
|
242
319
|
border-color: #ddd;
|
|
243
320
|
}
|
|
@@ -123,6 +123,7 @@ export default defineComponent({
|
|
|
123
123
|
if(!state.player.elapsed){return 0;}
|
|
124
124
|
return state.player.elapsed * 100;
|
|
125
125
|
},
|
|
126
|
+
playerSeekTime: (state: StoreState) => state.player.seekTime,
|
|
126
127
|
}),
|
|
127
128
|
audioUrl(): string {
|
|
128
129
|
if (this.media) return this.media.audioUrl? this.media.audioUrl:"";
|
|
@@ -150,6 +151,15 @@ export default defineComponent({
|
|
|
150
151
|
},
|
|
151
152
|
|
|
152
153
|
watch: {
|
|
154
|
+
playerSeekTime(){
|
|
155
|
+
if(!this.playerSeekTime){return;}
|
|
156
|
+
if (this.$store.state.player.podcast || this.$store.state.player.live) {
|
|
157
|
+
this.notListenTime = this.playerSeekTime - this.listenTime;
|
|
158
|
+
}
|
|
159
|
+
const audioPlayer: HTMLAudioElement | null = document.querySelector('#audio-player');
|
|
160
|
+
if (!audioPlayer) return;
|
|
161
|
+
audioPlayer.currentTime = this.playerSeekTime;
|
|
162
|
+
},
|
|
153
163
|
live: {
|
|
154
164
|
deep: true,
|
|
155
165
|
async handler(){
|
package/src/store/AppStore.ts
CHANGED
|
@@ -77,6 +77,9 @@ export default createStore({
|
|
|
77
77
|
playerVolume(state, volume) {
|
|
78
78
|
state.player.volume = volume;
|
|
79
79
|
},
|
|
80
|
+
playerSeekTime(state, seekTime) {
|
|
81
|
+
state.player.seekTime = seekTime;
|
|
82
|
+
},
|
|
80
83
|
|
|
81
84
|
filterOrga(state, filter) {
|
|
82
85
|
state.filter.organisationId = filter.orgaId;
|
package/src/store/paramStore.ts
CHANGED
|
@@ -50,6 +50,7 @@ const state:paramStore = {
|
|
|
50
50
|
buttonMore: false,
|
|
51
51
|
overflowScroll: false,
|
|
52
52
|
titleInImage: false,
|
|
53
|
+
progressBar:false
|
|
53
54
|
},
|
|
54
55
|
emissionPage: {
|
|
55
56
|
ouestFranceStyle: false,
|
|
@@ -136,6 +137,7 @@ export interface EmissionsPage{
|
|
|
136
137
|
buttonMore?: boolean,
|
|
137
138
|
overflowScroll?: boolean,
|
|
138
139
|
titleInImage?: boolean,
|
|
140
|
+
progressBar?:boolean
|
|
139
141
|
}
|
|
140
142
|
export interface EmissionPage{
|
|
141
143
|
ouestFranceStyle?: boolean,
|