@saooti/octopus-sdk 35.1.7 → 35.2.1
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 +3 -3
- package/src/App.vue +21 -12
- package/src/api/classicCrud.ts +6 -7
- package/src/components/display/categories/CategoryChooser.vue +5 -3
- package/src/components/display/categories/CategoryFilter.vue +25 -28
- package/src/components/display/categories/CategoryList.vue +19 -18
- package/src/components/display/comments/AddCommentModal.vue +5 -2
- package/src/components/display/comments/CommentBasicView.vue +1 -1
- package/src/components/display/comments/CommentInput.vue +17 -12
- package/src/components/display/comments/CommentItem.vue +10 -6
- package/src/components/display/comments/CommentList.vue +5 -5
- package/src/components/display/comments/CommentParentInfo.vue +1 -1
- package/src/components/display/comments/CommentPlayer.vue +8 -5
- package/src/components/display/comments/CommentSection.vue +10 -7
- package/src/components/display/edit/EditBox.vue +1 -1
- package/src/components/display/edit/EditCommentBox.vue +1 -1
- package/src/components/display/emission/EmissionChooser.vue +1 -1
- package/src/components/display/emission/EmissionInlineList.vue +4 -4
- package/src/components/display/emission/EmissionItem.vue +5 -5
- package/src/components/display/emission/EmissionList.vue +9 -6
- package/src/components/display/emission/EmissionPlayerItem.vue +26 -20
- package/src/components/display/filter/AdvancedSearch.vue +3 -3
- package/src/components/display/filter/CategorySearchFilter.vue +11 -11
- package/src/components/display/filter/ProductorSearch.vue +13 -12
- package/src/components/display/filter/RubriqueChoice.vue +2 -2
- package/src/components/display/filter/RubriqueFilter.vue +15 -17
- package/src/components/display/list/ListPaginate.vue +1 -1
- package/src/components/display/live/LiveHorizontalList.vue +1 -1
- package/src/components/display/live/LiveItem.vue +13 -11
- package/src/components/display/live/LiveList.vue +8 -8
- package/src/components/display/organisation/OrganisationChooser.vue +6 -4
- package/src/components/display/organisation/OrganisationChooserLight.vue +1 -1
- package/src/components/display/participant/ParticipantItem.vue +5 -5
- package/src/components/display/participant/ParticipantList.vue +5 -2
- package/src/components/display/playlist/PlaylistItem.vue +7 -4
- package/src/components/display/playlist/PlaylistList.vue +6 -4
- package/src/components/display/playlist/PodcastList.vue +3 -3
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +3 -3
- package/src/components/display/podcasts/AnimatorsItem.vue +6 -3
- package/src/components/display/podcasts/ParticipantDescription.vue +6 -3
- package/src/components/display/podcasts/PodcastFilterList.vue +2 -2
- package/src/components/display/podcasts/PodcastImage.vue +17 -21
- package/src/components/display/podcasts/PodcastInlineList.vue +1 -1
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +7 -7
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +17 -13
- package/src/components/display/podcasts/PodcastItem.vue +2 -2
- package/src/components/display/podcasts/PodcastItemInfo.vue +4 -4
- package/src/components/display/podcasts/PodcastList.vue +10 -5
- package/src/components/display/podcasts/PodcastModuleBox.vue +5 -5
- package/src/components/display/podcasts/PodcastPlayBar.vue +12 -11
- package/src/components/display/podcasts/PodcastSwiperList.vue +7 -7
- package/src/components/display/rubriques/RubriqueChooser.vue +1 -1
- package/src/components/display/rubriques/RubriqueList.vue +16 -18
- package/src/components/display/sharing/QrCode.vue +10 -6
- package/src/components/display/sharing/ShareButtons.vue +4 -4
- package/src/components/display/sharing/ShareButtonsIntern.vue +4 -4
- package/src/components/display/sharing/ShareDistribution.vue +2 -2
- package/src/components/display/sharing/SharePlayer.vue +9 -6
- package/src/components/display/sharing/SharePlayerTypes.vue +6 -6
- package/src/components/display/sharing/SubscribeButtons.vue +1 -1
- package/src/components/misc/Footer.vue +21 -14
- package/src/components/misc/HomeDropdown.vue +7 -4
- package/src/components/misc/LeftMenu.vue +21 -22
- package/src/components/misc/TopBar.vue +23 -26
- package/src/components/misc/modal/ClipboardModal.vue +2 -2
- package/src/components/misc/modal/NewsletterModal.vue +12 -9
- package/src/components/misc/modal/ShareModalPlayer.vue +1 -1
- package/src/components/misc/player/Player.vue +17 -15
- package/src/components/misc/player/PlayerCompact.vue +5 -5
- package/src/components/misc/player/PlayerLarge.vue +1 -1
- package/src/components/misc/player/PlayerProgressBar.vue +9 -9
- package/src/components/misc/player/PlayerTimeline.vue +2 -2
- package/src/components/mixins/handle403.ts +6 -1
- package/src/components/mixins/imageProxy.ts +1 -1
- package/src/components/mixins/init.ts +7 -4
- package/src/components/mixins/orgaComputed.ts +4 -4
- package/src/components/mixins/organisationFilter.ts +8 -5
- package/src/components/mixins/player/playerComment.ts +24 -33
- package/src/components/mixins/player/playerDisplay.ts +38 -67
- package/src/components/mixins/player/playerLive.ts +16 -15
- package/src/components/mixins/player/playerLogic.ts +54 -64
- package/src/components/mixins/player/playerTranscript.ts +16 -10
- package/src/components/pages/Category.vue +8 -10
- package/src/components/pages/Emission.vue +3 -3
- package/src/components/pages/Emissions.vue +10 -7
- package/src/components/pages/Error403Page.vue +5 -2
- package/src/components/pages/Home.vue +17 -12
- package/src/components/pages/Lives.vue +13 -11
- package/src/components/pages/PageNotFound.vue +11 -6
- package/src/components/pages/Participant.vue +3 -3
- package/src/components/pages/Participants.vue +2 -2
- package/src/components/pages/Playlist.vue +3 -3
- package/src/components/pages/Playlists.vue +2 -2
- package/src/components/pages/Podcast.vue +11 -8
- package/src/components/pages/Podcasts.vue +11 -9
- package/src/components/pages/Rubrique.vue +1 -1
- package/src/components/pages/Search.vue +1 -1
- package/src/main.ts +6 -4
- package/src/stores/ApiStore.ts +65 -0
- package/src/stores/AuthStore.ts +43 -0
- package/src/stores/CommentStore.ts +40 -0
- package/src/stores/FilterStore.ts +63 -0
- package/src/stores/GeneralStore.ts +40 -0
- package/src/stores/PlayerStore.ts +134 -0
- package/src/{store → stores}/class/general/playlist.ts +1 -1
- package/tsconfig.json +0 -1
- package/src/store/ApiStore.ts +0 -33
- package/src/store/AppStore.ts +0 -76
- package/src/store/PlayerStore.ts +0 -87
- package/src/store/classStore/typeApiStore.ts +0 -43
- package/src/store/classStore/typeAppStore.ts +0 -81
- package/src/store/classStore/typeAuthStore.ts +0 -44
- package/src/store/classStore/typePlayerStore.ts +0 -15
- package/src/vuex-shim.d.ts +0 -8
- /package/src/{store/paramStore.ts → stores/ParamSdkStore.ts} +0 -0
- /package/src/{store → stores}/class/adserver/adserverConfig.ts +0 -0
- /package/src/{store → stores}/class/adserver/adserverOtherEmission.ts +0 -0
- /package/src/{store → stores}/class/adserver/adserverTiming.ts +0 -0
- /package/src/{store → stores}/class/cartouchier/cartouche.ts +0 -0
- /package/src/{store → stores}/class/cartouchier/cartouchier.ts +0 -0
- /package/src/{store → stores}/class/conference/conference.ts +0 -0
- /package/src/{store → stores}/class/conference/conferenceMessage.ts +0 -0
- /package/src/{store → stores}/class/conference/conferenceParticipant.ts +0 -0
- /package/src/{store → stores}/class/conference/pad.ts +0 -0
- /package/src/{store → stores}/class/conference/studioCall.ts +0 -0
- /package/src/{store → stores}/class/contract/contract.ts +0 -0
- /package/src/{store → stores}/class/contract/contractOrganisation.ts +0 -0
- /package/src/{store → stores}/class/ftp/ftpEmission.ts +0 -0
- /package/src/{store → stores}/class/ftp/ftpParam.ts +0 -0
- /package/src/{store → stores}/class/ftp/testFtpEmission.ts +0 -0
- /package/src/{store → stores}/class/general/audioView.ts +0 -0
- /package/src/{store → stores}/class/general/category.ts +0 -0
- /package/src/{store → stores}/class/general/classicSelectType.ts +0 -0
- /package/src/{store → stores}/class/general/comment.ts +0 -0
- /package/src/{store → stores}/class/general/customPlayer.ts +0 -0
- /package/src/{store → stores}/class/general/emission.ts +0 -0
- /package/src/{store → stores}/class/general/fetchParam.ts +0 -0
- /package/src/{store → stores}/class/general/initState.ts +0 -0
- /package/src/{store → stores}/class/general/interfacePageable.ts +0 -0
- /package/src/{store → stores}/class/general/ituneCategory.ts +0 -0
- /package/src/{store → stores}/class/general/listReturn.ts +0 -0
- /package/src/{store → stores}/class/general/media.ts +0 -0
- /package/src/{store → stores}/class/general/organisation.ts +0 -0
- /package/src/{store → stores}/class/general/pageable.ts +0 -0
- /package/src/{store → stores}/class/general/participant.ts +0 -0
- /package/src/{store → stores}/class/general/player.ts +0 -0
- /package/src/{store → stores}/class/general/podcast.ts +0 -0
- /package/src/{store → stores}/class/general/sortPageable.ts +0 -0
- /package/src/{store → stores}/class/general/soundcastCategory.ts +0 -0
- /package/src/{store → stores}/class/ouestFrance/ofTag.ts +0 -0
- /package/src/{store → stores}/class/ouestFrance/ofTagInfo.ts +0 -0
- /package/src/{store → stores}/class/ouestFrance/ofTagPage.ts +0 -0
- /package/src/{store → stores}/class/ouestFrance/ofTagSeo.ts +0 -0
- /package/src/{store → stores}/class/ouestFrance/ofTagVente.ts +0 -0
- /package/src/{store → stores}/class/ouestFrance/ofTagWithParents.ts +0 -0
- /package/src/{store → stores}/class/rss/aggregator.ts +0 -0
- /package/src/{store → stores}/class/rss/rssEmission.ts +0 -0
- /package/src/{store → stores}/class/rss/rssInfo.ts +0 -0
- /package/src/{store → stores}/class/rubrique/rubriquage.ts +0 -0
- /package/src/{store → stores}/class/rubrique/rubriquageFilter.ts +0 -0
- /package/src/{store → stores}/class/rubrique/rubrique.ts +0 -0
- /package/src/{store → stores}/class/stat/statArrayIncome.ts +0 -0
- /package/src/{store → stores}/class/stat/statArrayObject.ts +0 -0
- /package/src/{store → stores}/class/stat/statGraph.ts +0 -0
- /package/src/{store → stores}/class/user/person.ts +0 -0
- /package/src/{store → stores}/class/user/profile.ts +0 -0
- /package/src/{store → stores}/class/user/userKeycloak.ts +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import DurationHelper from '../../../helper/duration';
|
|
3
|
-
import { state } from '../../../store/paramStore';
|
|
1
|
+
import { state } from '../../../stores/ParamSdkStore';
|
|
4
2
|
import { defineComponent } from 'vue';
|
|
5
3
|
import { RouteLocationRaw } from 'vue-router';
|
|
6
|
-
import { MetadataRadio
|
|
4
|
+
import { MetadataRadio } from '@/stores/class/general/player';
|
|
5
|
+
import { usePlayerStore } from '@/stores/PlayerStore';
|
|
6
|
+
import { useFilterStore } from '@/stores/FilterStore';
|
|
7
|
+
import { mapState, mapActions } from 'pinia';
|
|
7
8
|
import octopusApi from '@saooti/octopus-api';
|
|
8
9
|
export const playerDisplay = defineComponent({
|
|
9
10
|
props: {
|
|
@@ -15,41 +16,30 @@ export const playerDisplay = defineComponent({
|
|
|
15
16
|
};
|
|
16
17
|
},
|
|
17
18
|
computed:{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
isPaused(): boolean {
|
|
35
|
-
return 'PAUSED' === this.$store.state.player.status;
|
|
36
|
-
},
|
|
37
|
-
podcast(): undefined|Podcast{
|
|
38
|
-
return this.$store.state.player.podcast;
|
|
39
|
-
},
|
|
19
|
+
...mapState(usePlayerStore, [
|
|
20
|
+
'playerPodcast',
|
|
21
|
+
'playerRadio',
|
|
22
|
+
'playerLive',
|
|
23
|
+
'playerMedia',
|
|
24
|
+
'playedTime',
|
|
25
|
+
'totalTime',
|
|
26
|
+
'isPlaying',
|
|
27
|
+
'isPaused',
|
|
28
|
+
'podcastImage',
|
|
29
|
+
'emissionName',
|
|
30
|
+
'transcriptText',
|
|
31
|
+
'radioUrl'
|
|
32
|
+
]),
|
|
33
|
+
...mapState(useFilterStore, ['filterOrgaId']),
|
|
40
34
|
isImage(): boolean {
|
|
41
35
|
return (state.player.image as boolean);
|
|
42
36
|
},
|
|
43
|
-
podcastImage(): string{
|
|
44
|
-
if (this.$store.state.player.podcast) return this.$store.state.player.podcast.imageUrl;
|
|
45
|
-
return '';
|
|
46
|
-
},
|
|
47
37
|
podcastShareUrl(): RouteLocationRaw|string {
|
|
48
|
-
if (this.
|
|
38
|
+
if (this.playerPodcast) {
|
|
49
39
|
return {
|
|
50
40
|
name: 'podcast',
|
|
51
|
-
params: { podcastId: this.
|
|
52
|
-
query: { productor: this
|
|
41
|
+
params: { podcastId: this.playerPodcast.podcastId.toString() },
|
|
42
|
+
query: { productor: this.filterOrgaId },
|
|
53
43
|
};
|
|
54
44
|
}
|
|
55
45
|
return '';
|
|
@@ -58,40 +48,30 @@ export const playerDisplay = defineComponent({
|
|
|
58
48
|
return (state.player.emissionName as boolean);
|
|
59
49
|
},
|
|
60
50
|
podcastTitle(): string {
|
|
61
|
-
if(this
|
|
62
|
-
return this
|
|
51
|
+
if(this.playerRadio){
|
|
52
|
+
return this.playerRadio.metadata.title + " " + this.playerRadio.metadata.artist;
|
|
63
53
|
}
|
|
64
|
-
if (this
|
|
54
|
+
if (this.playerPodcast) {
|
|
65
55
|
if (this.isEmissionName)
|
|
66
|
-
return this.emissionName + ' - ' + this
|
|
67
|
-
return this
|
|
56
|
+
return this.emissionName + ' - ' + this.playerPodcast.title;
|
|
57
|
+
return this.playerPodcast.title;
|
|
68
58
|
}
|
|
69
|
-
if (this
|
|
70
|
-
if (this
|
|
59
|
+
if (this.playerMedia) return this.playerMedia.title;
|
|
60
|
+
if (this.playerLive) {
|
|
71
61
|
if (!this.hlsReady)
|
|
72
|
-
return this
|
|
73
|
-
return this
|
|
62
|
+
return this.playerLive.title + ' (' + this.$t('Start in a while') + ')';
|
|
63
|
+
return this.playerLive.title;
|
|
74
64
|
}
|
|
75
65
|
return '';
|
|
76
66
|
},
|
|
77
|
-
emissionName(): string {
|
|
78
|
-
if (this.$store.state.player.podcast) return this.$store.state.player.podcast.emission.name;
|
|
79
|
-
return '';
|
|
80
|
-
},
|
|
81
|
-
transcriptText():string{
|
|
82
|
-
return this.$store.state.player.transcript?.actualText ?? "";
|
|
83
|
-
},
|
|
84
|
-
radio(): Radio{
|
|
85
|
-
return this.$store.state.player.radio?.url;
|
|
86
|
-
}
|
|
87
67
|
},
|
|
88
68
|
watch:{
|
|
89
|
-
|
|
69
|
+
playerRadio: {
|
|
90
70
|
deep: true,
|
|
91
71
|
immediate:true,
|
|
92
72
|
handler(){
|
|
93
73
|
clearInterval((this.radioInterval as unknown as number));
|
|
94
|
-
if(this.
|
|
74
|
+
if(this.playerRadio){
|
|
95
75
|
this.fetchRadioMetadata();
|
|
96
76
|
this.radioInterval = setInterval(() => {
|
|
97
77
|
this.fetchRadioMetadata();
|
|
@@ -108,9 +88,10 @@ export const playerDisplay = defineComponent({
|
|
|
108
88
|
clearInterval((this.radioInterval as unknown as number));
|
|
109
89
|
},
|
|
110
90
|
methods: {
|
|
91
|
+
...mapActions(usePlayerStore, ['playerMetadata', 'playerChangeStatus']),
|
|
111
92
|
async fetchRadioMetadata(): Promise<void>{
|
|
112
|
-
const metadata = await octopusApi.fetchData<MetadataRadio>(14, 'player/playing/'+this
|
|
113
|
-
this
|
|
93
|
+
const metadata = await octopusApi.fetchData<MetadataRadio>(14, 'player/playing/'+this.playerRadio?.canalId);
|
|
94
|
+
this.playerMetadata(metadata.currently);
|
|
114
95
|
},
|
|
115
96
|
addKeyboardControl(event: KeyboardEvent): void{
|
|
116
97
|
if(!event || null ===event){return;}
|
|
@@ -132,17 +113,7 @@ export const playerDisplay = defineComponent({
|
|
|
132
113
|
switchPausePlay(): void {
|
|
133
114
|
const audioPlayer: HTMLAudioElement|null = document.querySelector('#audio-player');
|
|
134
115
|
if(!audioPlayer){return;}
|
|
135
|
-
|
|
136
|
-
this.onPlay();
|
|
137
|
-
} else {
|
|
138
|
-
this.onPause();
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
onPlay(): void {
|
|
142
|
-
this.$store.commit('player/pause', false);
|
|
143
|
-
},
|
|
144
|
-
onPause(): void {
|
|
145
|
-
this.$store.commit('player/pause', true);
|
|
116
|
+
this.playerChangeStatus(!audioPlayer.paused);
|
|
146
117
|
},
|
|
147
118
|
}
|
|
148
119
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { state } from '../../../store/paramStore';
|
|
1
|
+
import { state } from '../../../stores/ParamSdkStore';
|
|
3
2
|
import octopusApi from '@saooti/octopus-api';
|
|
3
|
+
import { usePlayerStore } from '@/stores/PlayerStore';
|
|
4
|
+
import { useAuthStore } from '@/stores/AuthStore';
|
|
5
|
+
import { mapState, mapActions } from 'pinia';
|
|
4
6
|
/* eslint-disable */
|
|
5
7
|
let Hls:any = null;
|
|
6
8
|
/* eslint-enable */
|
|
7
9
|
import { defineComponent } from 'vue';
|
|
8
|
-
import { Player } from '@/store/class/general/player';
|
|
9
10
|
export const playerLive = defineComponent({
|
|
10
11
|
data() {
|
|
11
12
|
return {
|
|
@@ -19,21 +20,21 @@ export const playerLive = defineComponent({
|
|
|
19
20
|
};
|
|
20
21
|
},
|
|
21
22
|
computed: {
|
|
22
|
-
...mapState('
|
|
23
|
-
|
|
24
|
-
}),
|
|
23
|
+
...mapState(usePlayerStore, ['playerLive', 'playerRadio']),
|
|
24
|
+
...mapState(useAuthStore, ['authOrgaId'])
|
|
25
25
|
},
|
|
26
26
|
methods: {
|
|
27
|
+
...mapActions(usePlayerStore, ['playerChangeStatus']),
|
|
27
28
|
onPlay(): void {
|
|
28
|
-
this
|
|
29
|
+
this.playerChangeStatus(false);
|
|
29
30
|
},
|
|
30
31
|
playRadio(){
|
|
31
|
-
if (!this.
|
|
32
|
-
this.playHls(this.
|
|
32
|
+
if (!this.playerRadio) return;
|
|
33
|
+
this.playHls(this.playerRadio.url);
|
|
33
34
|
},
|
|
34
35
|
playLive() {
|
|
35
|
-
if (!this.
|
|
36
|
-
const hlsStreamUrl = `${state.podcastPage.hlsUri}stream/dev.${this.
|
|
36
|
+
if (!this.playerLive) return;
|
|
37
|
+
const hlsStreamUrl = `${state.podcastPage.hlsUri}stream/dev.${this.playerLive.conferenceId}/index.m3u8`;
|
|
37
38
|
this.playHls(hlsStreamUrl);
|
|
38
39
|
},
|
|
39
40
|
async playHls(hlsStreamUrl: string): Promise<void>{
|
|
@@ -60,14 +61,14 @@ export const playerLive = defineComponent({
|
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
async initLiveDownloadId(){
|
|
63
|
-
if(!this.
|
|
64
|
+
if(!this.playerLive){ return;}
|
|
64
65
|
let downloadId = null;
|
|
65
66
|
try {
|
|
66
|
-
downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.
|
|
67
|
-
await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' + this.
|
|
67
|
+
downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.playerLive.livePodcastId, undefined);
|
|
68
|
+
await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' + this.playerLive.livePodcastId+".m3u8",{
|
|
68
69
|
'downloadId': null!==downloadId ? downloadId : undefined,
|
|
69
70
|
'origin':'octopus',
|
|
70
|
-
'distributorId':this
|
|
71
|
+
'distributorId':this.authOrgaId
|
|
71
72
|
});
|
|
72
73
|
this.setDownloadId(downloadId);
|
|
73
74
|
} catch (error) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { mapState } from 'vuex';
|
|
2
1
|
import octopusApi from '@saooti/octopus-api';
|
|
3
|
-
import { CommentPodcast } from '@/
|
|
2
|
+
import { CommentPodcast } from '@/stores/class/general/comment';
|
|
4
3
|
import cookies from '../cookies';
|
|
5
4
|
import { playerLive } from './playerLive';
|
|
6
5
|
import { playerComment } from './playerComment';
|
|
7
6
|
import { playerTranscript } from './playerTranscript';
|
|
8
7
|
import { defineComponent } from 'vue';
|
|
9
|
-
import {
|
|
8
|
+
import { useAuthStore } from '@/stores/AuthStore';
|
|
9
|
+
import { usePlayerStore } from '@/stores/PlayerStore';
|
|
10
|
+
import { mapState, mapActions } from 'pinia';
|
|
10
11
|
export const playerLogic = defineComponent({
|
|
11
12
|
mixins:[cookies,playerLive,playerComment, playerTranscript],
|
|
12
13
|
data() {
|
|
@@ -28,19 +29,16 @@ export const playerLogic = defineComponent({
|
|
|
28
29
|
};
|
|
29
30
|
},
|
|
30
31
|
computed: {
|
|
31
|
-
...mapState('
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
playerSeekTime: (state: Player) => state.seekTime,
|
|
43
|
-
}),
|
|
32
|
+
...mapState(useAuthStore, ['authOrgaId', 'authParam']),
|
|
33
|
+
...mapState(usePlayerStore, [
|
|
34
|
+
'playerPodcast',
|
|
35
|
+
'playerMedia',
|
|
36
|
+
'playerLive',
|
|
37
|
+
'playerRadio',
|
|
38
|
+
'playerVolume',
|
|
39
|
+
'playerStatus',
|
|
40
|
+
'playerSeekTime']),
|
|
41
|
+
|
|
44
42
|
audioUrl(): string {
|
|
45
43
|
return this.getAudioUrl();
|
|
46
44
|
},
|
|
@@ -49,22 +47,22 @@ export const playerLogic = defineComponent({
|
|
|
49
47
|
watch: {
|
|
50
48
|
async audioUrl(): Promise<void>{
|
|
51
49
|
this.playerError = false;
|
|
52
|
-
if(this.
|
|
50
|
+
if(this.playerMedia || !this.playerPodcast || !this.playerPodcast.availability.visibility ||this.listenError){
|
|
53
51
|
this.audioUrlToPlay = this.audioUrl;
|
|
54
52
|
}
|
|
55
|
-
if(!this.
|
|
53
|
+
if(!this.playerPodcast || !this.playerPodcast.availability.visibility ||this.listenError){return;}
|
|
56
54
|
const response = await octopusApi.fetchDataPublic<{location:string, downloadId: number}>(0,"podcast/download/register/"+ this.getAudioUrlParameters());
|
|
57
55
|
this.setDownloadId(response.downloadId.toString());
|
|
58
56
|
this.audioUrlToPlay = response.location;
|
|
59
57
|
},
|
|
60
|
-
|
|
58
|
+
playerPodcast: {
|
|
61
59
|
deep: true,
|
|
62
60
|
handler(){
|
|
63
61
|
this.reInitPlayer();
|
|
64
62
|
this.getTranscription();
|
|
65
63
|
}
|
|
66
64
|
},
|
|
67
|
-
|
|
65
|
+
playerLive: {
|
|
68
66
|
deep: true,
|
|
69
67
|
handler(){
|
|
70
68
|
this.$nextTick(async () => {
|
|
@@ -74,7 +72,7 @@ export const playerLogic = defineComponent({
|
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
},
|
|
77
|
-
|
|
75
|
+
playerRadio(){
|
|
78
76
|
this.$nextTick(async () => {
|
|
79
77
|
this.hlsReady = false;
|
|
80
78
|
this.reInitPlayer();
|
|
@@ -82,7 +80,7 @@ export const playerLogic = defineComponent({
|
|
|
82
80
|
});
|
|
83
81
|
},
|
|
84
82
|
async listenTime(newVal): Promise<void> {
|
|
85
|
-
if (this.
|
|
83
|
+
if (this.playerRadio && (!this.playerPodcast && !this.playerLive)||(!this.downloadId)||(newVal - this.lastSend < 10)) {
|
|
86
84
|
return;
|
|
87
85
|
}
|
|
88
86
|
this.lastSend = newVal;
|
|
@@ -90,35 +88,35 @@ export const playerLogic = defineComponent({
|
|
|
90
88
|
},
|
|
91
89
|
playerSeekTime(){
|
|
92
90
|
if(!this.playerSeekTime){return;}
|
|
93
|
-
if (this
|
|
91
|
+
if (this.playerPodcast || this.playerLive) {
|
|
94
92
|
this.notListenTime = this.playerSeekTime - this.listenTime;
|
|
95
93
|
}
|
|
96
94
|
const audioPlayer: HTMLAudioElement | null = document.querySelector('#audio-player');
|
|
97
95
|
if (!audioPlayer) return;
|
|
98
96
|
audioPlayer.currentTime = this.playerSeekTime;
|
|
99
97
|
},
|
|
100
|
-
|
|
98
|
+
playerStatus() {
|
|
101
99
|
const audioPlayer: HTMLAudioElement | null = document.querySelector('#audio-player');
|
|
102
100
|
if (!audioPlayer) return;
|
|
103
|
-
if (this.
|
|
101
|
+
if (this.playerLive && !this.hlsReady) {
|
|
104
102
|
audioPlayer.pause();
|
|
105
103
|
this.percentLiveProgress = 0;
|
|
106
104
|
this.durationLivePosition = 0;
|
|
107
105
|
return;
|
|
108
106
|
}
|
|
109
|
-
if ('PAUSED' === this.
|
|
107
|
+
if ('PAUSED' === this.playerStatus && this.playerRadio) {
|
|
110
108
|
this.hlsReady = false;
|
|
111
109
|
this.reInitPlayer();
|
|
112
110
|
this.endingLive();
|
|
113
|
-
}else if('PAUSED' === this.
|
|
111
|
+
}else if('PAUSED' === this.playerStatus){
|
|
114
112
|
audioPlayer.pause();
|
|
115
|
-
}else if ('PLAYING' === this.
|
|
116
|
-
if(this.
|
|
113
|
+
}else if ('PLAYING' === this.playerStatus && this.playerRadio){
|
|
114
|
+
if(this.playerRadio.isInit){
|
|
117
115
|
this.playRadio();
|
|
118
116
|
}else{
|
|
119
|
-
this.
|
|
117
|
+
this.playerRadio.isInit = true;
|
|
120
118
|
}
|
|
121
|
-
}else if('PLAYING' === this.
|
|
119
|
+
}else if('PLAYING' === this.playerStatus){
|
|
122
120
|
audioPlayer.play();
|
|
123
121
|
}
|
|
124
122
|
},
|
|
@@ -129,6 +127,7 @@ export const playerLogic = defineComponent({
|
|
|
129
127
|
},
|
|
130
128
|
|
|
131
129
|
methods: {
|
|
130
|
+
...mapActions(usePlayerStore, ['playerPlay', 'playerUpdateElapsed']),
|
|
132
131
|
getDomain(): string{
|
|
133
132
|
let domain = "";
|
|
134
133
|
const domainArray: RegExpExecArray | null = /\.(.+)/.exec(window.location.host);
|
|
@@ -138,41 +137,38 @@ export const playerLogic = defineComponent({
|
|
|
138
137
|
return domain;
|
|
139
138
|
},
|
|
140
139
|
getAudioUrlParameters(): string{
|
|
141
|
-
if (!this.
|
|
140
|
+
if (!this.playerPodcast) return '';
|
|
142
141
|
const parameters = [];
|
|
143
142
|
parameters.push('origin=octopus');
|
|
144
143
|
parameters.push('listenerId='+this.getListenerId());
|
|
145
|
-
if (
|
|
146
|
-
this.$store.state.auth &&
|
|
147
|
-
this.$store.state.auth.organisationId
|
|
148
|
-
) {
|
|
144
|
+
if (this.authOrgaId) {
|
|
149
145
|
parameters.push(
|
|
150
|
-
'distributorId=' + this
|
|
146
|
+
'distributorId=' + this.authOrgaId
|
|
151
147
|
);
|
|
152
148
|
}
|
|
153
|
-
if("SECURED" === this.
|
|
154
|
-
parameters.push('access_token='+this
|
|
149
|
+
if("SECURED" === this.playerPodcast.organisation.privacy && this.authParam.accessToken){
|
|
150
|
+
parameters.push('access_token='+this.authParam.accessToken);
|
|
155
151
|
}
|
|
156
|
-
return this.
|
|
152
|
+
return this.playerPodcast.podcastId + '.mp3?' + parameters.join('&');
|
|
157
153
|
},
|
|
158
154
|
getAudioUrl(): string{
|
|
159
|
-
if (this.
|
|
160
|
-
if (!this.
|
|
161
|
-
if (!this.
|
|
162
|
-
return this.
|
|
163
|
-
if (this.listenError) return this.
|
|
155
|
+
if (this.playerMedia) return this.playerMedia.audioUrl? this.playerMedia.audioUrl:"";
|
|
156
|
+
if (!this.playerPodcast) return '';
|
|
157
|
+
if (!this.playerPodcast.availability.visibility || "PROCESSING"===this.playerPodcast.processingStatus)
|
|
158
|
+
return this.playerPodcast.audioStorageUrl;
|
|
159
|
+
if (this.listenError) return this.playerPodcast.audioStorageUrl;
|
|
164
160
|
return this.getAudioUrlParameters();
|
|
165
161
|
},
|
|
166
162
|
reInitPlayer():void{
|
|
167
163
|
this.setDownloadId(null);
|
|
168
164
|
this.listenError = false;
|
|
169
165
|
this.initComments();
|
|
170
|
-
if (this.
|
|
166
|
+
if (this.playerLive || this.playerRadio) {
|
|
171
167
|
this.endingLive();
|
|
172
168
|
}
|
|
173
169
|
},
|
|
174
170
|
stopPlayer(): void {
|
|
175
|
-
this
|
|
171
|
+
this.playerPlay();
|
|
176
172
|
},
|
|
177
173
|
getListenerId(): string{
|
|
178
174
|
let listenerId = this.getCookie("octopus_listenerId");
|
|
@@ -183,9 +179,9 @@ export const playerLogic = defineComponent({
|
|
|
183
179
|
return listenerId;
|
|
184
180
|
},
|
|
185
181
|
onError(): void {
|
|
186
|
-
if (this.
|
|
182
|
+
if (this.playerPodcast && ""!==this.audioUrlToPlay && !this.listenError) {
|
|
187
183
|
this.listenError = true;
|
|
188
|
-
} else if ((this.
|
|
184
|
+
} else if ((this.playerPodcast && ""!==this.audioUrlToPlay ) || this.playerMedia) {
|
|
189
185
|
this.playerError = true;
|
|
190
186
|
}
|
|
191
187
|
},
|
|
@@ -205,37 +201,31 @@ export const playerLogic = defineComponent({
|
|
|
205
201
|
onTimeUpdatePodcast(streamDuration:number, currentTime:number){
|
|
206
202
|
this.displayAlertBar = false;
|
|
207
203
|
this.percentLiveProgress = 100;
|
|
208
|
-
this
|
|
209
|
-
this.$store.commit('player/elapsed', currentTime / streamDuration);
|
|
204
|
+
this.playerUpdateElapsed(currentTime / streamDuration, streamDuration);
|
|
210
205
|
this.onTimeUpdateTranscript(currentTime);
|
|
211
206
|
},
|
|
212
207
|
onTimeUpdateLive(streamDuration: number, currentTime:number){
|
|
213
|
-
if(!this.
|
|
214
|
-
const scheduledDuration = this.
|
|
208
|
+
if(!this.playerLive){return;}
|
|
209
|
+
const scheduledDuration = this.playerLive.duration / 1000;
|
|
215
210
|
if (scheduledDuration > streamDuration) {
|
|
216
211
|
this.displayAlertBar = false;
|
|
217
212
|
this.percentLiveProgress = (streamDuration / scheduledDuration) * 100;
|
|
218
|
-
this
|
|
219
|
-
this.$store.commit(
|
|
220
|
-
'player/elapsed',
|
|
221
|
-
currentTime / scheduledDuration
|
|
222
|
-
);
|
|
213
|
+
this.playerUpdateElapsed(currentTime / scheduledDuration, scheduledDuration);
|
|
223
214
|
} else {
|
|
224
215
|
this.percentLiveProgress = 100;
|
|
225
216
|
this.displayAlertBar = true;
|
|
226
217
|
this.durationLivePosition = (scheduledDuration / streamDuration) * 100;
|
|
227
|
-
this
|
|
228
|
-
this.$store.commit('player/elapsed', currentTime / streamDuration);
|
|
218
|
+
this.playerUpdateElapsed(currentTime / streamDuration, streamDuration);
|
|
229
219
|
}
|
|
230
220
|
},
|
|
231
221
|
onTimeUpdate(event: Event): void {
|
|
232
222
|
const mediaTarget = (event.currentTarget as HTMLMediaElement);
|
|
233
|
-
if (this.
|
|
223
|
+
if (this.playerPodcast || this.playerLive) {
|
|
234
224
|
if (!this.downloadId) {
|
|
235
225
|
return;
|
|
236
226
|
}
|
|
237
227
|
if (
|
|
238
|
-
this.
|
|
228
|
+
this.playerLive &&
|
|
239
229
|
0 === this.listenTime &&
|
|
240
230
|
0 !== mediaTarget.currentTime
|
|
241
231
|
) {
|
|
@@ -249,7 +239,7 @@ export const playerLogic = defineComponent({
|
|
|
249
239
|
let streamDuration = this.streamDurationForSafari(mediaTarget);
|
|
250
240
|
if (!streamDuration) return;
|
|
251
241
|
if (!mediaTarget.currentTime) return;
|
|
252
|
-
if (!this.
|
|
242
|
+
if (!this.playerLive) {
|
|
253
243
|
this.onTimeUpdatePodcast(streamDuration,mediaTarget.currentTime);
|
|
254
244
|
return;
|
|
255
245
|
}
|
|
@@ -262,7 +252,7 @@ export const playerLogic = defineComponent({
|
|
|
262
252
|
},
|
|
263
253
|
onFinished(): void {
|
|
264
254
|
this.setDownloadId(null);
|
|
265
|
-
if (this.
|
|
255
|
+
if (this.playerLive) {
|
|
266
256
|
this.endingLive();
|
|
267
257
|
}
|
|
268
258
|
this.forceHide = true;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import octopusApi from '@saooti/octopus-api';
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
|
+
import { usePlayerStore } from '@/stores/PlayerStore';
|
|
4
|
+
import { mapState, mapActions } from 'pinia';
|
|
3
5
|
export const playerTranscript = defineComponent({
|
|
6
|
+
computed: {
|
|
7
|
+
...mapState(usePlayerStore, ['playerTranscript', 'playerPodcast']),
|
|
8
|
+
},
|
|
4
9
|
methods: {
|
|
10
|
+
...mapActions(usePlayerStore, ['playerUpdateTranscript']),
|
|
5
11
|
async getTranscription(): Promise<void>{
|
|
6
|
-
if(!this.
|
|
7
|
-
this
|
|
12
|
+
if(!this.playerPodcast){
|
|
13
|
+
this.playerUpdateTranscript(undefined);
|
|
8
14
|
return;
|
|
9
15
|
}
|
|
10
|
-
const result = await octopusApi.fetchDataPublic<string>(11 , `response/${this.
|
|
16
|
+
const result = await octopusApi.fetchDataPublic<string>(11 , `response/${this.playerPodcast.podcastId}`);
|
|
11
17
|
const arrayTranscript = this.parseSrt(result);
|
|
12
18
|
const actualText = arrayTranscript?.[0]?.startTime === 0 ? arrayTranscript[0].text : "";
|
|
13
|
-
this
|
|
19
|
+
this.playerUpdateTranscript({actual: 0,actualText:actualText, value : arrayTranscript});
|
|
14
20
|
},
|
|
15
21
|
parseSrt(transcript: string){
|
|
16
22
|
const pattern = /(\d+)\n([\d:,]+)\s+-{2}\>\s+([\d:,]+)\n([\s\S]*?(?=\n{2}|$))/gm;
|
|
@@ -37,18 +43,18 @@ export const playerTranscript = defineComponent({
|
|
|
37
43
|
return (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+parseFloat(a[2]));
|
|
38
44
|
},
|
|
39
45
|
onTimeUpdateTranscript(currentTime:number){
|
|
40
|
-
if((this
|
|
41
|
-
this
|
|
42
|
-
this
|
|
46
|
+
if(this.playerTranscript && (this.playerTranscript?.value[this.playerTranscript?.actual]?.endTime ?? Infinity) < currentTime){
|
|
47
|
+
this.playerTranscript.actual +=1;
|
|
48
|
+
this.playerTranscript.actualText = this.playerTranscript?.value[this.playerTranscript?.actual].text ?? "";
|
|
43
49
|
}
|
|
44
50
|
},
|
|
45
51
|
onSeekedTranscript(currentTime: number){
|
|
46
|
-
if(this
|
|
52
|
+
if(this.playerTranscript){
|
|
47
53
|
let newActual = 0;
|
|
48
|
-
while (currentTime > (this
|
|
54
|
+
while (currentTime > (this.playerTranscript.value[newActual]?.endTime ?? Infinity)){
|
|
49
55
|
newActual +=1;
|
|
50
56
|
}
|
|
51
|
-
this
|
|
57
|
+
this.playerTranscript.actual = newActual;
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
},
|
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
:first="0"
|
|
6
6
|
:size="30"
|
|
7
7
|
:iab-id="iabId"
|
|
8
|
-
:organisation-id="
|
|
8
|
+
:organisation-id="filterOrgaId"
|
|
9
9
|
/>
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
14
|
import PodcastList from '../display/podcasts/PodcastList.vue';
|
|
15
|
-
|
|
15
|
+
import { useFilterStore } from '@/stores/FilterStore';
|
|
16
|
+
import { useGeneralStore } from '@/stores/GeneralStore';
|
|
17
|
+
import { mapState } from 'pinia';
|
|
16
18
|
import { defineComponent } from 'vue'
|
|
17
|
-
import { Category } from '@/
|
|
19
|
+
import { Category } from '@/stores/class/general/category';
|
|
18
20
|
export default defineComponent({
|
|
19
21
|
components: {
|
|
20
22
|
PodcastList,
|
|
@@ -24,14 +26,10 @@ export default defineComponent({
|
|
|
24
26
|
},
|
|
25
27
|
|
|
26
28
|
computed: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
filterOrga(): string {
|
|
31
|
-
return this.$store.state.filter.organisationId;
|
|
32
|
-
},
|
|
29
|
+
...mapState(useGeneralStore, ['storedCategories']),
|
|
30
|
+
...mapState(useFilterStore, ['filterOrgaId']),
|
|
33
31
|
title():string{
|
|
34
|
-
const matchCategories = this.
|
|
32
|
+
const matchCategories = this.storedCategories.filter((c: Category) => c.id === this.iabId);
|
|
35
33
|
if (1 !== matchCategories.length) return "";
|
|
36
34
|
return matchCategories[0]['name'];
|
|
37
35
|
}
|
|
@@ -83,12 +83,12 @@
|
|
|
83
83
|
|
|
84
84
|
<script lang="ts">
|
|
85
85
|
import octopusApi from '@saooti/octopus-api';
|
|
86
|
-
import { state } from '../../
|
|
86
|
+
import { state } from '../../stores/ParamSdkStore';
|
|
87
87
|
import displayMethods from '../mixins/displayMethods';
|
|
88
88
|
import imageProxy from '../mixins/imageProxy';
|
|
89
89
|
import { orgaComputed } from '../mixins/orgaComputed';
|
|
90
90
|
import { handle403 } from '../mixins/handle403';
|
|
91
|
-
import { Emission } from '@/
|
|
91
|
+
import { Emission } from '@/stores/class/general/emission';
|
|
92
92
|
import ClassicLoading from '../form/ClassicLoading.vue';
|
|
93
93
|
import { defineComponent, defineAsyncComponent } from 'vue';
|
|
94
94
|
import { AxiosError } from 'axios';
|
|
@@ -200,7 +200,7 @@ export default defineComponent({
|
|
|
200
200
|
this.error = false;
|
|
201
201
|
try {
|
|
202
202
|
this.emission = await octopusApi.fetchData<Emission>(0,'emission/'+this.emissionId);
|
|
203
|
-
if("PUBLIC"!==this.emission.orga.privacy && this.
|
|
203
|
+
if("PUBLIC"!==this.emission.orga.privacy && this.filterOrgaId!==this.emission.orga.id){
|
|
204
204
|
this.initError();
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
@@ -46,8 +46,10 @@
|
|
|
46
46
|
import { orgaComputed } from '../mixins/orgaComputed';
|
|
47
47
|
import EmissionList from '../display/emission/EmissionList.vue';
|
|
48
48
|
import AdvancedSearch from '../display/filter/AdvancedSearch.vue';
|
|
49
|
-
import { state } from '../../
|
|
50
|
-
import {
|
|
49
|
+
import { state } from '../../stores/ParamSdkStore';
|
|
50
|
+
import { useFilterStore } from '@/stores/FilterStore';
|
|
51
|
+
import { mapState } from 'pinia';
|
|
52
|
+
import { RubriquageFilter } from '@/stores/class/rubrique/rubriquageFilter';
|
|
51
53
|
import { defineComponent, defineAsyncComponent } from 'vue';
|
|
52
54
|
const ProductorSearch = defineAsyncComponent(() => import('../display/filter/ProductorSearch.vue'));
|
|
53
55
|
export default defineComponent({
|
|
@@ -82,6 +84,7 @@ export default defineComponent({
|
|
|
82
84
|
},
|
|
83
85
|
|
|
84
86
|
computed: {
|
|
87
|
+
...mapState(useFilterStore, ['filterIab', 'filterRubrique']),
|
|
85
88
|
titleDisplay(): string{
|
|
86
89
|
return state.emissionsPage.titlePage??this.$t('All emissions');
|
|
87
90
|
},
|
|
@@ -93,7 +96,7 @@ export default defineComponent({
|
|
|
93
96
|
true===state.generalParameters.isAdmin
|
|
94
97
|
},
|
|
95
98
|
organisation(): string|undefined {
|
|
96
|
-
return this.organisationId?this.organisationId:this.
|
|
99
|
+
return this.organisationId?this.organisationId:this.filterOrgaId;
|
|
97
100
|
},
|
|
98
101
|
},
|
|
99
102
|
watch:{
|
|
@@ -114,13 +117,13 @@ export default defineComponent({
|
|
|
114
117
|
},
|
|
115
118
|
methods: {
|
|
116
119
|
initComponent(): void{
|
|
117
|
-
this.iabId =this
|
|
118
|
-
this.organisationId = this.productor ?this.productor: this.
|
|
120
|
+
this.iabId =this.filterIab?.id;
|
|
121
|
+
this.organisationId = this.productor ?this.productor: this.filterOrgaId;
|
|
119
122
|
if (this.organisation && this.organisationRight) {
|
|
120
123
|
this.includeHidden = true;
|
|
121
124
|
}
|
|
122
|
-
if(this
|
|
123
|
-
this.updateRubriquageFilter(this
|
|
125
|
+
if(this.filterRubrique.length){
|
|
126
|
+
this.updateRubriquageFilter(this.filterRubrique);
|
|
124
127
|
}
|
|
125
128
|
this.$nextTick(() => {
|
|
126
129
|
this.isInit = true;
|