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