@saooti/octopus-sdk 37.0.5 → 37.0.7

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 (263) hide show
  1. package/README.md +2 -2
  2. package/index.html +1 -0
  3. package/index.ts +21 -21
  4. package/package.json +26 -20
  5. package/public/css/fonts/icomoon.eot +0 -0
  6. package/public/css/fonts/icomoon.svg +1 -1
  7. package/public/css/fonts/icomoon.ttf +0 -0
  8. package/public/css/fonts/icomoon.woff +0 -0
  9. package/public/css/fonts/montserrat/Montserrat-Black.ttf +0 -0
  10. package/public/css/fonts/montserrat/Montserrat-BlackItalic.ttf +0 -0
  11. package/public/css/fonts/montserrat/Montserrat-Bold.ttf +0 -0
  12. package/public/css/fonts/montserrat/Montserrat-BoldItalic.ttf +0 -0
  13. package/public/css/fonts/montserrat/Montserrat-ExtraBold.ttf +0 -0
  14. package/public/css/fonts/montserrat/Montserrat-ExtraBoldItalic.ttf +0 -0
  15. package/public/css/fonts/montserrat/Montserrat-ExtraLight.ttf +0 -0
  16. package/public/css/fonts/montserrat/Montserrat-ExtraLightItalic.ttf +0 -0
  17. package/public/css/fonts/montserrat/Montserrat-Italic.ttf +0 -0
  18. package/public/css/fonts/montserrat/Montserrat-Light.ttf +0 -0
  19. package/public/css/fonts/montserrat/Montserrat-LightItalic.ttf +0 -0
  20. package/public/css/fonts/montserrat/Montserrat-Medium.ttf +0 -0
  21. package/public/css/fonts/montserrat/Montserrat-MediumItalic.ttf +0 -0
  22. package/public/css/fonts/montserrat/Montserrat-Regular.ttf +0 -0
  23. package/public/css/fonts/montserrat/Montserrat-SemiBold.ttf +0 -0
  24. package/public/css/fonts/montserrat/Montserrat-SemiBoldItalic.ttf +0 -0
  25. package/public/css/fonts/montserrat/Montserrat-Thin.ttf +0 -0
  26. package/public/css/fonts/montserrat/Montserrat-ThinItalic.ttf +0 -0
  27. package/public/css/fonts/montserrat/style.css +28 -0
  28. package/public/css/fonts/style.css +5 -5
  29. package/src/App.vue +69 -60
  30. package/src/api/classicCrud.ts +12 -12
  31. package/src/api/initialize.ts +1 -1
  32. package/src/assets/bootstrap.scss +9 -0
  33. package/src/assets/general.scss +1 -1
  34. package/src/assets/share.scss +1 -1
  35. package/src/components/display/aggregator/RssSection.vue +3 -3
  36. package/src/components/display/categories/CategoryChooser.vue +73 -60
  37. package/src/components/display/categories/CategoryFilter.vue +134 -90
  38. package/src/components/display/categories/CategoryList.vue +76 -62
  39. package/src/components/display/comments/AddCommentModal.vue +44 -44
  40. package/src/components/display/comments/CommentBasicView.vue +38 -30
  41. package/src/components/display/comments/CommentInput.vue +122 -110
  42. package/src/components/display/comments/CommentItem.vue +144 -102
  43. package/src/components/display/comments/CommentList.vue +117 -85
  44. package/src/components/display/comments/CommentParentInfo.vue +18 -15
  45. package/src/components/display/comments/CommentPlayer.vue +39 -41
  46. package/src/components/display/comments/CommentSection.vue +68 -53
  47. package/src/components/display/edit/EditBox.vue +7 -7
  48. package/src/components/display/edit/EditBoxRadio.vue +3 -4
  49. package/src/components/display/edit/EditCommentBox.vue +34 -36
  50. package/src/components/display/emission/EmissionInlineList.vue +75 -63
  51. package/src/components/display/emission/EmissionItem.vue +47 -35
  52. package/src/components/display/emission/EmissionList.vue +111 -83
  53. package/src/components/display/emission/EmissionPlayerItem.vue +89 -89
  54. package/src/components/display/filter/AdvancedSearch.vue +81 -73
  55. package/src/components/display/filter/CategorySearchFilter.vue +27 -25
  56. package/src/components/display/filter/DateFilter.vue +38 -38
  57. package/src/components/display/filter/MonetizableFilter.vue +16 -14
  58. package/src/components/display/filter/ProductorSearch.vue +55 -47
  59. package/src/components/display/filter/RubriqueChoice.vue +42 -27
  60. package/src/components/display/filter/RubriqueFilter.vue +130 -85
  61. package/src/components/display/filter/SearchOrder.vue +16 -11
  62. package/src/components/display/list/ListPaginate.vue +72 -70
  63. package/src/components/display/list/PaginateParams.vue +29 -30
  64. package/src/components/display/list/PaginateSection.vue +210 -0
  65. package/src/components/display/list/SwiperList.vue +28 -32
  66. package/src/components/display/live/CountDown.vue +12 -14
  67. package/src/components/display/live/LiveHorizontalList.vue +60 -50
  68. package/src/components/display/live/LiveItem.vue +42 -26
  69. package/src/components/display/live/LiveList.vue +92 -65
  70. package/src/components/display/live/RadioCurrently.vue +47 -42
  71. package/src/components/display/live/RadioImage.vue +40 -42
  72. package/src/components/display/live/RadioItem.vue +15 -22
  73. package/src/components/display/live/RadioList.vue +24 -21
  74. package/src/components/display/live/RadioPlanning.vue +105 -68
  75. package/src/components/display/organisation/OrganisationChooser.vue +58 -42
  76. package/src/components/display/organisation/OrganisationChooserLight.vue +27 -19
  77. package/src/components/display/participant/ParticipantItem.vue +89 -76
  78. package/src/components/display/participant/ParticipantList.vue +90 -60
  79. package/src/components/display/playlist/PlaylistItem.vue +32 -35
  80. package/src/components/display/playlist/PlaylistList.vue +70 -52
  81. package/src/components/display/playlist/PodcastList.vue +61 -50
  82. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +47 -38
  83. package/src/components/display/podcasts/AnimatorsItem.vue +17 -15
  84. package/src/components/display/podcasts/ParticipantDescription.vue +21 -22
  85. package/src/components/display/podcasts/PodcastFilterList.vue +28 -26
  86. package/src/components/display/podcasts/PodcastImage.vue +129 -138
  87. package/src/components/display/podcasts/PodcastInlineList.vue +33 -29
  88. package/src/components/display/podcasts/PodcastInlineListClassic.vue +91 -71
  89. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +94 -85
  90. package/src/components/display/podcasts/PodcastItem.vue +96 -90
  91. package/src/components/display/podcasts/PodcastItemInfo.vue +63 -65
  92. package/src/components/display/podcasts/PodcastList.vue +115 -84
  93. package/src/components/display/podcasts/PodcastModuleBox.vue +95 -104
  94. package/src/components/display/podcasts/PodcastPlayBar.vue +45 -32
  95. package/src/components/display/podcasts/PodcastSwiperList.vue +65 -55
  96. package/src/components/display/podcasts/TagList.vue +33 -37
  97. package/src/components/display/rubriques/RubriqueChooser.vue +70 -51
  98. package/src/components/display/rubriques/RubriqueList.vue +117 -89
  99. package/src/components/display/sharing/PlayerParameters.vue +45 -42
  100. package/src/components/display/sharing/QrCode.vue +52 -46
  101. package/src/components/display/sharing/ShareButtons.vue +25 -27
  102. package/src/components/display/sharing/ShareButtonsIntern.vue +182 -155
  103. package/src/components/display/sharing/ShareDistribution.vue +101 -67
  104. package/src/components/display/sharing/SharePlayer.vue +207 -127
  105. package/src/components/display/sharing/SharePlayerColors.vue +15 -15
  106. package/src/components/display/sharing/SharePlayerRadio.vue +62 -39
  107. package/src/components/display/sharing/SharePlayerTypes.vue +93 -55
  108. package/src/components/display/sharing/SubscribeButtons.vue +83 -32
  109. package/src/components/display/studio/RecordingItemButton.vue +3 -3
  110. package/src/components/form/ClassicCheckbox.vue +32 -31
  111. package/src/components/form/ClassicDatePicker.vue +47 -49
  112. package/src/components/form/ClassicInputText.vue +99 -98
  113. package/src/components/form/ClassicLoading.vue +11 -14
  114. package/src/components/form/ClassicMultiselect.vue +125 -126
  115. package/src/components/form/ClassicRadio.vue +15 -18
  116. package/src/components/form/ClassicSearch.vue +17 -23
  117. package/src/components/form/ClassicSelect.vue +35 -27
  118. package/src/components/form/{Wysiwyg.vue → ClassicWysiwyg.vue} +94 -109
  119. package/src/components/misc/AcpmImage.vue +26 -0
  120. package/src/components/misc/ClassicAccordion.vue +69 -0
  121. package/src/components/misc/ClassicNav.vue +117 -0
  122. package/src/components/misc/ClassicPopover.vue +212 -0
  123. package/src/components/misc/{Spinner.vue → ClassicSpinner.vue} +14 -15
  124. package/src/components/misc/ErrorMessage.vue +9 -17
  125. package/src/components/misc/FooterSection.vue +198 -0
  126. package/src/components/misc/HomeDropdown.vue +67 -64
  127. package/src/components/misc/LeftMenu.vue +115 -79
  128. package/src/components/misc/ProgressBar.vue +36 -32
  129. package/src/components/misc/SnackBar.vue +169 -0
  130. package/src/components/misc/TopBar.vue +161 -115
  131. package/src/components/misc/modal/ClassicModal.vue +99 -103
  132. package/src/components/misc/modal/ClipboardModal.vue +21 -23
  133. package/src/components/misc/modal/MessageModal.vue +22 -28
  134. package/src/components/misc/modal/NewsletterModal.vue +139 -113
  135. package/src/components/misc/modal/QrCodeModal.vue +14 -17
  136. package/src/components/misc/modal/ShareModalPlayer.vue +44 -60
  137. package/src/components/misc/player/PlayerCompact.vue +47 -62
  138. package/src/components/misc/player/{Player.vue → PlayerComponent.vue} +54 -46
  139. package/src/components/misc/player/PlayerLarge.vue +66 -62
  140. package/src/components/misc/player/PlayerProgressBar.vue +40 -30
  141. package/src/components/misc/player/PlayerTimeline.vue +32 -36
  142. package/src/components/misc/player/radio/RadioHistory.vue +62 -59
  143. package/src/components/misc/player/radio/RadioProgressBar.vue +44 -35
  144. package/src/components/mixins/cookies.ts +11 -10
  145. package/src/components/mixins/displayMethods.ts +5 -4
  146. package/src/components/mixins/handle403.ts +9 -9
  147. package/src/components/mixins/imageProxy.ts +14 -7
  148. package/src/components/mixins/init.ts +31 -16
  149. package/src/components/mixins/orgaComputed.ts +7 -7
  150. package/src/components/mixins/organisationFilter.ts +36 -22
  151. package/src/components/mixins/player/playerComment.ts +46 -37
  152. package/src/components/mixins/player/playerDisplay.ts +122 -87
  153. package/src/components/mixins/player/playerLive.ts +65 -43
  154. package/src/components/mixins/player/playerLogic.ts +133 -88
  155. package/src/components/mixins/player/playerTranscript.ts +48 -30
  156. package/src/components/mixins/radio/fetchRadioData.ts +40 -23
  157. package/src/components/mixins/selenium.ts +2 -2
  158. package/src/components/mixins/tagOfMixins.ts +11 -11
  159. package/src/components/pages/CategoryPage.vue +43 -0
  160. package/src/components/pages/{Emission.vue → EmissionPage.vue} +98 -67
  161. package/src/components/pages/{Emissions.vue → EmissionsPage.vue} +51 -44
  162. package/src/components/pages/Error403Page.vue +20 -19
  163. package/src/components/pages/HomePage.vue +144 -0
  164. package/src/components/pages/LivesPage.vue +66 -0
  165. package/src/components/pages/PageNotFound.vue +33 -22
  166. package/src/components/pages/{Participant.vue → ParticipantPage.vue} +63 -49
  167. package/src/components/pages/{Participants.vue → ParticipantsPage.vue} +9 -9
  168. package/src/components/pages/PlaylistPage.vue +175 -0
  169. package/src/components/pages/{Playlists.vue → PlaylistsPage.vue} +16 -14
  170. package/src/components/pages/PodcastPage.vue +365 -0
  171. package/src/components/pages/PodcastsPage.vue +152 -0
  172. package/src/components/pages/RadioPage.vue +131 -0
  173. package/src/components/pages/RubriquePage.vue +45 -0
  174. package/src/components/pages/{Search.vue → SearchPage.vue} +19 -19
  175. package/src/helper/dom.ts +1 -1
  176. package/src/helper/duration.ts +10 -4
  177. package/src/helper/useEventListener.ts +7 -8
  178. package/src/i18n.ts +31 -30
  179. package/src/locale/de.ts +263 -257
  180. package/src/locale/educationen.ts +13 -13
  181. package/src/locale/educationfr.ts +1 -1
  182. package/src/locale/en.ts +323 -324
  183. package/src/locale/es.ts +325 -318
  184. package/src/locale/fr.ts +330 -324
  185. package/src/locale/it.ts +332 -328
  186. package/src/locale/messages.ts +9 -9
  187. package/src/locale/sl.ts +315 -319
  188. package/src/main.ts +28 -31
  189. package/src/router/router.ts +218 -198
  190. package/src/shims-tsx.d.ts +1 -1
  191. package/src/shims-vue.d.ts +1 -1
  192. package/src/stores/ApiStore.ts +44 -44
  193. package/src/stores/AuthStore.ts +24 -16
  194. package/src/stores/CommentStore.ts +13 -11
  195. package/src/stores/FilterStore.ts +25 -15
  196. package/src/stores/GeneralStore.ts +15 -15
  197. package/src/stores/ParamSdkStore.ts +179 -137
  198. package/src/stores/PlayerStore.ts +139 -125
  199. package/src/stores/class/adserver/adserverConfig.ts +1 -1
  200. package/src/stores/class/adserver/adserverOtherEmission.ts +9 -9
  201. package/src/stores/class/cartouchier/cartouche.ts +4 -4
  202. package/src/stores/class/cartouchier/cartouchier.ts +2 -2
  203. package/src/stores/class/conference/conference.ts +10 -9
  204. package/src/stores/class/conference/conferenceMessage.ts +2 -2
  205. package/src/stores/class/conference/conferenceParticipant.ts +1 -1
  206. package/src/stores/class/conference/studioCall.ts +6 -6
  207. package/src/stores/class/contract/contractOrganisation.ts +5 -5
  208. package/src/stores/class/ftp/ftpEmission.ts +9 -9
  209. package/src/stores/class/ftp/testFtpEmission.ts +4 -4
  210. package/src/stores/class/general/audioView.ts +19 -19
  211. package/src/stores/class/general/category.ts +1 -1
  212. package/src/stores/class/general/classicSelectType.ts +2 -3
  213. package/src/stores/class/general/customPlayer.ts +8 -8
  214. package/src/stores/class/general/emission.ts +20 -21
  215. package/src/stores/class/general/fetchParam.ts +8 -2
  216. package/src/stores/class/general/initState.ts +31 -31
  217. package/src/stores/class/general/interfacePageable.ts +13 -13
  218. package/src/stores/class/general/ituneCategory.ts +4 -4
  219. package/src/stores/class/general/listReturn.ts +12 -12
  220. package/src/stores/class/general/media.ts +7 -7
  221. package/src/stores/class/general/organisation.ts +9 -10
  222. package/src/stores/class/general/pageable.ts +10 -10
  223. package/src/stores/class/general/participant.ts +7 -7
  224. package/src/stores/class/general/player.ts +30 -28
  225. package/src/stores/class/general/playlist.ts +17 -19
  226. package/src/stores/class/general/podcast.ts +19 -19
  227. package/src/stores/class/general/sortPageable.ts +4 -4
  228. package/src/stores/class/general/soundcastCategory.ts +7 -7
  229. package/src/stores/class/ouestFrance/ofTag.ts +34 -34
  230. package/src/stores/class/ouestFrance/ofTagInfo.ts +9 -9
  231. package/src/stores/class/ouestFrance/ofTagPage.ts +7 -7
  232. package/src/stores/class/ouestFrance/ofTagSeo.ts +7 -7
  233. package/src/stores/class/ouestFrance/ofTagVente.ts +6 -6
  234. package/src/stores/class/ouestFrance/ofTagWithParents.ts +20 -20
  235. package/src/stores/class/radio/canal.ts +4 -4
  236. package/src/stores/class/radio/live.ts +6 -6
  237. package/src/stores/class/radio/mix.ts +16 -16
  238. package/src/stores/class/radio/playlistMedia.ts +7 -7
  239. package/src/stores/class/radio/recurrence.ts +54 -54
  240. package/src/stores/class/rss/rssEmission.ts +13 -13
  241. package/src/stores/class/rss/rssInfo.ts +7 -7
  242. package/src/stores/class/rubrique/rubriquage.ts +2 -2
  243. package/src/stores/class/rubrique/rubrique.ts +1 -1
  244. package/src/stores/class/stat/statArrayIncome.ts +5 -5
  245. package/src/stores/class/stat/statArrayObject.ts +26 -26
  246. package/src/stores/class/stat/statGraph.ts +6 -6
  247. package/src/stores/class/user/person.ts +4 -2
  248. package/src/stores/class/user/profile.ts +4 -2
  249. package/src/stores/class/user/userKeycloak.ts +4 -5
  250. package/src/components/display/list/Paginate.vue +0 -181
  251. package/src/components/misc/Accordion.vue +0 -78
  252. package/src/components/misc/Footer.vue +0 -165
  253. package/src/components/misc/Nav.vue +0 -119
  254. package/src/components/misc/Popover.vue +0 -193
  255. package/src/components/misc/Snackbar.vue +0 -168
  256. package/src/components/pages/Category.vue +0 -41
  257. package/src/components/pages/Home.vue +0 -125
  258. package/src/components/pages/Lives.vue +0 -64
  259. package/src/components/pages/Playlist.vue +0 -164
  260. package/src/components/pages/Podcast.vue +0 -307
  261. package/src/components/pages/Podcasts.vue +0 -146
  262. package/src/components/pages/Radio.vue +0 -122
  263. package/src/components/pages/Rubrique.vue +0 -42
