@saooti/octopus-sdk 40.2.18 → 41.0.0-SNAPSHOT

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 (204) hide show
  1. package/package.json +38 -39
  2. package/src/App.vue +68 -88
  3. package/src/components/composable/player/usePlayerLive.ts +12 -3
  4. package/src/components/composable/player/usePlayerLogic.ts +6 -6
  5. package/src/components/composable/podcasts/usePodcastView.ts +3 -3
  6. package/src/components/composable/useInit.ts +2 -2
  7. package/src/components/composable/useMetaTitleWatch.ts +2 -2
  8. package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
  9. package/src/components/display/categories/CategoryChooser.vue +142 -145
  10. package/src/components/display/categories/CategoryFilter.vue +172 -198
  11. package/src/components/display/categories/CategoryList.vue +122 -147
  12. package/src/components/display/comments/CommentInput.vue +100 -122
  13. package/src/components/display/comments/CommentList.vue +169 -191
  14. package/src/components/display/comments/CommentName.vue +35 -45
  15. package/src/components/display/comments/CommentParentInfo.vue +28 -34
  16. package/src/components/display/comments/CommentPlayer.vue +38 -50
  17. package/src/components/display/comments/CommentSection.vue +85 -103
  18. package/src/components/display/comments/item/CommentBasicView.vue +48 -61
  19. package/src/components/display/comments/item/CommentItem.vue +101 -116
  20. package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
  21. package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
  22. package/src/components/display/comments/like/LikeButton.vue +36 -41
  23. package/src/components/display/comments/like/LikeSection.vue +128 -136
  24. package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
  25. package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
  26. package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
  27. package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
  28. package/src/components/display/edit/EditBox.vue +6 -9
  29. package/src/components/display/edit/EditBoxRadio.vue +1 -5
  30. package/src/components/display/emission/EmissionInlineList.vue +82 -97
  31. package/src/components/display/emission/EmissionItem.vue +56 -69
  32. package/src/components/display/emission/EmissionList.vue +192 -218
  33. package/src/components/display/emission/EmissionPlayerItem.vue +48 -65
  34. package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
  35. package/src/components/display/emission/EmissionPresentationList.vue +51 -61
  36. package/src/components/display/filter/AdvancedSearch.vue +154 -176
  37. package/src/components/display/filter/CategorySearchFilter.vue +43 -46
  38. package/src/components/display/filter/DateFilter.vue +76 -91
  39. package/src/components/display/filter/MonetizableFilter.vue +27 -30
  40. package/src/components/display/filter/ProductorSearch.vue +87 -90
  41. package/src/components/display/filter/RubriqueChoice.vue +58 -63
  42. package/src/components/display/filter/RubriqueFilter.vue +154 -169
  43. package/src/components/display/filter/SearchOrder.vue +35 -35
  44. package/src/components/display/list/ListPaginate.vue +80 -93
  45. package/src/components/display/list/PaginateParams.vue +36 -40
  46. package/src/components/display/list/PaginateSection.vue +113 -124
  47. package/src/components/display/list/SwiperList.vue +97 -109
  48. package/src/components/display/live/CountDown.vue +15 -9
  49. package/src/components/display/live/CountdownOctopus.vue +16 -10
  50. package/src/components/display/live/LiveHorizontalList.vue +95 -103
  51. package/src/components/display/live/LiveItem.vue +65 -73
  52. package/src/components/display/live/LiveList.vue +125 -137
  53. package/src/components/display/live/RadioCurrently.vue +66 -73
  54. package/src/components/display/live/RadioImage.vue +40 -51
  55. package/src/components/display/live/RadioItem.vue +9 -14
  56. package/src/components/display/live/RadioList.vue +39 -53
  57. package/src/components/display/live/RadioPlanning.vue +211 -223
  58. package/src/components/display/organisation/OrganisationChooser.vue +117 -123
  59. package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
  60. package/src/components/display/participant/ParticipantInlineList.vue +42 -58
  61. package/src/components/display/participant/ParticipantItem.vue +66 -74
  62. package/src/components/display/participant/ParticipantList.vue +119 -141
  63. package/src/components/display/playlist/PlaylistItem.vue +33 -46
  64. package/src/components/display/playlist/PlaylistList.vue +118 -144
  65. package/src/components/display/playlist/PodcastList.vue +79 -101
  66. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
  67. package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
  68. package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
  69. package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
  70. package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
  71. package/src/components/display/podcasts/PodcastFilterList.vue +48 -53
  72. package/src/components/display/podcasts/PodcastImage.vue +96 -99
  73. package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
  74. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
  75. package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
  76. package/src/components/display/podcasts/PodcastItem.vue +48 -63
  77. package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
  78. package/src/components/display/podcasts/PodcastList.vue +183 -206
  79. package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
  80. package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
  81. package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
  82. package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
  83. package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
  84. package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
  85. package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
  86. package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
  87. package/src/components/display/podcasts/TagList.vue +49 -51
  88. package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
  89. package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
  90. package/src/components/display/rubriques/RubriqueList.vue +140 -160
  91. package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
  92. package/src/components/display/sharing/FormatSwitch.vue +16 -11
  93. package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
  94. package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
  95. package/src/components/display/sharing/PlayerParameters.vue +69 -71
  96. package/src/components/display/sharing/QrCode.vue +55 -67
  97. package/src/components/display/sharing/ShareAnonymous.vue +160 -178
  98. package/src/components/display/sharing/ShareDistribution.vue +103 -117
  99. package/src/components/display/sharing/ShareNewsletter.vue +154 -161
  100. package/src/components/display/sharing/SharePlayer.vue +273 -295
  101. package/src/components/display/sharing/SharePlayerColors.vue +25 -16
  102. package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
  103. package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
  104. package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
  105. package/src/components/display/sharing/SubscribeButtons.vue +185 -209
  106. package/src/components/display/studio/RecordingItemButton.vue +1 -4
  107. package/src/components/form/ClassicCheckbox.vue +26 -30
  108. package/src/components/form/ClassicContentEditable.vue +37 -33
  109. package/src/components/form/ClassicCopyButton.vue +40 -44
  110. package/src/components/form/ClassicDatePicker.vue +114 -114
  111. package/src/components/form/ClassicEmojiPicker.vue +20 -28
  112. package/src/components/form/ClassicInputText.vue +116 -120
  113. package/src/components/form/ClassicLoading.vue +7 -12
  114. package/src/components/form/ClassicMultiselect.vue +106 -116
  115. package/src/components/form/ClassicRadio.vue +21 -16
  116. package/src/components/form/ClassicRadioLabel.vue +23 -22
  117. package/src/components/form/ClassicSearch.vue +24 -19
  118. package/src/components/form/ClassicSelect.vue +47 -38
  119. package/src/components/form/ClassicWysiwyg.vue +116 -123
  120. package/src/components/icons/AmazonMusicIcon.vue +7 -10
  121. package/src/components/icons/ApplePodcastIcon.vue +7 -11
  122. package/src/components/icons/BlueSkyIcon.vue +8 -11
  123. package/src/components/icons/DeezerIcon.vue +8 -11
  124. package/src/components/icons/EditFtpIcon.vue +8 -11
  125. package/src/components/icons/IHeartIcon.vue +8 -11
  126. package/src/components/icons/PlayVideoIcon.vue +7 -10
  127. package/src/components/icons/PlayerFmIcon.vue +7 -10
  128. package/src/components/icons/PocketCastIcon.vue +8 -11
  129. package/src/components/icons/PodcastAddictIcon.vue +7 -10
  130. package/src/components/icons/RadiolineIcon.vue +8 -11
  131. package/src/components/icons/TuninIcon.vue +8 -11
  132. package/src/components/icons/XIcon.vue +7 -10
  133. package/src/components/misc/AcpmImage.vue +6 -7
  134. package/src/components/misc/ClassicAccordion.vue +27 -32
  135. package/src/components/misc/ClassicLazy.vue +86 -90
  136. package/src/components/misc/ClassicNav.vue +16 -20
  137. package/src/components/misc/ClassicPopover.vue +266 -282
  138. package/src/components/misc/ClassicSpinner.vue +5 -27
  139. package/src/components/misc/ErrorMessage.vue +11 -12
  140. package/src/components/misc/FooterGarSection.vue +33 -41
  141. package/src/components/misc/FooterSection.vue +109 -130
  142. package/src/components/misc/HomeDropdown.vue +85 -108
  143. package/src/components/misc/MobileMenu.vue +102 -113
  144. package/src/components/misc/ProgressBar.vue +53 -62
  145. package/src/components/misc/TopBar.vue +97 -120
  146. package/src/components/misc/TopBarMainContent.vue +116 -135
  147. package/src/components/misc/modal/ClassicModal.vue +40 -33
  148. package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
  149. package/src/components/misc/modal/ClipboardModal.vue +27 -30
  150. package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
  151. package/src/components/misc/modal/MessageModal.vue +50 -47
  152. package/src/components/misc/modal/NewsletterModal.vue +30 -31
  153. package/src/components/misc/modal/QrCodeModal.vue +21 -21
  154. package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
  155. package/src/components/misc/player/PlayerCompact.vue +6 -4
  156. package/src/components/misc/player/PlayerComponent.vue +8 -9
  157. package/src/components/misc/player/PlayerLarge.vue +9 -8
  158. package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
  159. package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
  160. package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
  161. package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
  162. package/src/components/misc/player/elements/PlayerImage.vue +51 -57
  163. package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
  164. package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
  165. package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
  166. package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
  167. package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
  168. package/src/components/misc/player/radio/RadioHistory.vue +80 -99
  169. package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
  170. package/src/components/misc/player/video/PlayerVideo.vue +27 -40
  171. package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
  172. package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
  173. package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
  174. package/src/components/pages/CategoryPage.vue +28 -33
  175. package/src/components/pages/EmissionPage.vue +98 -131
  176. package/src/components/pages/EmissionsPage.vue +2 -0
  177. package/src/components/pages/Error403Page.vue +22 -21
  178. package/src/components/pages/HomePage.vue +91 -100
  179. package/src/components/pages/LivesPage.vue +35 -37
  180. package/src/components/pages/MapPage.vue +209 -241
  181. package/src/components/pages/PageLogout.vue +8 -11
  182. package/src/components/pages/PageNotFound.vue +9 -5
  183. package/src/components/pages/ParticipantPage.vue +83 -111
  184. package/src/components/pages/ParticipantsPage.vue +3 -0
  185. package/src/components/pages/PlaylistPage.vue +98 -116
  186. package/src/components/pages/PlaylistsPage.vue +9 -2
  187. package/src/components/pages/PodcastPage.vue +223 -238
  188. package/src/components/pages/PodcastsPage.vue +9 -2
  189. package/src/components/pages/RadioPage.vue +56 -70
  190. package/src/components/pages/RubriquePage.vue +7 -3
  191. package/src/components/pages/SearchPage.vue +31 -36
  192. package/src/components/pages/TagPage.vue +11 -9
  193. package/src/components/pages/VideoPage.vue +14 -11
  194. package/src/helper/displayHelper.ts +1 -1
  195. package/src/i18n.ts +2 -2
  196. package/src/main.ts +1 -1
  197. package/src/stores/class/general/player.ts +1 -0
  198. package/public/css/fonts/icomoon.eot +0 -0
  199. package/public/css/fonts/icomoon.svg +0 -113
  200. package/public/css/fonts/icomoon.ttf +0 -0
  201. package/public/css/fonts/icomoon.woff +0 -0
  202. package/public/css/fonts/icomoon.woff2 +0 -0
  203. package/public/css/fonts/style.css +0 -352
  204. package/sonarqube-scanner.js +0 -10
