@saooti/octopus-sdk 37.0.6 → 37.0.8
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 -2
- package/index.ts +22 -22
- package/package.json +26 -22
- package/src/App.vue +69 -60
- package/src/api/classicCrud.ts +12 -12
- package/src/api/initialize.ts +1 -1
- package/src/assets/transition.scss +34 -22
- package/src/components/display/aggregator/RssSection.vue +3 -3
- package/src/components/display/categories/CategoryChooser.vue +73 -60
- package/src/components/display/categories/CategoryFilter.vue +134 -90
- package/src/components/display/categories/CategoryList.vue +76 -62
- package/src/components/display/comments/AddCommentModal.vue +44 -44
- package/src/components/display/comments/CommentBasicView.vue +38 -30
- package/src/components/display/comments/CommentInput.vue +121 -106
- package/src/components/display/comments/CommentItem.vue +144 -102
- package/src/components/display/comments/CommentList.vue +117 -85
- package/src/components/display/comments/CommentParentInfo.vue +18 -15
- package/src/components/display/comments/CommentPlayer.vue +39 -41
- package/src/components/display/comments/CommentSection.vue +68 -53
- package/src/components/display/edit/EditBox.vue +7 -7
- package/src/components/display/edit/EditBoxRadio.vue +3 -4
- package/src/components/display/edit/EditCommentBox.vue +34 -36
- package/src/components/display/emission/EmissionInlineList.vue +75 -63
- package/src/components/display/emission/EmissionItem.vue +47 -35
- package/src/components/display/emission/EmissionList.vue +118 -83
- package/src/components/display/emission/EmissionPlayerItem.vue +89 -89
- package/src/components/display/filter/AdvancedSearch.vue +81 -73
- package/src/components/display/filter/CategorySearchFilter.vue +27 -25
- package/src/components/display/filter/DateFilter.vue +38 -38
- package/src/components/display/filter/MonetizableFilter.vue +16 -14
- package/src/components/display/filter/ProductorSearch.vue +55 -47
- package/src/components/display/filter/RubriqueChoice.vue +42 -27
- package/src/components/display/filter/RubriqueFilter.vue +130 -85
- package/src/components/display/filter/SearchOrder.vue +16 -11
- package/src/components/display/list/ListPaginate.vue +72 -70
- package/src/components/display/list/PaginateParams.vue +29 -30
- package/src/components/display/list/PaginateSection.vue +210 -0
- package/src/components/display/list/SwiperList.vue +28 -32
- package/src/components/display/live/CountDown.vue +12 -14
- package/src/components/display/live/LiveHorizontalList.vue +60 -50
- package/src/components/display/live/LiveItem.vue +42 -26
- package/src/components/display/live/LiveList.vue +92 -65
- package/src/components/display/live/RadioCurrently.vue +47 -42
- package/src/components/display/live/RadioImage.vue +40 -42
- package/src/components/display/live/RadioItem.vue +15 -22
- package/src/components/display/live/RadioList.vue +24 -21
- package/src/components/display/live/RadioPlanning.vue +105 -68
- package/src/components/display/organisation/OrganisationChooser.vue +58 -42
- package/src/components/display/organisation/OrganisationChooserLight.vue +27 -19
- package/src/components/display/participant/ParticipantItem.vue +89 -77
- package/src/components/display/participant/ParticipantList.vue +90 -60
- package/src/components/display/playlist/PlaylistItem.vue +32 -35
- package/src/components/display/playlist/PlaylistList.vue +70 -52
- package/src/components/display/playlist/PodcastList.vue +61 -50
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +47 -38
- package/src/components/display/podcasts/AnimatorsItem.vue +17 -15
- package/src/components/display/podcasts/ParticipantDescription.vue +21 -22
- package/src/components/display/podcasts/PodcastFilterList.vue +28 -26
- package/src/components/display/podcasts/PodcastImage.vue +129 -131
- package/src/components/display/podcasts/PodcastInlineList.vue +33 -29
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +91 -71
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +94 -85
- package/src/components/display/podcasts/PodcastItem.vue +96 -90
- package/src/components/display/podcasts/PodcastItemInfo.vue +61 -65
- package/src/components/display/podcasts/PodcastList.vue +115 -84
- package/src/components/display/podcasts/PodcastModuleBox.vue +95 -104
- package/src/components/display/podcasts/PodcastPlayBar.vue +45 -32
- package/src/components/display/podcasts/PodcastSwiperList.vue +65 -55
- package/src/components/display/podcasts/TagList.vue +33 -37
- package/src/components/display/rubriques/RubriqueChooser.vue +70 -51
- package/src/components/display/rubriques/RubriqueList.vue +117 -89
- package/src/components/display/sharing/PlayerParameters.vue +45 -42
- package/src/components/display/sharing/QrCode.vue +52 -46
- package/src/components/display/sharing/ShareButtons.vue +18 -18
- package/src/components/display/sharing/ShareButtonsIntern.vue +100 -78
- package/src/components/display/sharing/ShareDistribution.vue +101 -67
- package/src/components/display/sharing/SharePlayer.vue +207 -127
- package/src/components/display/sharing/SharePlayerColors.vue +15 -15
- package/src/components/display/sharing/SharePlayerRadio.vue +62 -39
- package/src/components/display/sharing/SharePlayerTypes.vue +93 -55
- package/src/components/display/sharing/SubscribeButtons.vue +83 -32
- package/src/components/display/studio/RecordingItemButton.vue +3 -3
- package/src/components/form/ClassicCheckbox.vue +32 -31
- package/src/components/form/ClassicDatePicker.vue +47 -49
- package/src/components/form/ClassicInputText.vue +99 -98
- package/src/components/form/ClassicLoading.vue +11 -14
- package/src/components/form/ClassicMultiselect.vue +125 -126
- package/src/components/form/ClassicRadio.vue +15 -18
- package/src/components/form/ClassicSearch.vue +17 -23
- package/src/components/form/ClassicSelect.vue +35 -27
- package/src/components/form/{Wysiwyg.vue → ClassicWysiwyg.vue} +103 -118
- package/src/components/misc/AcpmImage.vue +6 -6
- package/src/components/misc/ClassicAccordion.vue +73 -0
- package/src/components/misc/ClassicNav.vue +117 -0
- package/src/components/misc/ClassicPopover.vue +212 -0
- package/src/components/misc/{Spinner.vue → ClassicSpinner.vue} +14 -15
- package/src/components/misc/ErrorMessage.vue +9 -17
- package/src/components/misc/FooterSection.vue +198 -0
- package/src/components/misc/HomeDropdown.vue +60 -60
- package/src/components/misc/LeftMenu.vue +115 -79
- package/src/components/misc/ProgressBar.vue +36 -32
- package/src/components/misc/SnackBar.vue +169 -0
- package/src/components/misc/TopBar.vue +162 -116
- package/src/components/misc/modal/ClassicModal.vue +99 -103
- package/src/components/misc/modal/ClipboardModal.vue +21 -23
- package/src/components/misc/modal/MessageModal.vue +22 -28
- package/src/components/misc/modal/NewsletterModal.vue +139 -113
- package/src/components/misc/modal/QrCodeModal.vue +14 -17
- package/src/components/misc/modal/ShareModalPlayer.vue +44 -60
- package/src/components/misc/player/PlayerCompact.vue +47 -62
- package/src/components/misc/player/{Player.vue → PlayerComponent.vue} +54 -46
- package/src/components/misc/player/PlayerLarge.vue +62 -61
- package/src/components/misc/player/PlayerProgressBar.vue +40 -30
- package/src/components/misc/player/PlayerTimeline.vue +32 -36
- package/src/components/misc/player/radio/RadioHistory.vue +62 -59
- package/src/components/misc/player/radio/RadioProgressBar.vue +44 -35
- package/src/components/mixins/cookies.ts +11 -10
- package/src/components/mixins/displayMethods.ts +5 -4
- package/src/components/mixins/handle403.ts +9 -9
- package/src/components/mixins/imageProxy.ts +14 -7
- package/src/components/mixins/init.ts +31 -16
- package/src/components/mixins/orgaComputed.ts +7 -7
- package/src/components/mixins/organisationFilter.ts +36 -22
- package/src/components/mixins/player/playerComment.ts +46 -37
- package/src/components/mixins/player/playerDisplay.ts +122 -87
- package/src/components/mixins/player/playerLive.ts +65 -43
- package/src/components/mixins/player/playerLogic.ts +133 -88
- package/src/components/mixins/player/playerTranscript.ts +48 -30
- package/src/components/mixins/radio/fetchRadioData.ts +40 -23
- package/src/components/mixins/selenium.ts +2 -2
- package/src/components/mixins/tagOfMixins.ts +11 -11
- package/src/components/pages/CategoryPage.vue +43 -0
- package/src/components/pages/{Emission.vue → EmissionPage.vue} +98 -67
- package/src/components/pages/{Emissions.vue → EmissionsPage.vue} +51 -44
- package/src/components/pages/Error403Page.vue +20 -19
- package/src/components/pages/HomePage.vue +144 -0
- package/src/components/pages/LivesPage.vue +66 -0
- package/src/components/pages/PageNotFound.vue +33 -22
- package/src/components/pages/{Participant.vue → ParticipantPage.vue} +63 -49
- package/src/components/pages/{Participants.vue → ParticipantsPage.vue} +9 -9
- package/src/components/pages/PlaylistPage.vue +175 -0
- package/src/components/pages/{Playlists.vue → PlaylistsPage.vue} +16 -14
- package/src/components/pages/PodcastPage.vue +365 -0
- package/src/components/pages/PodcastsPage.vue +152 -0
- package/src/components/pages/RadioPage.vue +131 -0
- package/src/components/pages/RubriquePage.vue +45 -0
- package/src/components/pages/{Search.vue → SearchPage.vue} +19 -19
- package/src/helper/dom.ts +1 -1
- package/src/helper/duration.ts +10 -4
- package/src/helper/useEventListener.ts +7 -8
- package/src/i18n.ts +31 -30
- package/src/locale/de.ts +272 -257
- package/src/locale/educationen.ts +13 -13
- package/src/locale/educationfr.ts +1 -1
- package/src/locale/en.ts +332 -324
- package/src/locale/es.ts +334 -318
- package/src/locale/fr.ts +339 -324
- package/src/locale/it.ts +341 -328
- package/src/locale/messages.ts +9 -9
- package/src/locale/sl.ts +324 -319
- package/src/main.ts +28 -31
- package/src/router/router.ts +218 -198
- package/src/shims-tsx.d.ts +1 -1
- package/src/shims-vue.d.ts +1 -1
- package/src/stores/ApiStore.ts +44 -44
- package/src/stores/AuthStore.ts +21 -15
- package/src/stores/CommentStore.ts +13 -11
- package/src/stores/FilterStore.ts +25 -15
- package/src/stores/GeneralStore.ts +15 -15
- package/src/stores/ParamSdkStore.ts +179 -137
- package/src/stores/PlayerStore.ts +139 -125
- package/src/stores/class/adserver/adserverConfig.ts +1 -1
- package/src/stores/class/adserver/adserverOtherEmission.ts +9 -9
- package/src/stores/class/cartouchier/cartouche.ts +4 -4
- package/src/stores/class/cartouchier/cartouchier.ts +2 -2
- package/src/stores/class/conference/conference.ts +10 -9
- package/src/stores/class/conference/conferenceMessage.ts +2 -2
- package/src/stores/class/conference/conferenceParticipant.ts +1 -1
- package/src/stores/class/conference/studioCall.ts +6 -6
- package/src/stores/class/contract/contractOrganisation.ts +5 -5
- package/src/stores/class/ftp/ftpEmission.ts +9 -9
- package/src/stores/class/ftp/testFtpEmission.ts +4 -4
- package/src/stores/class/general/audioView.ts +19 -19
- package/src/stores/class/general/category.ts +1 -1
- package/src/stores/class/general/classicSelectType.ts +2 -3
- package/src/stores/class/general/customPlayer.ts +8 -8
- package/src/stores/class/general/emission.ts +20 -20
- package/src/stores/class/general/fetchParam.ts +8 -2
- package/src/stores/class/general/initState.ts +31 -31
- package/src/stores/class/general/interfacePageable.ts +13 -13
- package/src/stores/class/general/ituneCategory.ts +4 -4
- package/src/stores/class/general/listReturn.ts +12 -12
- package/src/stores/class/general/media.ts +7 -7
- package/src/stores/class/general/organisation.ts +9 -9
- package/src/stores/class/general/pageable.ts +10 -10
- package/src/stores/class/general/participant.ts +7 -7
- package/src/stores/class/general/player.ts +30 -28
- package/src/stores/class/general/playlist.ts +17 -19
- package/src/stores/class/general/podcast.ts +19 -19
- package/src/stores/class/general/sortPageable.ts +4 -4
- package/src/stores/class/general/soundcastCategory.ts +7 -7
- package/src/stores/class/ouestFrance/ofTag.ts +34 -34
- package/src/stores/class/ouestFrance/ofTagInfo.ts +9 -9
- package/src/stores/class/ouestFrance/ofTagPage.ts +7 -7
- package/src/stores/class/ouestFrance/ofTagSeo.ts +7 -7
- package/src/stores/class/ouestFrance/ofTagVente.ts +6 -6
- package/src/stores/class/ouestFrance/ofTagWithParents.ts +20 -20
- package/src/stores/class/radio/canal.ts +4 -4
- package/src/stores/class/radio/live.ts +6 -6
- package/src/stores/class/radio/mix.ts +16 -16
- package/src/stores/class/radio/playlistMedia.ts +7 -7
- package/src/stores/class/radio/recurrence.ts +54 -54
- package/src/stores/class/rss/rssEmission.ts +13 -13
- package/src/stores/class/rss/rssInfo.ts +7 -7
- package/src/stores/class/rubrique/rubriquage.ts +2 -2
- package/src/stores/class/rubrique/rubrique.ts +1 -1
- package/src/stores/class/stat/statArrayIncome.ts +5 -5
- package/src/stores/class/stat/statArrayObject.ts +26 -26
- package/src/stores/class/stat/statGraph.ts +6 -6
- package/src/stores/class/user/person.ts +4 -2
- package/src/stores/class/user/profile.ts +4 -2
- package/src/stores/class/user/userKeycloak.ts +4 -5
- package/src/components/display/list/Paginate.vue +0 -181
- package/src/components/misc/Accordion.vue +0 -78
- package/src/components/misc/Footer.vue +0 -169
- package/src/components/misc/Nav.vue +0 -119
- package/src/components/misc/Popover.vue +0 -193
- package/src/components/misc/Snackbar.vue +0 -168
- package/src/components/pages/Category.vue +0 -41
- package/src/components/pages/Home.vue +0 -125
- package/src/components/pages/Lives.vue +0 -64
- package/src/components/pages/Playlist.vue +0 -164
- package/src/components/pages/Podcast.vue +0 -307
- package/src/components/pages/Podcasts.vue +0 -146
- package/src/components/pages/Radio.vue +0 -122
- package/src/components/pages/Rubrique.vue +0 -42
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import octopusApi from
|
|
2
|
-
import { CommentPodcast } from
|
|
3
|
-
import cookies from
|
|
4
|
-
import { playerLive } from
|
|
5
|
-
import { playerComment } from
|
|
6
|
-
import { playerTranscript } from
|
|
7
|
-
import { defineComponent } from
|
|
8
|
-
import { useAuthStore } from
|
|
9
|
-
import { useGeneralStore } from
|
|
10
|
-
import { usePlayerStore } from
|
|
11
|
-
import { mapState, mapActions } from
|
|
1
|
+
import octopusApi from "@saooti/octopus-api";
|
|
2
|
+
import { CommentPodcast } from "@/stores/class/general/comment";
|
|
3
|
+
import cookies from "../cookies";
|
|
4
|
+
import { playerLive } from "./playerLive";
|
|
5
|
+
import { playerComment } from "./playerComment";
|
|
6
|
+
import { playerTranscript } from "./playerTranscript";
|
|
7
|
+
import { defineComponent } from "vue";
|
|
8
|
+
import { useAuthStore } from "@/stores/AuthStore";
|
|
9
|
+
import { useGeneralStore } from "@/stores/GeneralStore";
|
|
10
|
+
import { usePlayerStore } from "@/stores/PlayerStore";
|
|
11
|
+
import { mapState, mapActions } from "pinia";
|
|
12
12
|
export const playerLogic = defineComponent({
|
|
13
|
-
mixins:[cookies,playerLive,playerComment, playerTranscript],
|
|
13
|
+
mixins: [cookies, playerLive, playerComment, playerTranscript],
|
|
14
14
|
data() {
|
|
15
15
|
return {
|
|
16
16
|
forceHide: false as boolean,
|
|
17
17
|
listenTime: 0 as number,
|
|
18
18
|
notListenTime: 0 as number,
|
|
19
19
|
lastSend: 0 as number,
|
|
20
|
-
downloadId: null as string|null,
|
|
20
|
+
downloadId: null as string | null,
|
|
21
21
|
playerError: false as boolean,
|
|
22
22
|
listenError: false as boolean,
|
|
23
23
|
percentLiveProgress: 0 as number,
|
|
@@ -26,55 +26,70 @@ export const playerLogic = defineComponent({
|
|
|
26
26
|
hlsReady: false as boolean,
|
|
27
27
|
comments: [] as Array<CommentPodcast>,
|
|
28
28
|
showTimeline: false as boolean,
|
|
29
|
-
audioUrlToPlay: "" as string
|
|
29
|
+
audioUrlToPlay: "" as string,
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
computed: {
|
|
33
|
-
...mapState(useAuthStore, [
|
|
34
|
-
...mapState(useGeneralStore, [
|
|
33
|
+
...mapState(useAuthStore, ["authOrgaId", "authParam"]),
|
|
34
|
+
...mapState(useGeneralStore, ["consentTcf"]),
|
|
35
35
|
...mapState(usePlayerStore, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
"playerPodcast",
|
|
37
|
+
"playerMedia",
|
|
38
|
+
"playerLive",
|
|
39
|
+
"playerRadio",
|
|
40
|
+
"playerVolume",
|
|
41
|
+
"playerStatus",
|
|
42
|
+
"playerSeekTime",
|
|
43
|
+
]),
|
|
44
|
+
|
|
44
45
|
audioUrl(): string {
|
|
45
46
|
return this.getAudioUrl();
|
|
46
47
|
},
|
|
47
48
|
},
|
|
48
49
|
|
|
49
50
|
watch: {
|
|
50
|
-
async audioUrl(): Promise<void>{
|
|
51
|
+
async audioUrl(): Promise<void> {
|
|
51
52
|
this.playerError = false;
|
|
52
|
-
if(
|
|
53
|
+
if (
|
|
54
|
+
this.playerMedia ||
|
|
55
|
+
!this.playerPodcast ||
|
|
56
|
+
!this.playerPodcast.availability.visibility ||
|
|
57
|
+
this.listenError
|
|
58
|
+
) {
|
|
53
59
|
this.audioUrlToPlay = this.audioUrl;
|
|
54
60
|
}
|
|
55
|
-
if(
|
|
56
|
-
|
|
61
|
+
if (
|
|
62
|
+
!this.playerPodcast ||
|
|
63
|
+
!this.playerPodcast.availability.visibility ||
|
|
64
|
+
this.listenError
|
|
65
|
+
) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const response = await octopusApi.fetchDataPublic<{
|
|
69
|
+
location: string;
|
|
70
|
+
downloadId: number;
|
|
71
|
+
}>(0, "podcast/download/register/" + this.getAudioUrlParameters());
|
|
57
72
|
this.setDownloadId(response.downloadId.toString());
|
|
58
73
|
this.audioUrlToPlay = response.location;
|
|
59
74
|
},
|
|
60
75
|
playerPodcast: {
|
|
61
76
|
deep: true,
|
|
62
|
-
handler(){
|
|
77
|
+
handler() {
|
|
63
78
|
this.reInitPlayer();
|
|
64
79
|
this.getTranscription();
|
|
65
|
-
}
|
|
80
|
+
},
|
|
66
81
|
},
|
|
67
82
|
playerLive: {
|
|
68
83
|
deep: true,
|
|
69
|
-
handler(){
|
|
84
|
+
handler() {
|
|
70
85
|
this.$nextTick(async () => {
|
|
71
86
|
this.hlsReady = false;
|
|
72
87
|
this.reInitPlayer();
|
|
73
88
|
this.playLive();
|
|
74
89
|
});
|
|
75
|
-
}
|
|
90
|
+
},
|
|
76
91
|
},
|
|
77
|
-
playerRadio(){
|
|
92
|
+
playerRadio() {
|
|
78
93
|
this.$nextTick(async () => {
|
|
79
94
|
this.hlsReady = false;
|
|
80
95
|
this.reInitPlayer();
|
|
@@ -82,23 +97,35 @@ export const playerLogic = defineComponent({
|
|
|
82
97
|
});
|
|
83
98
|
},
|
|
84
99
|
async listenTime(newVal): Promise<void> {
|
|
85
|
-
if (
|
|
100
|
+
if (
|
|
101
|
+
(this.playerRadio && !this.playerPodcast && !this.playerLive) ||
|
|
102
|
+
!this.downloadId ||
|
|
103
|
+
newVal - this.lastSend < 10
|
|
104
|
+
) {
|
|
86
105
|
return;
|
|
87
106
|
}
|
|
88
107
|
this.lastSend = newVal;
|
|
89
|
-
await octopusApi.putDataPublic(
|
|
108
|
+
await octopusApi.putDataPublic(
|
|
109
|
+
0,
|
|
110
|
+
"podcast/listen/" + this.downloadId + "?seconds=" + Math.round(newVal),
|
|
111
|
+
undefined,
|
|
112
|
+
);
|
|
90
113
|
},
|
|
91
|
-
playerSeekTime(){
|
|
92
|
-
if(!this.playerSeekTime){
|
|
114
|
+
playerSeekTime() {
|
|
115
|
+
if (!this.playerSeekTime) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
93
118
|
if (this.playerPodcast || this.playerLive) {
|
|
94
119
|
this.notListenTime = this.playerSeekTime - this.listenTime;
|
|
95
120
|
}
|
|
96
|
-
const audioPlayer: HTMLAudioElement | null =
|
|
121
|
+
const audioPlayer: HTMLAudioElement | null =
|
|
122
|
+
document.querySelector("#audio-player");
|
|
97
123
|
if (!audioPlayer) return;
|
|
98
124
|
audioPlayer.currentTime = this.playerSeekTime;
|
|
99
125
|
},
|
|
100
126
|
playerStatus() {
|
|
101
|
-
const audioPlayer: HTMLAudioElement | null =
|
|
127
|
+
const audioPlayer: HTMLAudioElement | null =
|
|
128
|
+
document.querySelector("#audio-player");
|
|
102
129
|
if (!audioPlayer) return;
|
|
103
130
|
if (this.playerLive && !this.hlsReady) {
|
|
104
131
|
audioPlayer.pause();
|
|
@@ -106,65 +133,72 @@ export const playerLogic = defineComponent({
|
|
|
106
133
|
this.durationLivePosition = 0;
|
|
107
134
|
return;
|
|
108
135
|
}
|
|
109
|
-
if (
|
|
136
|
+
if ("PAUSED" === this.playerStatus && this.playerRadio) {
|
|
110
137
|
this.hlsReady = false;
|
|
111
138
|
this.reInitPlayer();
|
|
112
139
|
this.endingLive();
|
|
113
|
-
}else if(
|
|
140
|
+
} else if ("PAUSED" === this.playerStatus) {
|
|
114
141
|
audioPlayer.pause();
|
|
115
|
-
}else if (
|
|
116
|
-
if(this.playerRadio.isInit){
|
|
142
|
+
} else if ("PLAYING" === this.playerStatus && this.playerRadio) {
|
|
143
|
+
if (this.playerRadio.isInit) {
|
|
117
144
|
this.playRadio();
|
|
118
|
-
}else{
|
|
145
|
+
} else {
|
|
119
146
|
this.playerRadio.isInit = true;
|
|
120
147
|
}
|
|
121
|
-
}else if(
|
|
148
|
+
} else if ("PLAYING" === this.playerStatus) {
|
|
122
149
|
audioPlayer.play();
|
|
123
150
|
}
|
|
124
151
|
},
|
|
125
152
|
},
|
|
126
153
|
|
|
127
154
|
mounted() {
|
|
128
|
-
window.addEventListener(
|
|
155
|
+
window.addEventListener("beforeunload", this.endListeningProgress);
|
|
129
156
|
},
|
|
130
|
-
|
|
157
|
+
|
|
131
158
|
methods: {
|
|
132
|
-
...mapActions(usePlayerStore, [
|
|
133
|
-
getDomain(): string{
|
|
159
|
+
...mapActions(usePlayerStore, ["playerPlay", "playerUpdateElapsed"]),
|
|
160
|
+
getDomain(): string {
|
|
134
161
|
let domain = "";
|
|
135
|
-
const domainArray: RegExpExecArray | null = /\.(.+)/.exec(
|
|
136
|
-
|
|
162
|
+
const domainArray: RegExpExecArray | null = /\.(.+)/.exec(
|
|
163
|
+
window.location.host,
|
|
164
|
+
);
|
|
165
|
+
if (domainArray && null !== domainArray) {
|
|
137
166
|
domain = domainArray[1];
|
|
138
167
|
}
|
|
139
168
|
return domain;
|
|
140
169
|
},
|
|
141
|
-
getAudioUrlParameters(): string{
|
|
142
|
-
if (!this.playerPodcast) return
|
|
170
|
+
getAudioUrlParameters(): string {
|
|
171
|
+
if (!this.playerPodcast) return "";
|
|
143
172
|
const parameters = [];
|
|
144
|
-
parameters.push(
|
|
173
|
+
parameters.push("origin=octopus");
|
|
145
174
|
if (this.authOrgaId) {
|
|
146
|
-
parameters.push(
|
|
147
|
-
'distributorId=' + this.authOrgaId
|
|
148
|
-
);
|
|
175
|
+
parameters.push("distributorId=" + this.authOrgaId);
|
|
149
176
|
}
|
|
150
|
-
if(this.consentTcf){
|
|
151
|
-
parameters.push(
|
|
177
|
+
if (this.consentTcf) {
|
|
178
|
+
parameters.push("consent=" + this.consentTcf);
|
|
152
179
|
}
|
|
153
180
|
|
|
154
|
-
if(
|
|
155
|
-
|
|
181
|
+
if (
|
|
182
|
+
"SECURED" === this.playerPodcast.organisation.privacy &&
|
|
183
|
+
this.authParam.accessToken
|
|
184
|
+
) {
|
|
185
|
+
parameters.push("access_token=" + this.authParam.accessToken);
|
|
156
186
|
}
|
|
157
|
-
return this.playerPodcast.podcastId +
|
|
187
|
+
return this.playerPodcast.podcastId + ".mp3?" + parameters.join("&");
|
|
158
188
|
},
|
|
159
|
-
getAudioUrl(): string{
|
|
160
|
-
if (this.playerMedia)
|
|
161
|
-
|
|
162
|
-
if (!this.playerPodcast
|
|
189
|
+
getAudioUrl(): string {
|
|
190
|
+
if (this.playerMedia)
|
|
191
|
+
return this.playerMedia.audioUrl ? this.playerMedia.audioUrl : "";
|
|
192
|
+
if (!this.playerPodcast) return "";
|
|
193
|
+
if (
|
|
194
|
+
!this.playerPodcast.availability.visibility ||
|
|
195
|
+
"PROCESSING" === this.playerPodcast.processingStatus
|
|
196
|
+
)
|
|
163
197
|
return this.playerPodcast.audioStorageUrl;
|
|
164
198
|
if (this.listenError) return this.playerPodcast.audioStorageUrl;
|
|
165
199
|
return this.getAudioUrlParameters();
|
|
166
200
|
},
|
|
167
|
-
reInitPlayer():void{
|
|
201
|
+
reInitPlayer(): void {
|
|
168
202
|
this.setDownloadId(null);
|
|
169
203
|
this.listenError = false;
|
|
170
204
|
this.initComments();
|
|
@@ -176,38 +210,50 @@ export const playerLogic = defineComponent({
|
|
|
176
210
|
this.playerPlay();
|
|
177
211
|
},
|
|
178
212
|
onError(): void {
|
|
179
|
-
if (
|
|
213
|
+
if (
|
|
214
|
+
this.playerPodcast &&
|
|
215
|
+
"" !== this.audioUrlToPlay &&
|
|
216
|
+
!this.listenError
|
|
217
|
+
) {
|
|
180
218
|
this.listenError = true;
|
|
181
|
-
} else if (
|
|
219
|
+
} else if (
|
|
220
|
+
(this.playerPodcast && "" !== this.audioUrlToPlay) ||
|
|
221
|
+
this.playerMedia
|
|
222
|
+
) {
|
|
182
223
|
this.playerError = true;
|
|
183
224
|
}
|
|
184
225
|
},
|
|
185
|
-
streamDurationForSafari(mediaTarget:HTMLMediaElement){
|
|
226
|
+
streamDurationForSafari(mediaTarget: HTMLMediaElement) {
|
|
186
227
|
let streamDuration = mediaTarget.duration;
|
|
187
|
-
if(Infinity===streamDuration){
|
|
228
|
+
if (Infinity === streamDuration) {
|
|
188
229
|
const seekable = mediaTarget.seekable;
|
|
189
|
-
if(seekable){
|
|
230
|
+
if (seekable) {
|
|
190
231
|
streamDuration = seekable.end(seekable.length - 1);
|
|
191
|
-
}else{
|
|
232
|
+
} else {
|
|
192
233
|
streamDuration = mediaTarget.currentTime;
|
|
193
234
|
}
|
|
194
235
|
}
|
|
195
236
|
return streamDuration;
|
|
196
237
|
},
|
|
197
|
-
|
|
198
|
-
onTimeUpdatePodcast(streamDuration:number, currentTime:number){
|
|
238
|
+
|
|
239
|
+
onTimeUpdatePodcast(streamDuration: number, currentTime: number) {
|
|
199
240
|
this.displayAlertBar = false;
|
|
200
241
|
this.percentLiveProgress = 100;
|
|
201
242
|
this.playerUpdateElapsed(currentTime / streamDuration, streamDuration);
|
|
202
243
|
this.onTimeUpdateTranscript(currentTime);
|
|
203
244
|
},
|
|
204
|
-
onTimeUpdateLive(streamDuration: number, currentTime:number){
|
|
205
|
-
if(!this.playerLive){
|
|
245
|
+
onTimeUpdateLive(streamDuration: number, currentTime: number) {
|
|
246
|
+
if (!this.playerLive) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
206
249
|
const scheduledDuration = this.playerLive.duration / 1000;
|
|
207
250
|
if (scheduledDuration > streamDuration) {
|
|
208
251
|
this.displayAlertBar = false;
|
|
209
252
|
this.percentLiveProgress = (streamDuration / scheduledDuration) * 100;
|
|
210
|
-
this.playerUpdateElapsed(
|
|
253
|
+
this.playerUpdateElapsed(
|
|
254
|
+
currentTime / scheduledDuration,
|
|
255
|
+
scheduledDuration,
|
|
256
|
+
);
|
|
211
257
|
} else {
|
|
212
258
|
this.percentLiveProgress = 100;
|
|
213
259
|
this.displayAlertBar = true;
|
|
@@ -216,10 +262,10 @@ export const playerLogic = defineComponent({
|
|
|
216
262
|
}
|
|
217
263
|
},
|
|
218
264
|
onTimeUpdate(event: Event): void {
|
|
219
|
-
if(this.playerRadio){
|
|
265
|
+
if (this.playerRadio) {
|
|
220
266
|
return;
|
|
221
267
|
}
|
|
222
|
-
const mediaTarget =
|
|
268
|
+
const mediaTarget = event.currentTarget as HTMLMediaElement;
|
|
223
269
|
if (this.playerPodcast || this.playerLive) {
|
|
224
270
|
if (!this.downloadId) {
|
|
225
271
|
return;
|
|
@@ -232,21 +278,20 @@ export const playerLogic = defineComponent({
|
|
|
232
278
|
this.notListenTime = mediaTarget.currentTime;
|
|
233
279
|
this.listenTime = 1;
|
|
234
280
|
} else {
|
|
235
|
-
this.listenTime =
|
|
236
|
-
mediaTarget.currentTime - this.notListenTime;
|
|
281
|
+
this.listenTime = mediaTarget.currentTime - this.notListenTime;
|
|
237
282
|
}
|
|
238
283
|
}
|
|
239
|
-
|
|
284
|
+
const streamDuration = this.streamDurationForSafari(mediaTarget);
|
|
240
285
|
if (!streamDuration) return;
|
|
241
286
|
if (!mediaTarget.currentTime) return;
|
|
242
287
|
if (!this.playerLive) {
|
|
243
|
-
this.onTimeUpdatePodcast(streamDuration,mediaTarget.currentTime);
|
|
288
|
+
this.onTimeUpdatePodcast(streamDuration, mediaTarget.currentTime);
|
|
244
289
|
return;
|
|
245
290
|
}
|
|
246
|
-
this.onTimeUpdateLive(streamDuration,mediaTarget.currentTime);
|
|
291
|
+
this.onTimeUpdateLive(streamDuration, mediaTarget.currentTime);
|
|
247
292
|
},
|
|
248
|
-
onSeeked(event: Event):void {
|
|
249
|
-
const mediaTarget =
|
|
293
|
+
onSeeked(event: Event): void {
|
|
294
|
+
const mediaTarget = event.currentTarget as HTMLMediaElement;
|
|
250
295
|
const currentTime = mediaTarget.currentTime;
|
|
251
296
|
this.onSeekedTranscript(currentTime);
|
|
252
297
|
},
|
|
@@ -258,4 +303,4 @@ export const playerLogic = defineComponent({
|
|
|
258
303
|
this.forceHide = true;
|
|
259
304
|
},
|
|
260
305
|
},
|
|
261
|
-
})
|
|
306
|
+
});
|
|
@@ -1,61 +1,79 @@
|
|
|
1
|
-
import octopusApi from
|
|
2
|
-
import { defineComponent } from
|
|
3
|
-
import { usePlayerStore } from
|
|
4
|
-
import { mapState, mapActions } from
|
|
1
|
+
import octopusApi from "@saooti/octopus-api";
|
|
2
|
+
import { defineComponent } from "vue";
|
|
3
|
+
import { usePlayerStore } from "@/stores/PlayerStore";
|
|
4
|
+
import { mapState, mapActions } from "pinia";
|
|
5
5
|
export const playerTranscript = defineComponent({
|
|
6
6
|
computed: {
|
|
7
|
-
...mapState(usePlayerStore, [
|
|
7
|
+
...mapState(usePlayerStore, ["playerTranscript", "playerPodcast"]),
|
|
8
8
|
},
|
|
9
9
|
methods: {
|
|
10
|
-
...mapActions(usePlayerStore, [
|
|
11
|
-
async getTranscription(): Promise<void>{
|
|
12
|
-
if(!this.playerPodcast){
|
|
10
|
+
...mapActions(usePlayerStore, ["playerUpdateTranscript"]),
|
|
11
|
+
async getTranscription(): Promise<void> {
|
|
12
|
+
if (!this.playerPodcast) {
|
|
13
13
|
this.playerUpdateTranscript();
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
const result = await octopusApi.fetchDataPublic<string>(
|
|
16
|
+
const result = await octopusApi.fetchDataPublic<string>(
|
|
17
|
+
11,
|
|
18
|
+
`response/${this.playerPodcast.podcastId}`,
|
|
19
|
+
);
|
|
17
20
|
const arrayTranscript = this.parseSrt(result);
|
|
18
|
-
const actualText =
|
|
19
|
-
|
|
21
|
+
const actualText =
|
|
22
|
+
arrayTranscript?.[0]?.startTime === 0 ? arrayTranscript[0].text : "";
|
|
23
|
+
this.playerUpdateTranscript({
|
|
24
|
+
actual: 0,
|
|
25
|
+
actualText: actualText,
|
|
26
|
+
value: arrayTranscript,
|
|
27
|
+
});
|
|
20
28
|
},
|
|
21
|
-
parseSrt(transcript: string){
|
|
22
|
-
const pattern =
|
|
29
|
+
parseSrt(transcript: string) {
|
|
30
|
+
const pattern =
|
|
31
|
+
/(\d+)\n([\d:,]+)\s+-{2}\>\s+([\d:,]+)\n([\s\S]*?(?=\n{2}|$))/gm;
|
|
23
32
|
const result = [];
|
|
24
|
-
if (typeof
|
|
33
|
+
if (typeof transcript != "string") {
|
|
25
34
|
return;
|
|
26
35
|
}
|
|
27
|
-
if (transcript == null){
|
|
36
|
+
if (transcript == null) {
|
|
28
37
|
return;
|
|
29
38
|
}
|
|
30
|
-
transcript = transcript.replace(/\r\n|\r|\n|\t/g,
|
|
39
|
+
transcript = transcript.replace(/\r\n|\r|\n|\t/g, "\n");
|
|
31
40
|
let matches;
|
|
32
41
|
while ((matches = pattern.exec(transcript)) != null) {
|
|
33
42
|
result.push({
|
|
34
43
|
startTime: this.srtTimeToSeconds(matches[2]),
|
|
35
44
|
endTime: this.srtTimeToSeconds(matches[3]),
|
|
36
|
-
text: matches[4]
|
|
45
|
+
text: matches[4],
|
|
37
46
|
});
|
|
38
47
|
}
|
|
39
48
|
return result;
|
|
40
49
|
},
|
|
41
|
-
srtTimeToSeconds(time:string): number{
|
|
42
|
-
const a = time.split(
|
|
43
|
-
return
|
|
50
|
+
srtTimeToSeconds(time: string): number {
|
|
51
|
+
const a = time.split(":");
|
|
52
|
+
return +a[0] * 60 * 60 + +a[1] * 60 + +parseFloat(a[2]);
|
|
44
53
|
},
|
|
45
|
-
onTimeUpdateTranscript(currentTime:number){
|
|
46
|
-
if
|
|
47
|
-
this.playerTranscript
|
|
48
|
-
this.playerTranscript
|
|
54
|
+
onTimeUpdateTranscript(currentTime: number) {
|
|
55
|
+
if (
|
|
56
|
+
this.playerTranscript &&
|
|
57
|
+
(this.playerTranscript?.value[this.playerTranscript?.actual]?.endTime ??
|
|
58
|
+
Infinity) < currentTime
|
|
59
|
+
) {
|
|
60
|
+
this.playerTranscript.actual += 1;
|
|
61
|
+
this.playerTranscript.actualText =
|
|
62
|
+
this.playerTranscript?.value[this.playerTranscript?.actual].text ??
|
|
63
|
+
"";
|
|
49
64
|
}
|
|
50
65
|
},
|
|
51
|
-
onSeekedTranscript(currentTime: number){
|
|
52
|
-
if(this.playerTranscript){
|
|
66
|
+
onSeekedTranscript(currentTime: number) {
|
|
67
|
+
if (this.playerTranscript) {
|
|
53
68
|
let newActual = 0;
|
|
54
|
-
while (
|
|
55
|
-
|
|
69
|
+
while (
|
|
70
|
+
currentTime >
|
|
71
|
+
(this.playerTranscript.value[newActual]?.endTime ?? Infinity)
|
|
72
|
+
) {
|
|
73
|
+
newActual += 1;
|
|
56
74
|
}
|
|
57
75
|
this.playerTranscript.actual = newActual;
|
|
58
76
|
}
|
|
59
|
-
}
|
|
77
|
+
},
|
|
60
78
|
},
|
|
61
|
-
})
|
|
79
|
+
});
|
|
@@ -1,31 +1,48 @@
|
|
|
1
|
-
import { defineComponent } from
|
|
2
|
-
import { MediaRadio, MetadataRadio } from
|
|
3
|
-
import octopusApi from
|
|
4
|
-
import dayjs from
|
|
5
|
-
import { Podcast } from
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { MediaRadio, MetadataRadio } from "@/stores/class/general/player";
|
|
3
|
+
import octopusApi from "@saooti/octopus-api";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
import { Podcast } from "@/stores/class/general/podcast";
|
|
6
6
|
export const fetchRadioData = defineComponent({
|
|
7
7
|
data() {
|
|
8
8
|
return {
|
|
9
|
-
radioInterval: undefined as
|
|
9
|
+
radioInterval: undefined as ReturnType<typeof setTimeout> | undefined,
|
|
10
10
|
};
|
|
11
11
|
},
|
|
12
12
|
unmounted() {
|
|
13
|
-
clearInterval(
|
|
13
|
+
clearInterval(this.radioInterval as unknown as number);
|
|
14
14
|
},
|
|
15
15
|
methods: {
|
|
16
|
-
async fetchRadioMetadata(
|
|
17
|
-
|
|
16
|
+
async fetchRadioMetadata(
|
|
17
|
+
canalId: number,
|
|
18
|
+
previousTitle: string,
|
|
19
|
+
callbackMetadata: (
|
|
20
|
+
metadata: MediaRadio,
|
|
21
|
+
podcast: Podcast | undefined,
|
|
22
|
+
history?: Array<MediaRadio>,
|
|
23
|
+
) => void,
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
const metadata = await octopusApi.fetchData<MetadataRadio>(
|
|
26
|
+
14,
|
|
27
|
+
"player/playing/" + canalId,
|
|
28
|
+
);
|
|
18
29
|
const arrayMetadata = metadata.previously;
|
|
19
30
|
arrayMetadata.unshift(metadata.currently);
|
|
20
31
|
for (let index = 0, len = arrayMetadata.length; index < len; index++) {
|
|
21
|
-
if
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
if (
|
|
33
|
+
dayjs().valueOf() - 18000 >
|
|
34
|
+
dayjs(arrayMetadata[index].startDate).valueOf()
|
|
35
|
+
) {
|
|
36
|
+
if (previousTitle !== arrayMetadata[index].title) {
|
|
37
|
+
const historyIndex = index + 1 < len ? index + 1 : index;
|
|
24
38
|
const history = arrayMetadata.slice(historyIndex, len);
|
|
25
|
-
if(arrayMetadata[index].podcastId){
|
|
26
|
-
const data
|
|
39
|
+
if (arrayMetadata[index].podcastId) {
|
|
40
|
+
const data: Podcast = await octopusApi.fetchData<Podcast>(
|
|
41
|
+
0,
|
|
42
|
+
"podcast/" + arrayMetadata[index].podcastId,
|
|
43
|
+
);
|
|
27
44
|
callbackMetadata(arrayMetadata[index], data, history);
|
|
28
|
-
}else{
|
|
45
|
+
} else {
|
|
29
46
|
callbackMetadata(arrayMetadata[index], undefined, history);
|
|
30
47
|
}
|
|
31
48
|
}
|
|
@@ -33,15 +50,15 @@ export const fetchRadioData = defineComponent({
|
|
|
33
50
|
}
|
|
34
51
|
}
|
|
35
52
|
},
|
|
36
|
-
displayTitle(metadata: MediaRadio): string{
|
|
53
|
+
displayTitle(metadata: MediaRadio): string {
|
|
37
54
|
let title = "";
|
|
38
|
-
if(metadata.title){
|
|
39
|
-
title+=metadata.title;
|
|
55
|
+
if (metadata.title) {
|
|
56
|
+
title += metadata.title;
|
|
40
57
|
}
|
|
41
|
-
if(metadata.artist){
|
|
42
|
-
title+=" - "+metadata.artist;
|
|
58
|
+
if (metadata.artist) {
|
|
59
|
+
title += " - " + metadata.artist;
|
|
43
60
|
}
|
|
44
61
|
return title;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
});
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {defineComponent } from
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
2
|
export default defineComponent({
|
|
3
|
-
name:
|
|
4
|
-
|
|
5
|
-
isOuestFranceTag(tag: string): boolean{
|
|
6
|
-
return "[of]"===tag.substring(0,4);
|
|
3
|
+
name: "TagOfMixins",
|
|
4
|
+
methods: {
|
|
5
|
+
isOuestFranceTag(tag: string): boolean {
|
|
6
|
+
return "[of]" === tag.substring(0, 4);
|
|
7
7
|
},
|
|
8
|
-
formateOfTag(tag: string): string{
|
|
9
|
-
if(!this.isOuestFranceTag(tag)){
|
|
8
|
+
formateOfTag(tag: string): string {
|
|
9
|
+
if (!this.isOuestFranceTag(tag)) {
|
|
10
10
|
return tag;
|
|
11
11
|
}
|
|
12
|
-
const lastSlash = tag.lastIndexOf(
|
|
13
|
-
if(-1!==lastSlash){
|
|
12
|
+
const lastSlash = tag.lastIndexOf("/");
|
|
13
|
+
if (-1 !== lastSlash) {
|
|
14
14
|
return tag.substring(lastSlash + 1, tag.length);
|
|
15
15
|
}
|
|
16
16
|
return tag.substring(4, tag.length);
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
});
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="page-box">
|
|
3
|
+
<h1>{{ title }}</h1>
|
|
4
|
+
<PodcastList
|
|
5
|
+
:first="0"
|
|
6
|
+
:size="30"
|
|
7
|
+
:iab-id="iabId"
|
|
8
|
+
:organisation-id="orgaArray"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import PodcastList from "../display/podcasts/PodcastList.vue";
|
|
15
|
+
import { useFilterStore } from "@/stores/FilterStore";
|
|
16
|
+
import { useGeneralStore } from "@/stores/GeneralStore";
|
|
17
|
+
import { mapState } from "pinia";
|
|
18
|
+
import { defineComponent } from "vue";
|
|
19
|
+
import { Category } from "@/stores/class/general/category";
|
|
20
|
+
export default defineComponent({
|
|
21
|
+
components: {
|
|
22
|
+
PodcastList,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
iabId: { default: undefined, type: Number },
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
computed: {
|
|
29
|
+
...mapState(useGeneralStore, ["storedCategories"]),
|
|
30
|
+
...mapState(useFilterStore, ["filterOrgaId"]),
|
|
31
|
+
orgaArray(): Array<string> {
|
|
32
|
+
return this.filterOrgaId ? [this.filterOrgaId] : [];
|
|
33
|
+
},
|
|
34
|
+
title(): string {
|
|
35
|
+
const matchCategories = this.storedCategories.filter(
|
|
36
|
+
(c: Category) => c.id === this.iabId,
|
|
37
|
+
);
|
|
38
|
+
if (1 !== matchCategories.length) return "";
|
|
39
|
+
return matchCategories[0]["name"];
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
</script>
|