@@ -1,44 +1,58 @@
1
-
2
- import { handle403 } from '../mixins/handle403';
1
+ import { handle403 } from "../mixins/handle403";
3
2
  import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
4
- import octopusApi from '@saooti/octopus-api';
5
- import { useFilterStore } from '@/stores/FilterStore';
6
- import { mapActions } from 'pinia';
7
- import { defineComponent } from 'vue';
8
- import { AxiosError } from 'axios';
9
- import { Organisation } from '@/stores/class/general/organisation';
3
+ import octopusApi from "@saooti/octopus-api";
4
+ import { useFilterStore } from "@/stores/FilterStore";
5
+ import { mapActions } from "pinia";
6
+ import { defineComponent } from "vue";
7
+ import { AxiosError } from "axios";
8
+ import { Organisation } from "@/stores/class/general/organisation";
10
9
  export default defineComponent({
11
10
  mixins: [handle403],
12
11
  methods: {
13
- ...mapActions(useFilterStore, ['filterUpdateOrga']),
12
+ ...mapActions(useFilterStore, ["filterUpdateOrga"]),
14
13
  async selectOrganisation(organisationId: string): Promise<void> {
15
14
  try {
16
- const response = await octopusApi.fetchData<Organisation>(0,`organisation/${organisationId}`);
17
- const data = await octopusApi.fetchDataWithParams<Array<Rubriquage>>(0, 'rubriquage/find/'+organisationId,{
18
- sort:'HOMEPAGEORDER',
19
- homePageOrder: true
20
- }, true);
21
- const isLive = await octopusApi.fetchData<boolean>(0, 'organisation/liveEnabled/'+organisationId);
15
+ const response = await octopusApi.fetchData<Organisation>(
16
+ 0,
17
+ `organisation/${organisationId}`,
18
+ );
19
+ const data = await octopusApi.fetchDataWithParams<Array<Rubriquage>>(
20
+ 0,
21
+ "rubriquage/find/" + organisationId,
22
+ {
23
+ sort: "HOMEPAGEORDER",
24
+ homePageOrder: true,
25
+ },
26
+ true,
27
+ );
28
+ const isLive = await octopusApi.fetchData<boolean>(
29
+ 0,
30
+ "organisation/liveEnabled/" + organisationId,
31
+ );
22
32
  this.filterUpdateOrga({
23
33
  orgaId: organisationId,
24
34
  imgUrl: response.imageUrl,
25
35
  name: response.name,
26
- rubriquageArray: data.filter((element: Rubriquage)=>{
36
+ rubriquageArray: data.filter((element: Rubriquage) => {
27
37
  return element.rubriques.length;
28
38
  }),
29
- isLive: isLive
39
+ isLive: isLive,
30
40
  });
31
41
  const queries = this.$route.query;
32
- this.$router.replace({ query: {...queries, ...{productor: organisationId} } });
42
+ this.$router.replace({
43
+ query: { ...queries, ...{ productor: organisationId } },
44
+ });
33
45
  } catch (error) {
34
- this.handle403((error as AxiosError));
46
+ this.handle403(error as AxiosError);
35
47
  }
36
48
  },
37
- removeSelectedOrga(): void{
49
+ removeSelectedOrga(): void {
38
50
  if (this.$route.query.productor) {
39
- this.$router.push({ query: {...this.$route.query, ...{productor: undefined} } });
51
+ this.$router.push({
52
+ query: { ...this.$route.query, ...{ productor: undefined } },
53
+ });
40
54
  }
41
55
  this.filterUpdateOrga({ orgaId: undefined });
42
- }
56
+ },
43
57
  },
44
58
  });
@@ -1,12 +1,12 @@
1
- import { state } from '../../../stores/ParamSdkStore';
2
- import octopusApi from '@saooti/octopus-api';
3
- import { CommentPodcast } from '@/stores/class/general/comment';
4
- import { defineComponent } from 'vue';
5
- import { usePlayerStore } from '@/stores/PlayerStore';
6
- import { useCommentStore } from '@/stores/CommentStore';
7
- import { mapState } from 'pinia';
8
- import { FetchParam } from '@/stores/class/general/fetchParam';
9
- import { InterfacePageable } from '@/stores/class/general/interfacePageable';
1
+ import { state } from "../../../stores/ParamSdkStore";
2
+ import octopusApi from "@saooti/octopus-api";
3
+ import { CommentPodcast } from "@/stores/class/general/comment";
4
+ import { defineComponent } from "vue";
5
+ import { usePlayerStore } from "@/stores/PlayerStore";
6
+ import { useCommentStore } from "@/stores/CommentStore";
7
+ import { mapState } from "pinia";
8
+ import { FetchParam } from "@/stores/class/general/fetchParam";
9
+ import { InterfacePageable } from "@/stores/class/general/interfacePageable";
10
10
  export const playerComment = defineComponent({
11
11
  data() {
12
12
  return {
@@ -14,9 +14,13 @@ export const playerComment = defineComponent({
14
14
  };
15
15
  },
16
16
  computed: {
17
- ...mapState(useCommentStore, ['commentActualPodcastId', 'commentTotalCount', 'commentLoaded']),
18
- ...mapState(usePlayerStore, ['playerPodcast', 'playerLive']),
19
- organisationId(): string|undefined {
17
+ ...mapState(useCommentStore, [
18
+ "commentActualPodcastId",
19
+ "commentTotalCount",
20
+ "commentLoaded",
21
+ ]),
22
+ ...mapState(usePlayerStore, ["playerPodcast", "playerLive"]),
23
+ organisationId(): string | undefined {
20
24
  return state.generalParameters.organisationId;
21
25
  },
22
26
  },
@@ -28,13 +32,14 @@ export const playerComment = defineComponent({
28
32
  },
29
33
  methods: {
30
34
  editRight(organisation: string): boolean {
31
- return (true===state.generalParameters.isCommments && this.organisationId === organisation) || true===state.generalParameters.isAdmin;
35
+ return (
36
+ (true === state.generalParameters.isCommments &&
37
+ this.organisationId === organisation) ||
38
+ true === state.generalParameters.isAdmin
39
+ );
32
40
  },
33
- initCommentCurrentPodcast(podcastId?: number): Array<number>{
34
- if (
35
- podcastId &&
36
- this.commentActualPodcastId === podcastId
37
- ) {
41
+ initCommentCurrentPodcast(podcastId?: number): Array<number> {
42
+ if (podcastId && this.commentActualPodcastId === podcastId) {
38
43
  this.comments = this.commentLoaded;
39
44
  if (
40
45
  this.commentLoaded &&
@@ -45,7 +50,12 @@ export const playerComment = defineComponent({
45
50
  }
46
51
  return [0, 0];
47
52
  },
48
- async fetchComments(first: number, count:number,podcastId?:number,organisation?:string){
53
+ async fetchComments(
54
+ first: number,
55
+ count: number,
56
+ podcastId?: number,
57
+ organisation?: string,
58
+ ) {
49
59
  const size = 50;
50
60
  while (0 === first || this.comments.length < count) {
51
61
  const param: FetchParam = {
@@ -53,15 +63,19 @@ export const playerComment = defineComponent({
53
63
  size: size,
54
64
  podcastId: podcastId,
55
65
  };
56
- if (!this.editRight(organisation? organisation : '')) {
57
- param.status = ['Valid'];
66
+ if (!this.editRight(organisation ? organisation : "")) {
67
+ param.status = ["Valid"];
58
68
  }
59
- const data = await octopusApi.postDataPublic<InterfacePageable<CommentPodcast>>(2, 'getRootCom',param);
69
+ const data = await octopusApi.postDataPublic<
70
+ InterfacePageable<CommentPodcast>
71
+ >(2, "getRootCom", param);
60
72
  first += size;
61
73
  count = data.totalElements;
62
- this.comments = this.comments.concat(data.content).filter((c: CommentPodcast) => {
63
- return null !== c;
64
- });
74
+ this.comments = this.comments
75
+ .concat(data.content)
76
+ .filter((c: CommentPodcast) => {
77
+ return null !== c;
78
+ });
65
79
  }
66
80
  },
67
81
  async initComments(refresh = false): Promise<void> {
@@ -73,24 +87,19 @@ export const playerComment = defineComponent({
73
87
  podcastId = this.playerLive.podcastId;
74
88
  organisation = this.playerLive.organisation.id;
75
89
  }
76
- if (
77
- refresh &&
78
- podcastId &&
79
- this.commentActualPodcastId !== podcastId
80
- ) {
90
+ if (refresh && podcastId && this.commentActualPodcastId !== podcastId) {
81
91
  return;
82
92
  }
83
- const param= this.initCommentCurrentPodcast(podcastId);
84
- let first = param[0];
85
- let count = param[1];
93
+ const param = this.initCommentCurrentPodcast(podcastId);
94
+ const first = param[0];
95
+ const count = param[1];
86
96
  if (
87
- (!podcastId ||
88
- this.commentActualPodcastId === podcastId) &&
97
+ (!podcastId || this.commentActualPodcastId === podcastId) &&
89
98
  0 === first
90
- ){
99
+ ) {
91
100
  return;
92
101
  }
93
102
  await this.fetchComments(first, count, podcastId, organisation);
94
103
  },
95
104
  },
96
- })
105
+ });
@@ -1,134 +1,169 @@
1
- import { state } from '../../../stores/ParamSdkStore';
2
- import { defineComponent } from 'vue';
3
- import { RouteLocationRaw } from 'vue-router';
4
- import {fetchRadioData} from '../../mixins/radio/fetchRadioData';
5
- import { MediaRadio } from '@/stores/class/general/player';
6
- import { usePlayerStore } from '@/stores/PlayerStore';
7
- import { useFilterStore } from '@/stores/FilterStore';
8
- import { mapState, mapActions } from 'pinia';
9
- import { Podcast } from '@/stores/class/general/podcast';
1
+ import { state } from "../../../stores/ParamSdkStore";
2
+ import { defineComponent } from "vue";
3
+ import { RouteLocationRaw } from "vue-router";
4
+ import { fetchRadioData } from "../../mixins/radio/fetchRadioData";
5
+ import { MediaRadio } from "@/stores/class/general/player";
6
+ import { usePlayerStore } from "@/stores/PlayerStore";
7
+ import { useFilterStore } from "@/stores/FilterStore";
8
+ import { mapState, mapActions } from "pinia";
9
+ import { Podcast } from "@/stores/class/general/podcast";
10
10
  export const playerDisplay = defineComponent({
11
- props: {
12
- hlsReady: { default: false , type: Boolean},
13
- },
14
11
  mixins: [fetchRadioData],
12
+ props: {
13
+ hlsReady: { default: false, type: Boolean },
14
+ },
15
15
  data() {
16
16
  return {
17
- radioInterval: undefined as ReturnType<typeof setTimeout>|undefined,
17
+ radioInterval: undefined as ReturnType<typeof setTimeout> | undefined,
18
18
  };
19
19
  },
20
- computed:{
20
+ computed: {
21
21
  ...mapState(usePlayerStore, [
22
- 'playerPodcast',
23
- 'playerRadio',
24
- 'playerLive',
25
- 'playerMedia',
26
- 'playedTime',
27
- 'totalTime',
28
- 'isPlaying',
29
- 'isPaused',
30
- 'podcastImage',
31
- 'emissionName',
32
- 'transcriptText',
33
- 'radioUrl'
22
+ "playerPodcast",
23
+ "playerRadio",
24
+ "playerLive",
25
+ "playerMedia",
26
+ "playedTime",
27
+ "totalTime",
28
+ "isPlaying",
29
+ "isPaused",
30
+ "podcastImage",
31
+ "emissionName",
32
+ "transcriptText",
33
+ "radioUrl",
34
34
  ]),
35
- ...mapState(useFilterStore, ['filterOrgaId']),
36
- isImage(): boolean {
37
- return (state.player.image as boolean);
38
- },
39
- podcastShareUrl(): RouteLocationRaw|string {
40
- if(this.playerRadio?.podcast?.podcastId){
35
+ ...mapState(useFilterStore, ["filterOrgaId"]),
36
+ isImage(): boolean {
37
+ return state.player.image as boolean;
38
+ },
39
+ podcastShareUrl(): RouteLocationRaw | string {
40
+ if (this.playerRadio?.podcast?.podcastId) {
41
41
  return {
42
- name: 'podcast',
43
- params: { podcastId: this.playerRadio?.podcast?.podcastId.toString() },
44
- query: { productor: this.filterOrgaId },
45
- };
42
+ name: "podcast",
43
+ params: {
44
+ podcastId: this.playerRadio?.podcast?.podcastId.toString(),
45
+ },
46
+ query: { productor: this.filterOrgaId },
47
+ };
46
48
  }
47
- if (this.playerPodcast) {
48
- return {
49
- name: 'podcast',
50
- params: { podcastId: this.playerPodcast.podcastId.toString() },
51
- query: { productor: this.filterOrgaId },
52
- };
53
- }
54
- return '';
55
- },
56
- isEmissionName(): boolean {
57
- return (state.player.emissionName as boolean);
49
+ if (this.playerPodcast) {
50
+ return {
51
+ name: "podcast",
52
+ params: { podcastId: this.playerPodcast.podcastId.toString() },
53
+ query: { productor: this.filterOrgaId },
54
+ };
55
+ }
56
+ return "";
57
+ },
58
+ isEmissionName(): boolean {
59
+ return state.player.emissionName as boolean;
58
60
  },
59
- podcastTitle(): string {
60
- if(this.playerRadio){
61
- if(this.playerRadio.podcast){
61
+ podcastTitle(): string {
62
+ if (this.playerRadio) {
63
+ if (this.playerRadio.podcast) {
62
64
  return this.playerRadio.podcast.title;
63
65
  }
64
66
  return this.displayTitle(this.playerRadio.metadata);
65
67
  }
66
68
  if (this.playerPodcast) {
67
69
  if (this.isEmissionName)
68
- return this.emissionName + ' - ' + this.playerPodcast.title;
70
+ return this.emissionName + " - " + this.playerPodcast.title;
69
71
  return this.playerPodcast.title;
70
72
  }
71
73
  if (this.playerMedia) return this.playerMedia.title;
72
74
  if (this.playerLive) {
73
75
  if (!this.hlsReady)
74
- return this.playerLive.title + ' (' + this.$t('Start in a while') + ')';
76
+ return (
77
+ this.playerLive.title + " (" + this.$t("Start in a while") + ")"
78
+ );
75
79
  return this.playerLive.title;
76
80
  }
77
- return '';
81
+ return "";
78
82
  },
79
- },
80
- watch:{
83
+ },
84
+ watch: {
81
85
  playerRadio: {
82
86
  deep: true,
83
- immediate:true,
84
- handler(newValue,oldValue){
85
- if(oldValue && newValue && newValue.canalId === oldValue.canalId){return;}
86
- clearInterval((this.radioInterval as unknown as number));
87
- if(this.playerRadio){
87
+ immediate: true,
88
+ handler(newValue, oldValue) {
89
+ if (oldValue && newValue && newValue.canalId === oldValue.canalId) {
90
+ return;
91
+ }
92
+ clearInterval(this.radioInterval as unknown as number);
93
+ if (this.playerRadio) {
88
94
  this.fetchCurrentlyPlaying();
89
95
  this.radioInterval = setInterval(() => {
90
96
  this.fetchCurrentlyPlaying();
91
97
  }, 10000);
92
98
  }
93
- }
99
+ },
94
100
  },
95
101
  },
96
- created(){
97
- window.addEventListener('keydown', this.addKeyboardControl);
102
+ created() {
103
+ window.addEventListener("keydown", this.addKeyboardControl);
98
104
  },
99
105
  beforeUnmount() {
100
- window.removeEventListener('keydown', this.addKeyboardControl);
106
+ window.removeEventListener("keydown", this.addKeyboardControl);
101
107
  },
102
108
  methods: {
103
- ...mapActions(usePlayerStore, ['playerMetadata', 'playerChangeStatus', 'playerRadioPodcast']),
104
- async fetchCurrentlyPlaying(): Promise<void>{
105
- this.fetchRadioMetadata(this.playerRadio?.canalId??0,this.playerRadio?.metadata.title??"", this.updateMetadata);
109
+ ...mapActions(usePlayerStore, [
110
+ "playerMetadata",
111
+ "playerChangeStatus",
112
+ "playerRadioPodcast",
113
+ ]),
114
+ async fetchCurrentlyPlaying(): Promise<void> {
115
+ this.fetchRadioMetadata(
116
+ this.playerRadio?.canalId ?? 0,
117
+ this.playerRadio?.metadata.title ?? "",
118
+ this.updateMetadata,
119
+ );
106
120
  },
107
- updateMetadata(metadata: MediaRadio, podcast:Podcast|undefined, history?: Array<MediaRadio>): void{
108
- this.playerMetadata(metadata, history??[]);
121
+ updateMetadata(
122
+ metadata: MediaRadio,
123
+ podcast: Podcast | undefined,
124
+ history?: Array<MediaRadio>,
125
+ ): void {
126
+ this.playerMetadata(metadata, history ?? []);
109
127
  this.playerRadioPodcast(podcast);
110
128
  },
111
- addKeyboardControl(event: KeyboardEvent): void{
112
- if(!event || null ===event){return;}
113
- const element = event.target as HTMLElement;
114
- if (!element || 'INPUT' == element.tagName.toUpperCase() || 'TEXTAREA' == element.tagName.toUpperCase()){return;}
115
- if (' ' === event.key || 'Spacebar' === event.key) {
129
+ addKeyboardControl(event: KeyboardEvent): void {
130
+ if (!event || null === event) {
131
+ return;
132
+ }
133
+ const element = event.target as HTMLElement;
134
+ if (
135
+ !element ||
136
+ "INPUT" == element.tagName.toUpperCase() ||
137
+ "TEXTAREA" == element.tagName.toUpperCase()
138
+ ) {
139
+ return;
140
+ }
141
+ if (" " === event.key || "Spacebar" === event.key) {
116
142
  event.preventDefault();
117
143
  this.switchPausePlay();
118
- }else if ('ArrowRight' === event.key && event.ctrlKey) {
119
- const audioPlayer: HTMLAudioElement|null = document.querySelector('#audio-player');
120
- if(!audioPlayer){return;}
144
+ } else if ("ArrowRight" === event.key && event.ctrlKey) {
145
+ const audioPlayer: HTMLAudioElement | null =
146
+ document.querySelector("#audio-player");
147
+ if (!audioPlayer) {
148
+ return;
149
+ }
121
150
  audioPlayer.currentTime += 15;
122
- }else if ('ArrowLeft' === event.key && event.ctrlKey) {
123
- const audioPlayer: HTMLAudioElement|null = document.querySelector('#audio-player');
124
- if(!audioPlayer){return;}
125
- audioPlayer.currentTime -=15;
126
- }
151
+ } else if ("ArrowLeft" === event.key && event.ctrlKey) {
152
+ const audioPlayer: HTMLAudioElement | null =
153
+ document.querySelector("#audio-player");
154
+ if (!audioPlayer) {
155
+ return;
156
+ }
157
+ audioPlayer.currentTime -= 15;
158
+ }
127
159
  },
128
- switchPausePlay(): void {
129
- const audioPlayer: HTMLAudioElement|null = document.querySelector('#audio-player');
130
- if(!audioPlayer){return;}
160
+ switchPausePlay(): void {
161
+ const audioPlayer: HTMLAudioElement | null =
162
+ document.querySelector("#audio-player");
163
+ if (!audioPlayer) {
164
+ return;
165
+ }
131
166
  this.playerChangeStatus(!audioPlayer.paused);
132
167
  },
133
- }
134
- });
168
+ },
169
+ });
@@ -1,12 +1,12 @@
1
- import { state } from '../../../stores/ParamSdkStore';
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';
1
+ import { state } from "../../../stores/ParamSdkStore";
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";
6
6
  /* eslint-disable */
7
7
  let Hls:any = null;
8
8
  /* eslint-enable */
9
- import { defineComponent } from 'vue';
9
+ import { defineComponent } from "vue";
10
10
  export const playerLive = defineComponent({
11
11
  data() {
12
12
  return {
@@ -14,21 +14,21 @@ export const playerLive = defineComponent({
14
14
  notListenTime: 0 as number,
15
15
  lastSend: 0 as number,
16
16
  hlsReady: false as boolean,
17
- downloadId: null as string|null,
18
- audioElement: null as HTMLAudioElement|null,
17
+ downloadId: null as string | null,
18
+ audioElement: null as HTMLAudioElement | null,
19
19
  hls: null as any,
20
20
  };
21
21
  },
22
22
  computed: {
23
- ...mapState(usePlayerStore, ['playerLive', 'playerRadio']),
24
- ...mapState(useAuthStore, ['authOrgaId'])
23
+ ...mapState(usePlayerStore, ["playerLive", "playerRadio"]),
24
+ ...mapState(useAuthStore, ["authOrgaId"]),
25
25
  },
26
26
  methods: {
27
- ...mapActions(usePlayerStore, ['playerChangeStatus']),
27
+ ...mapActions(usePlayerStore, ["playerChangeStatus"]),
28
28
  onPlay(): void {
29
29
  this.playerChangeStatus(false);
30
30
  },
31
- playRadio(){
31
+ playRadio() {
32
32
  if (!this.playerRadio) return;
33
33
  this.playHls(this.playerRadio.url);
34
34
  },
@@ -37,10 +37,12 @@ export const playerLive = defineComponent({
37
37
  const hlsStreamUrl = `${state.podcastPage.hlsUri}live/dev.${this.playerLive.conferenceId}/index.m3u8`;
38
38
  this.playHls(hlsStreamUrl);
39
39
  },
40
- async playHls(hlsStreamUrl: string): Promise<void>{
40
+ async playHls(hlsStreamUrl: string): Promise<void> {
41
41
  try {
42
- this.audioElement = (document.getElementById('audio-player') as HTMLAudioElement);
43
- if(null===this.audioElement){
42
+ this.audioElement = document.getElementById(
43
+ "audio-player",
44
+ ) as HTMLAudioElement;
45
+ if (null === this.audioElement) {
44
46
  setTimeout(() => {
45
47
  this.playHls(hlsStreamUrl);
46
48
  }, 1000);
@@ -48,12 +50,15 @@ export const playerLive = defineComponent({
48
50
  }
49
51
  const ua = navigator.userAgent.toLowerCase();
50
52
  const isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
51
- if (this.audioElement.canPlayType('application/vnd.apple.mpegurl') && !isAndroid) {
53
+ if (
54
+ this.audioElement.canPlayType("application/vnd.apple.mpegurl") &&
55
+ !isAndroid
56
+ ) {
52
57
  this.audioElement.src = hlsStreamUrl;
53
58
  await this.initLiveDownloadId();
54
59
  await this.audioElement.play();
55
60
  this.onPlay();
56
- }else{
61
+ } else {
57
62
  await this.initHls(hlsStreamUrl);
58
63
  }
59
64
  } catch (error) {
@@ -62,55 +67,72 @@ export const playerLive = defineComponent({
62
67
  }, 1000);
63
68
  }
64
69
  },
65
- async initLiveDownloadId(){
66
- if(!this.playerLive || this.downloadId){ return;}
70
+ async initLiveDownloadId() {
71
+ if (!this.playerLive || this.downloadId) {
72
+ return;
73
+ }
67
74
  try {
68
- let downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.playerLive.podcastId, undefined);
69
- await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' +this.playerLive.podcastId +".m3u8",{
70
- 'downloadId': null!==downloadId ? downloadId : undefined,
71
- 'origin':'octopus',
72
- 'distributorId':this.authOrgaId
73
- });
75
+ const downloadId = await octopusApi.putDataPublic<string | null>(
76
+ 0,
77
+ "podcast/prepare/live/" + this.playerLive.podcastId,
78
+ undefined,
79
+ );
80
+ await octopusApi.fetchDataPublicWithParams<string | null>(
81
+ 0,
82
+ "podcast/download/live/" + this.playerLive.podcastId + ".m3u8",
83
+ {
84
+ downloadId: null !== downloadId ? downloadId : undefined,
85
+ origin: "octopus",
86
+ distributorId: this.authOrgaId,
87
+ },
88
+ );
74
89
  this.setDownloadId(downloadId);
75
90
  } catch (error) {
76
91
  this.downloadId = null;
77
- console.log('ERROR downloadId');
92
+ console.log("ERROR downloadId");
78
93
  }
79
94
  this.hlsReady = true;
80
95
  },
81
96
  async initHls(hlsStreamUrl: string): Promise<void> {
82
- return new Promise<void>(async(resolve, reject) => {
83
- if(null === Hls){
84
- await import('hls.js').then((hlsLibrary) => {
97
+ return new Promise<void>(async (resolve, reject) => {
98
+ if (null === Hls) {
99
+ await import("hls.js").then((hlsLibrary) => {
85
100
  Hls = hlsLibrary.default;
86
- })
101
+ });
87
102
  }
88
103
  if (!Hls.isSupported()) {
89
- reject('Hls is not supported ! ');
104
+ reject("Hls is not supported ! ");
90
105
  }
91
106
  this.hls = new Hls();
92
107
  this.hls.on(Hls.Events.MANIFEST_PARSED, async () => {
93
108
  await this.initLiveDownloadId();
94
- this.hls.attachMedia((this.audioElement as HTMLAudioElement));
109
+ this.hls.attachMedia(this.audioElement as HTMLAudioElement);
95
110
  await (this.audioElement as HTMLAudioElement).play();
96
111
  this.onPlay();
97
112
  resolve();
98
113
  });
99
- this.hls.on(Hls.Events.ERROR, async() => {
100
- reject('There is an error while reading media content');
114
+ this.hls.on(Hls.Events.ERROR, async () => {
115
+ reject("There is an error while reading media content");
101
116
  });
102
117
  this.hls.loadSource(hlsStreamUrl);
103
118
  });
104
119
  },
105
- setDownloadId(newValue: string|null): void {
120
+ setDownloadId(newValue: string | null): void {
106
121
  this.endListeningProgress();
107
122
  this.downloadId = newValue;
108
123
  },
109
124
  async endListeningProgress(): Promise<void> {
110
125
  if (!this.downloadId) return;
111
126
  try {
112
- await octopusApi.putDataPublic(0, 'podcast/listen/' + this.downloadId + '?seconds=' + Math.round(this.listenTime), undefined);
113
- } catch{
127
+ await octopusApi.putDataPublic(
128
+ 0,
129
+ "podcast/listen/" +
130
+ this.downloadId +
131
+ "?seconds=" +
132
+ Math.round(this.listenTime),
133
+ undefined,
134
+ );
135
+ } catch {
114
136
  //Do nothing
115
137
  }
116
138
  this.downloadId = null;
@@ -118,13 +140,13 @@ export const playerLive = defineComponent({
118
140
  this.lastSend = 0;
119
141
  this.listenTime = 0;
120
142
  },
121
- endingLive():void{
122
- const audio: HTMLElement|null = document.getElementById('audio-player');
123
- if(audio && this.hls){
143
+ endingLive(): void {
144
+ const audio: HTMLElement | null = document.getElementById("audio-player");
145
+ if (audio && this.hls) {
124
146
  this.hls.destroy();
125
- (audio as HTMLAudioElement).src = '';
147
+ (audio as HTMLAudioElement).src = "";
126
148
  this.hls = null;
127
149
  }
128
- }
150
+ },
129
151
  },
130
- })
152
+ });