@@ -2,14 +2,14 @@
2
2
  <section class="module-box overflow-visible">
3
3
  <div class="d-flex justify-content-between align-items-center">
4
4
  <h3 class="mb-3">
5
- {{ $t("Embed") }}
5
+ {{ t("Embed") }}
6
6
  </h3>
7
7
  <div
8
- v-if="noAd && !platformEducation"
8
+ v-if="noAd && !generalStore.platformEducation"
9
9
  class="sticker"
10
- :title="$t('You cannot insert advertising')"
10
+ :title="t('You cannot insert advertising')"
11
11
  >
12
- {{ $t("No advertising") }}
12
+ {{ t("No advertising") }}
13
13
  </div>
14
14
  </div>
15
15
  <template v-if="!exclusive && (authenticated || notExclusive)">
@@ -71,30 +71,30 @@
71
71
  class="btn btn-primary w-fit-content mt-3"
72
72
  @click="isShareModal = true"
73
73
  >
74
- {{ $t("Share the player") }}
74
+ {{ t("Share the player") }}
75
75
  </button>
76
76
  </div>
77
77
  </div>
78
78
  </template>
79
79
  <div v-else-if="exclusive && authenticated">
80
- {{ $t("Only organisation members can share the content") }}
80
+ {{ t("Only organisation members can share the content") }}
81
81
  </div>
