@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,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
+ });