82
82
  <div v-else-if="!authenticated">
83
- {{ $t("Only authenticated members can share the content") }}
83
+ {{ t("Only authenticated members can share the content") }}
84
84
  </div>
85
85
  </section>
86
86
  </template>
87
87
 
88
- <script lang="ts">
88
+ <script setup lang="ts">
89
89
  import { Podcast } from "@/stores/class/general/podcast";
90
90
  import { Emission } from "@/stores/class/general/emission";
91
91
  import { Playlist } from "@/stores/class/general/playlist";
92
92
  import { useAuthStore } from "../../../stores/AuthStore";
93
93
  import { useApiStore } from "../../../stores/ApiStore";
94
94
  import { useSaveFetchStore } from "../../../stores/SaveFetchStore";
95
- import { mapState, mapActions } from "pinia";
96
- import { defineComponent, defineAsyncComponent } from "vue";
95
+ import { defineAsyncComponent, ref, Ref, computed, onBeforeMount } from "vue";
97
96
  import { useGeneralStore } from "../../../stores/GeneralStore";
97
+ import { useI18n } from "vue-i18n";
98
98
  const ShareModalPlayer = defineAsyncComponent(
99
99
  () => import("../../misc/modal/ShareModalPlayer.vue"),
100
100
  );
@@ -107,296 +107,274 @@ const SharePlayerTypes = defineAsyncComponent(
107
107
  const SharePlayerColors = defineAsyncComponent(
108
108
  () => import("./SharePlayerColors.vue"),
109
109
  );
110
- export default defineComponent({
111
- components: {
112
- ShareModalPlayer,
113
- SharePlayerColors,
114
- PlayerParameters,
115
- SharePlayerTypes,
116
- },
117
- props: {
118
- podcast: { default: undefined, type: Object as () => Podcast },
119
- emission: { default: undefined, type: Object as () => Emission },
120
- playlist: { default: undefined, type: Object as () => Playlist },
121
- organisationId: { default: undefined, type: String },
122
- exclusive: { default: false, type: Boolean },
123
- notExclusive: { default: true, type: Boolean },
124
- },
125
110
 
126
- data() {
127
- return {
128
- typeCustomPlayer: "",
129
- iFrameModel: "default" as string,
130
- isShareModal: false as boolean,
131
- color: "#40a372" as string,
132
- theme: "#000000" as string,
133
- proceedReading: true as boolean,
134
- episodeChoiceDisplay: "number" as string,
135
- episodesNumber: 3 as number,
136
- isVisible: false as boolean,
137
- displayArticle: true as boolean,
138
- displayTranscript: true as boolean,
139
- displayWave: false as boolean,
140
- playerAutoPlay: false as boolean,
141
- orgaAttributes: undefined as
142
- | { [key: string]: string | number | boolean | undefined }
143
- | undefined,
144
- insertCode: false as boolean,
145
- };
146
- },
147
111
 
148
- computed: {
149
- ...mapState(useGeneralStore, ["platformEducation"]),
150
- ...mapState(useAuthStore, ["authOrgaId"]),
151
- ...mapState(useApiStore, ["miniplayerUrl"]),
152
- authenticated(): boolean {
153
- return undefined !== this.authOrgaId;
154
- },
155
- displayWaveParam(): boolean {
156
- return "default" === this.iFrameModel || "emission" === this.iFrameModel;
157
- },
158
- displayIsVisible(): boolean {
159
- return this.displayChoiceAllEpisodes || this.isPodcastNotVisible;
160
- },
161
- isPodcastNotVisible(): boolean {
162
- return (
163
- undefined !== this.podcast &&
164
- !this.podcast.availability.visibility &&
165
- !this.isTypeEmission
166
- );
167
- },
168
- displayArticleParam(): boolean {
169
- return (
170
- undefined !== this.podcast &&
171
- undefined !== this.podcast.article &&
172
- 0 !== this.podcast.article.length &&
173
- ("default" === this.iFrameModel ||
174
- "large" === this.iFrameModel ||
175
- "largeMore" === this.iFrameModel)
176
- );
177
- },
178
- displayInsertCode(): boolean {
179
- let orgaResourceId = "";
180
- if (this.podcast) {
181
- orgaResourceId = this.podcast.organisation.id;
182
- }
183
- if (this.emission) {
184
- orgaResourceId = this.emission.orga.id;
185
- }
186
- if (this.playlist) {
187
- orgaResourceId = this.playlist.organisation?.id ?? "";
188
- }
189
- return orgaResourceId === this.authOrgaId;
190
- },
191
- displayTranscriptParam(): boolean {
192
- return (
193
- this.isTranscriptionAuthorize && (this.isDefault || this.isEmission)
194
- );
195
- },
196
- isTranscriptionAuthorize(): boolean {
197
- if (!this.orgaAttributes) {
198
- return false;
199
- }
200
- return this.orgaAttributes &&
201
- Object.hasOwn(this.orgaAttributes, "speechtotext.active")
202
- ? (this.orgaAttributes["speechtotext.active"] as boolean)
203
- : false;
204
- },
205
- displayChoiceAllEpisodes(): boolean {
206
- return !this.podcast || this.isTypeEmission;
207
- },
208
- isDefault(): boolean {
209
- return "default" === this.iFrameModel;
210
- },
211
- isEmission(): boolean {
212
- return "emission" === this.iFrameModel;
213
- },
214
- isLargeEmission(): boolean {
215
- return "emissionLarge" === this.iFrameModel;
216
- },
217
- isTypeEmission(): boolean {
218
- return (
219
- this.isEmission ||
220
- this.isLargeEmission ||
221
- "EMISSION" === this.typeCustomPlayer
222
- );
223
- },
224
- isLiveReadyToRecord(): boolean {
225
- if (this.podcast)
226
- return (
227
- undefined !== this.podcast.conferenceId &&
228
- 0 !== this.podcast.conferenceId &&
229
- this.podcast.processingStatus === "READY_TO_RECORD"
230
- );
231
- return false;
232
- },
233
- noAd(): boolean {
234
- return (
235
- (this.podcast?.organisation.id !== this.organisationId &&
236
- "NO" === this.podcast?.monetisable) ||
237
- ("UNDEFINED" === this.podcast?.monetisable &&
238
- "NO" === this.podcast?.emission.monetisable)
239
- );
240
- },
241
- iFrameSrc(): string {
242
- if ("video" === this.iFrameModel) {
243
- return (
244
- "https://www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/" +
245
- this.podcast?.video?.videoId +
246
- "/sound/true"
247
- );
248
- }
249
- let url = [""];
250
- const iFrameNumber =
251
- this.displayChoiceAllEpisodes && "all" === this.episodeChoiceDisplay
252
- ? "/0"
253
- : "/" + this.episodesNumber;
254
- url.push(`${this.miniplayerUrl}miniplayer/`);
255
- if (!this.podcast && !this.playlist && this.emission) {
256
- url = this.constructEmissionUrl(url);
257
- } else if (this.playlist) {
258
- url = this.constructPlaylistUrl(url);
259
- } else if (this.emission && this.podcast) {
260
- url.push(`${this.iFrameModel}/`);
261
- if (this.isTypeEmission) {
262
- url.push(
263
- `${this.emission.emissionId}${iFrameNumber}/${this.podcast.podcastId}`,
264
- );
265
- } else {
266
- url.push(`${this.podcast.podcastId}`);
267
- }
268
- }
269
- return this.addUrlParameters(url).join("");
270
- },
271
- iFrameHeight(): string {
272
- switch (this.iFrameModel) {
273
- case "video":
274
- return "281px";
275
- case "large":
276
- if (this.podcast) return "140px";
277
- return "350px";
278
- case "largeMore":
279
- return "210px";
280
- case "emissionLarge":
281
- return "350px";
282
- case "emission":
283
- return "540px";
284
- case "videoLive":
285
- return "450px";
286
- default:
287
- return "530px";
288
- }
289
- },
290
- iFrame(): string {
291
- const specialDigiteka = this.podcast?.video?.videoId
292
- ? 'allowfullscreen="true" referrerpolicy="no-referrer-when-downgrade"'
293
- : "";
294
- return `<iframe src="${this.iFrameSrc}" width="100%" height="${this.iFrameHeight}" scrolling="no" frameborder="0" ${specialDigiteka} allow="clipboard-read; clipboard-write; autoplay"></iframe>`;
295
- },
296
- dataTitle(): number {
297
- if (this.podcast) return this.podcast.podcastId;
298
- if (this.emission) return this.emission.emissionId;
299
- if (this.playlist) return this.playlist.playlistId;
300
- return 0;
301
- },
302
- },
303
- created() {
304
- this.initSharePlayer();
305
- },
306
- methods: {
307
- ...mapActions(useSaveFetchStore, ["getOrgaAttributes"]),
308
- async initSharePlayer() {
309
- this.orgaAttributes = await this.getOrgaAttributes(this.authOrgaId ?? "");
310
- this.initColor();
311
- if (this.isLiveReadyToRecord) {
312
- this.iFrameModel = "large";
313
- }
314
- if ("true" === this.podcast?.annotations?.["fromTTS"]) {
315
- this.displayTranscript = false;
316
- }
317
- },
318
- getIframeNumber(): string {
319
- return this.displayChoiceAllEpisodes && "all" === this.episodeChoiceDisplay
320
- ? "/0"
321
- : "/" + this.episodesNumber;
322
- },
323
- constructEmissionUrl(url: Array<string>) {
324
- if (!this.emission) {
325
- return [];
326
- }
327
- switch (this.iFrameModel) {
328
- case "default":
329
- url.push("emission");
330
- break;
331
- case "large":
332
- url.push("emissionLarge");
333
- break;
334
- default:
335
- url.push(`${this.iFrameModel}`);
336
- break;
337
- }
338
- url.push(`/${this.emission.emissionId}${this.getIframeNumber()}`);
339
- return url;
340
- },
341
- constructPlaylistUrl(url: Array<string>) {
342
- if (!this.playlist) {
343
- return [];
344
- }
345
- switch (this.iFrameModel) {
346
- case "default":
347
- url.push("playlist");
348
- break;
349
- case "large":
350
- url.push("playlistLarge");
351
- break;
352
- default:
353
- url.push(`${this.iFrameModel}`);
354
- break;
355
- }
356
- url.push(`/${this.playlist.playlistId}`);
357
- return url;
358
- },
359
- addUrlParameters(url: Array<string>) {
360
- url.push("?distributorId=" + this.organisationId);
112
+ //Props
113
+ const props = defineProps({
114
+ podcast: { default: undefined, type: Object as () => Podcast },
115
+ emission: { default: undefined, type: Object as () => Emission },
116
+ playlist: { default: undefined, type: Object as () => Playlist },
117
+ organisationId: { default: undefined, type: String },
118
+ exclusive: { default: false, type: Boolean },
119
+ notExclusive: { default: true, type: Boolean },
120
+ })
121
+
122
+ //Data
123
+ const typeCustomPlayer = ref("");
124
+ const iFrameModel = ref("default");
125
+ const isShareModal = ref(false);
126
+ const color = ref("#40a372");
127
+ const theme = ref("#000000");
128
+ const proceedReading = ref(true);
129
+ const episodeChoiceDisplay = ref("number");
130
+ const episodesNumber = ref(3);
131
+ const isVisible = ref(false);
132
+ const displayArticle = ref(true);
133
+ const displayTranscript = ref(true);
134
+ const displayWave = ref(false);
135
+ const playerAutoPlay = ref(false);
136
+ const insertCode = ref(false);
137
+ const orgaAttributes : Ref<{ [key: string]: string | number | boolean | undefined }| undefined>= ref(undefined);
138
+
139
+
140
+ //Composables
141
+ const { t } = useI18n();
142
+ const authStore = useAuthStore();
143
+ const apiStore = useApiStore();
144
+ const generalStore = useGeneralStore();
145
+ const saveFetchStore = useSaveFetchStore();
146
+
147
+
148
+ //Computed
149
+ const authenticated = computed(() => undefined !== authStore.authOrgaId);
150
+ const displayWaveParam = computed(() => "default" === iFrameModel.value || "emission" === iFrameModel.value);
151
+ const displayIsVisible = computed(() => displayChoiceAllEpisodes.value || isPodcastNotVisible.value);
152
+ const isPodcastNotVisible = computed(() => {
153
+ return (
154
+ undefined !== props.podcast &&
155
+ !props.podcast.availability.visibility &&
156
+ !isTypeEmission.value
157
+ );
158
+ });
159
+ const displayArticleParam = computed(() => {
160
+ return (
161
+ undefined !== props.podcast &&
162
+ undefined !== props.podcast.article &&
163
+ 0 !== props.podcast.article.length &&
164
+ ("default" === iFrameModel.value ||
165
+ "large" === iFrameModel.value ||
166
+ "largeMore" === iFrameModel.value)
167
+ );
168
+ });
169
+ const displayInsertCode = computed(() => {
170
+ let orgaResourceId = "";
171
+ if (props.podcast) {
172
+ orgaResourceId = props.podcast.organisation.id;
173
+ }
174
+ if (props.emission) {
175
+ orgaResourceId = props.emission.orga.id;
176
+ }
177
+ if (props.playlist) {
178
+ orgaResourceId = props.playlist.organisation?.id ?? "";
179
+ }
180
+ return orgaResourceId === authStore.authOrgaId;
181
+ });
182
+ const displayTranscriptParam = computed(() => isTranscriptionAuthorize.value && (isDefault.value || isEmission.value));
183
+ const isTranscriptionAuthorize = computed(() => {
184
+ if (!orgaAttributes.value) {
185
+ return false;
186
+ }
187
+ return orgaAttributes.value &&
188
+ Object.hasOwn(orgaAttributes.value, "speechtotext.active")
189
+ ? (orgaAttributes.value["speechtotext.active"] as boolean)
190
+ : false;
191
+ });
192
+ const displayChoiceAllEpisodes = computed(() => !props.podcast || isTypeEmission.value);
193
+ const isDefault = computed(() => "default" === iFrameModel.value);
194
+ const isEmission = computed(() => "emission" === iFrameModel.value);
195
+ const isLargeEmission = computed(() => "emissionLarge" === iFrameModel.value);
196
+ const isTypeEmission = computed(() => {
197
+ return (
198
+ isEmission.value ||
199
+ isLargeEmission.value ||
200
+ "EMISSION" === typeCustomPlayer.value
201
+ );
202
+ });
203
+ const isLiveReadyToRecord = computed(() => {
204
+ if (props.podcast)
205
+ return (
206
+ undefined !== props.podcast.conferenceId &&
207
+ 0 !== props.podcast.conferenceId &&
208
+ props.podcast.processingStatus === "READY_TO_RECORD"
209
+ );
210
+ return false;
211
+ });
212
+
213
+ const noAd = computed(() => {
214
+ return (
215
+ (props.podcast?.organisation.id !== props.organisationId &&
216
+ "NO" === props.podcast?.monetisable) ||
217
+ ("UNDEFINED" === props.podcast?.monetisable &&
218
+ "NO" === props.podcast?.emission.monetisable)
219
+ );
220
+ });
221
+ const iFrameSrc = computed(() => {
222
+ if ("video" === iFrameModel.value) {
223
+ return (
224
+ "https://www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/" +
225
+ props.podcast?.video?.videoId +
226
+ "/sound/true"
227
+ );
228
+ }
229
+ let url = [""];
230
+ const iFrameNumber =
231
+ displayChoiceAllEpisodes.value && "all" === episodeChoiceDisplay.value
232
+ ? "/0"
233
+ : "/" + episodesNumber.value;
234
+ url.push(`${apiStore.miniplayerUrl}miniplayer/`);
235
+ if (!props.podcast && !props.playlist && props.emission) {
236
+ url = constructEmissionUrl(url);
237
+ } else if (props.playlist) {
238
+ url = constructPlaylistUrl(url);
239
+ } else if (props.emission && props.podcast) {
240
+ url.push(`${iFrameModel.value}/`);
241
+ if (isTypeEmission.value) {
361
242
  url.push(
362
- `&color=${this.color.substring(1)}&theme=${this.theme.substring(1)}`,
243
+ `${props.emission.emissionId}${iFrameNumber}/${props.podcast.podcastId}`,
363
244
  );
364
- if (!this.proceedReading) {
365
- url.push("&proceed=false");
366
- }
367
- if (!this.displayArticle && this.displayArticleParam) {
368
- url.push("&article=false");
369
- }
370
- if (!this.displayTranscript) {
371
- url.push("&transcript=false");
372
- }
373
- if (!this.displayWave) {
374
- url.push("&wave=false");
375
- }
376
- if (this.playerAutoPlay) {
377
- url.push("&autoplay=true");
378
- }
379
- if (this.isVisible) {
380
- url.push("&key=" + window.btoa(this.dataTitle.toString()));
381
- }
382
- if (this.insertCode) {
383
- url.push("&insertCode=true");
384
- }
385
- return url;
386
- },
387
- initColor(): void {
388
- if (!this.orgaAttributes) {
389
- return;
390
- }
391
- this.color = Object.hasOwn(this.orgaAttributes, "COLOR")
392
- ? (this.orgaAttributes.COLOR as string)
393
- : "#40a372";
394
- this.theme = Object.hasOwn(this.orgaAttributes, "THEME")
395
- ? (this.orgaAttributes.THEME as string)
396
- : "#000000";
397
- },
398
- },
245
+ } else {
246
+ url.push(`${props.podcast.podcastId}`);
247
+ }
248
+ }
249
+ return addUrlParameters(url).join("");
250
+ });
251
+ const iFrameHeight = computed(() => {
252
+ switch (iFrameModel.value) {
253
+ case "video":
254
+ return "281px";
255
+ case "large":
256
+ if (props.podcast) return "140px";
257
+ return "350px";
258
+ case "largeMore":
259
+ return "210px";
260
+ case "emissionLarge":
261
+ return "350px";
262
+ case "emission":
263
+ return "540px";
264
+ case "videoLive":
265
+ return "450px";
266
+ default:
267
+ return "530px";
268
+ }
399
269
  });
270
+ const iFrame = computed(() => {
271
+ const specialDigiteka = props.podcast?.video?.videoId
272
+ ? 'allowfullscreen="true" referrerpolicy="no-referrer-when-downgrade"'
273
+ : "";
274
+ return `<iframe src="${iFrameSrc.value}" width="100%" height="${iFrameHeight.value}" scrolling="no" ${specialDigiteka} allow="clipboard-read; clipboard-write; autoplay"></iframe>`;
275
+ });
276
+ const dataTitle = computed(() => {
277
+ if (props.podcast) return props.podcast.podcastId;
278
+ if (props.emission) return props.emission.emissionId;
279
+ if (props.playlist) return props.playlist.playlistId;
280
+ return 0;
281
+ });
282
+
283
+
284
+ onBeforeMount(()=>initSharePlayer())
285
+
286
+
287
+ //Methods
288
+ async function initSharePlayer() {
289
+ orgaAttributes.value = await saveFetchStore.getOrgaAttributes(authStore.authOrgaId ?? "");
290
+ initColor();
291
+ if (isLiveReadyToRecord.value) {
292
+ iFrameModel.value = "large";
293
+ }
294
+ if ("true" === props.podcast?.annotations?.["fromTTS"]) {
295
+ displayTranscript.value = false;
296
+ }
297
+ }
298
+ function getIframeNumber(): string {
299
+ return displayChoiceAllEpisodes.value && "all" === episodeChoiceDisplay.value
300
+ ? "/0"
301
+ : "/" + episodesNumber.value;
302
+ }
303
+ function constructEmissionUrl(url: Array<string>) {
304
+ if (!props.emission) {
305
+ return [];
306
+ }
307
+ switch (iFrameModel.value) {
308
+ case "default":
309
+ url.push("emission");
310
+ break;
311
+ case "large":
312
+ url.push("emissionLarge");
313
+ break;
314
+ default:
315
+ url.push(`${iFrameModel.value}`);
316
+ break;
317
+ }
318
+ url.push(`/${props.emission.emissionId}${getIframeNumber()}`);
319
+ return url;
320
+ }
321
+ function constructPlaylistUrl(url: Array<string>) {
322
+ if (!props.playlist) {
323
+ return [];
324
+ }
325
+ switch (iFrameModel.value) {
326
+ case "default":
327
+ url.push("playlist");
328
+ break;
329
+ case "large":
330
+ url.push("playlistLarge");
331
+ break;
332
+ default:
333
+ url.push(`${iFrameModel.value}`);
334
+ break;
335
+ }
336
+ url.push(`/${props.playlist.playlistId}`);
337
+ return url;
338
+ }
339
+ function addUrlParameters(url: Array<string>) {
340
+ url.push("?distributorId=" + props.organisationId);
341
+ url.push(
342
+ `&color=${color.value.substring(1)}&theme=${theme.value.substring(1)}`,
343
+ );
344
+ if (!proceedReading.value) {
345
+ url.push("&proceed=false");
346
+ }
347
+ if (!displayArticle.value && displayArticleParam.value) {
348
+ url.push("&article=false");
349
+ }
350
+ if (!displayTranscript.value) {
351
+ url.push("&transcript=false");
352
+ }
353
+ if (!displayWave.value) {
354
+ url.push("&wave=false");
355
+ }
356
+ if (playerAutoPlay.value) {
357
+ url.push("&autoplay=true");
358
+ }
359
+ if (isVisible.value) {
360
+ url.push("&key=" + window.btoa(dataTitle.value.toString()));
361
+ }
362
+ if (insertCode.value) {
363
+ url.push("&insertCode=true");
364
+ }
365
+ return url;
366
+ }
367
+ function initColor(): void {
368
+ if (!orgaAttributes.value) {
369
+ return;
370
+ }
371
+ color.value = Object.hasOwn(orgaAttributes.value, "COLOR")
372
+ ? (orgaAttributes.value.COLOR as string)
373
+ : "#40a372";
374
+ theme.value = Object.hasOwn(orgaAttributes.value, "THEME")
375
+ ? (orgaAttributes.value.THEME as string)
376
+ : "#000000";
377
+ }
400
378
  </script>
401
379
 
402
380
  <style lang="scss">