@saooti/octopus-sdk 40.2.19 → 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 +2 -3
  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 +57 -69
  32. package/src/components/display/emission/EmissionList.vue +192 -218
  33. package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
  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 +39 -50
  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 +210 -222
  58. package/src/components/display/organisation/OrganisationChooser.vue +116 -122
  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 +48 -50
  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 +184 -207
  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 +26 -31
  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 +83 -105
  143. package/src/components/misc/MobileMenu.vue +101 -111
  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 +114 -133
  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 +99 -132
  176. package/src/components/pages/EmissionsPage.vue +2 -0
  177. package/src/components/pages/Error403Page.vue +21 -20
  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 +82 -110
  184. package/src/components/pages/ParticipantsPage.vue +3 -0
  185. package/src/components/pages/PlaylistPage.vue +97 -115
  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
@@ -3,7 +3,7 @@
3
3
  class="d-flex flex-column align-items-center my-2 flex-grow-1 text-light position-relative overflow-y-auto"
4
4
  >
5
5
  <button
6
- :title="$t('Reduce')"
6
+ :title="t('Reduce')"
7
7
  class="player-reduce-button btn bg-transparent text-light"
8
8
  @click="changePlayerLargeVersion"
9
9
  >
@@ -78,6 +78,7 @@ import PlayerTitle from "./elements/PlayerTitle.vue";
78
78
  import PlayerPlayButton from "./elements/PlayerPlayButton.vue";
79
79
  import { defineAsyncComponent } from "vue";
80
80
  import { usePlayerStore } from "../../../stores/PlayerStore";
81
+ import { useI18n } from "vue-i18n";
81
82
  const RadioHistory = defineAsyncComponent(
82
83
  () => import("./radio/RadioHistory.vue"),
83
84
  );
@@ -98,7 +99,6 @@ defineProps( {
98
99
  //Emits
99
100
  const emit = defineEmits(['changePlayerLargeVersion']);
100
101
 
101
- const playerStore = usePlayerStore();
102
102
 
103
103
  //Composables
104
104
  const {
@@ -108,13 +108,14 @@ const {
108
108
  displayPlayTime,
109
109
  displayTotalTime,
110
110
  } = usePlayerDisplayTime();
111
+ const { t } = useI18n();
112
+ const playerStore = usePlayerStore();
111
113
 
112
- function changePlayerLargeVersion() {
113
- emit("changePlayerLargeVersion");
114
- }
115
-
116
-
117
- function seekClick(addTime: number): void {
114
+ //Methods
115
+ function changePlayerLargeVersion() {
116
+ emit("changePlayerLargeVersion");
117
+ }
118
+ function seekClick(addTime: number): void {
118
119
  const audioPlayer: HTMLAudioElement | null =
119
120
  document.querySelector("#audio-player");
120
121
  if (!audioPlayer) {
@@ -3,19 +3,16 @@
3
3
  class="ambiance-progress c-hand-auto mt-1"
4
4
  min="0"
5
5
  max="100"
6
- :value="adPercentProgress"
7
- :aria-label="$t('Advertising')"
6
+ :value="vastStore.adPercentProgress"
7
+ :aria-label="t('Advertising')"
8
8
  />
9
9
  </template>
10
10
 
11
- <script lang="ts">
11
+ <script setup lang="ts">
12
12
  import { useVastStore } from "../../../../stores/VastStore";
13
- import { mapState } from "pinia";
14
- import { defineComponent } from "vue";
15
- export default defineComponent({
16
- name: "AdsProgressBar",
17
- computed: {
18
- ...mapState(useVastStore, ["adPercentProgress"]),
19
- },
20
- });
13
+ import { useI18n } from "vue-i18n";
14
+
15
+ //Composables
16
+ const { t } = useI18n();
17
+ const vastStore = useVastStore();
21
18
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <button
3
- v-if="isAdPlaying && isAdSkippable"
4
- :disabled="!isSkipCurrentlyAllowed"
3
+ v-if="vastStore.isAdPlaying && vastStore.isAdSkippable"
4
+ :disabled="!vastStore.isSkipCurrentlyAllowed"
5
5
  class="btn skip-ad-btn"
6
6
  @click="skipAd"
7
7
  >
@@ -9,36 +9,30 @@
9
9
  </button>
10
10
  </template>
11
11
 
12
- <script lang="ts">
12
+ <script setup lang="ts">
13
+ // see if it has more solutions on https://groups.google.com/g/ima-sdk/c/ky-Q_pUXrIA/m/-P2TsMuABwAJ
13
14
  import { useVastStore } from "../../../../stores/VastStore";
14
- import { mapActions, mapState } from "pinia";
15
- import { defineComponent } from "vue";
16
- export default defineComponent({
17
- // see if it has more solutions on https://groups.google.com/g/ima-sdk/c/ky-Q_pUXrIA/m/-P2TsMuABwAJ
18
- name: "AdsSkipButton",
19
- computed: {
20
- ...mapState(useVastStore, [
21
- "isAdPlaying",
22
- "isAdSkippable",
23
- "isSkipCurrentlyAllowed",
24
- "timeTillSkipInSeconds",
25
- ]),
26
- buttonText(): string {
27
- if (this.isSkipCurrentlyAllowed) {
28
- return this.$t("Skip ad");
29
- }
30
- return this.$t("Skip ad in seconds", {
31
- seconds: this.timeTillSkipInSeconds,
32
- });
33
- },
34
- },
35
- methods: {
36
- ...mapActions(useVastStore, ["updateIsAdSkipped"]),
37
- skipAd(): void {
38
- this.updateIsAdSkipped(true);
39
- },
40
- },
15
+ import { computed } from "vue";
16
+ import { useI18n } from "vue-i18n";
17
+
18
+ //Composables
19
+ const { t } = useI18n();
20
+ const vastStore = useVastStore();
21
+
22
+ //Computed
23
+ const buttonText = computed(() => {
24
+ if (vastStore.isSkipCurrentlyAllowed) {
25
+ return t("Skip ad");
26
+ }
27
+ return t("Skip ad in seconds", {
28
+ seconds: vastStore.timeTillSkipInSeconds,
29
+ });
41
30
  });
31
+
32
+ //Methods
33
+ function skipAd(): void {
34
+ vastStore.updateIsAdSkipped(true);
35
+ }
42
36
  </script>
43
37
  <style lang="scss">
44
38
  .octopus-app {
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <ClassicModal
3
3
  id-modal="chaptering-modal"
4
- :title-modal="$t('Chaptering')"
4
+ :title-modal="t('Chaptering')"
5
5
  @close="closePopup"
6
6
  >
7
7
  <template #body>
8
8
  <div class="d-flex flex-column">
9
9
  <button
10
- v-for="(chapter, index) in playerChapteringPercent"
10
+ v-for="(chapter, index) in playerStore.playerChapteringPercent"
11
11
  :key="chapter"
12
12
  class="btn d-flex flex-nowrap align-items-center p-2 mt-1 c-hand text-truncate mb-1"
13
13
  :class="actualChapter === index ? 'chapter-selected' : 'border'"
@@ -24,66 +24,56 @@
24
24
  </template>
25
25
  <template #footer>
26
26
  <button class="btn m-1" @click="closePopup">
27
- {{ $t("Close") }}
27
+ {{ t("Close") }}
28
28
  </button>
29
29
  </template>
30
30
  </ClassicModal>
31
31
  </template>
32
32
 
33
- <script lang="ts">
33
+ <script setup lang="ts">
34
34
  import WaveformIcon from "vue-material-design-icons/Waveform.vue";
35
35
  import { usePlayerStore } from "../../../../stores/PlayerStore";
36
- import { mapState, mapActions } from "pinia";
37
36
  import ClassicModal from "../../modal/ClassicModal.vue";
38
- import { defineComponent } from "vue";
39
- export default defineComponent({
40
- name: "ChapteringModal",
41
- components: {
42
- ClassicModal,
43
- WaveformIcon,
44
- },
45
- props: { actualChapter: { default: -1, type: Number } },
46
- emits: ["close"],
47
- data() {
48
- return {
49
- audioPlayer: null as HTMLAudioElement | null,
50
- };
51
- },
52
- computed: {
53
- ...mapState(usePlayerStore, [
54
- "playerPodcast",
55
- "playerLive",
56
- "playerChapteringPercent",
57
- "playerTotal",
58
- "playerElapsed",
59
- ]),
60
- },
61
- created() {
62
- this.audioPlayer = document.querySelector("#audio-player");
63
- },
64
- methods: {
65
- ...mapActions(usePlayerStore, [
66
- "playerUpdateSeekTime",
67
- "playerUpdateElapsed",
68
- ]),
69
- closePopup(): void {
70
- this.$emit("close");
71
- },
72
- goToChapter(index: number) {
73
- if (!this.playerChapteringPercent || !this.audioPlayer) {
74
- return;
75
- }
76
- const seekTime =
77
- this.playerTotal *
78
- (this.playerChapteringPercent[index].startPercent / 100);
79
- this.playerUpdateSeekTime(seekTime);
80
- if (0 === seekTime) {
81
- this.playerUpdateElapsed(0);
82
- }
83
- this.audioPlayer.currentTime = seekTime;
84
- },
85
- },
86
- });
37
+ import { onMounted, Ref, ref } from "vue";
38
+ import { useI18n } from "vue-i18n";
39
+
40
+ //Props
41
+ defineProps({
42
+ actualChapter: { default: -1, type: Number }
43
+ })
44
+
45
+ //Emits
46
+ const emit = defineEmits(["close"]);
47
+
48
+ //Data
49
+ const audioPlayer : Ref<HTMLAudioElement | null>= ref(null);
50
+
51
+ //Composables
52
+ const { t } = useI18n();
53
+ const playerStore = usePlayerStore();
54
+
55
+
56
+ onMounted(()=>{
57
+ audioPlayer.value = document.querySelector("#audio-player");
58
+ })
59
+
60
+ //Methods
61
+ function closePopup(): void {
62
+ emit("close");
63
+ }
64
+ function goToChapter(index: number) {
65
+ if (!playerStore.playerChapteringPercent || !audioPlayer.value) {
66
+ return;
67
+ }
68
+ const seekTime =
69
+ playerStore.playerTotal *
70
+ (playerStore.playerChapteringPercent[index].startPercent / 100);
71
+ playerStore.playerUpdateSeekTime(seekTime);
72
+ if (0 === seekTime) {
73
+ playerStore.playerUpdateElapsed(0);
74
+ }
75
+ audioPlayer.value.currentTime = seekTime;
76
+ }
87
77
  </script>
88
78
  <style lang="scss">
89
79
 
@@ -15,76 +15,64 @@
15
15
  @close="showChaptering = false"
16
16
  />
17
17
  </div>
18
- <div v-else-if="playerChapteringPercent" class="margin-chaptering"></div>
18
+ <div v-else-if="playerStore.playerChapteringPercent" class="margin-chaptering"></div>
19
19
  </template>
20
- <script lang="ts">
20
+ <script setup lang="ts">
21
21
  import ChevronRightIcon from "vue-material-design-icons/ChevronRight.vue";
22
22
  import { ChapterPercent } from "@/stores/class/chaptering/chaptering";
23
23
  import { usePlayerStore } from "../../../../stores/PlayerStore";
24
- import { mapState } from "pinia";
25
- import { defineAsyncComponent, defineComponent } from "vue";
24
+ import { defineAsyncComponent, Ref, ref, watch } from "vue";
26
25
  const ChapteringModal = defineAsyncComponent(
27
26
  () => import("./ChapteringModal.vue"),
28
27
  );
29
- export default defineComponent({
30
- name: "PlayerChaptering",
31
28
 
32
- components: {
33
- ChapteringModal,
34
- ChevronRightIcon,
35
- },
36
- data() {
37
- return {
38
- actualChapter: undefined as ChapterPercent | undefined,
39
- actualIndex: -1 as number,
40
- showChaptering: false as boolean,
41
- };
42
- },
43
- computed: {
44
- ...mapState(usePlayerStore, ["playerChapteringPercent", "playerElapsed"]),
45
- },
46
- watch: {
47
- playerElapsed: {
48
- immediate: true,
49
- handler() {
50
- if (!this.playerChapteringPercent) {
51
- this.actualChapter = undefined;
52
- return;
53
- }
54
- const progressPercent = (this.playerElapsed ?? 0) * 100;
55
- if (
56
- this.actualChapter &&
57
- this.isInChapter(progressPercent, this.actualChapter)
58
- ) {
59
- return;
60
- }
61
- for (
62
- let i = 0, len = this.playerChapteringPercent.length;
63
- i < len;
64
- i++
65
- ) {
66
- if (
67
- this.isInChapter(progressPercent, this.playerChapteringPercent[i])
68
- ) {
69
- this.actualChapter = this.playerChapteringPercent[i];
70
- this.actualIndex = i;
71
- return;
72
- }
73
- }
74
- this.actualChapter = undefined;
75
- this.actualIndex = -1;
76
- },
77
- },
78
- },
79
- methods: {
80
- isInChapter(val: number, chapter: ChapterPercent) {
81
- return (
82
- Math.floor(chapter.startPercent) <= val &&
83
- val < Math.floor(chapter.endPercent)
84
- );
85
- },
86
- },
87
- });
29
+ //Data
30
+ const actualChapter : Ref<ChapterPercent | undefined>= ref(undefined);
31
+ const actualIndex = ref(-1);
32
+ const showChaptering = ref(false);
33
+
34
+
35
+ //Composables
36
+ const playerStore = usePlayerStore();
37
+
38
+ //Watch
39
+ watch(()=>playerStore.playerElapsed, () => {
40
+ if (!playerStore.playerChapteringPercent) {
41
+ actualChapter.value = undefined;
42
+ return;
43
+ }
44
+ const progressPercent = (playerStore.playerElapsed ?? 0) * 100;
45
+ if (
46
+ actualChapter.value &&
47
+ isInChapter(progressPercent, actualChapter.value)
48
+ ) {
49
+ return;
50
+ }
51
+ for (
52
+ let i = 0, len = playerStore.playerChapteringPercent.length;
53
+ i < len;
54
+ i++
55
+ ) {
56
+ if (
57
+ isInChapter(progressPercent, playerStore.playerChapteringPercent[i])
58
+ ) {
59
+ actualChapter.value = playerStore.playerChapteringPercent[i];
60
+ actualIndex.value = i;
61
+ return;
62
+ }
63
+ }
64
+ actualChapter.value = undefined;
65
+ actualIndex.value = -1;
66
+ }, {immediate: true});
67
+
68
+
69
+ //Methods
70
+ function isInChapter(val: number, chapter: ChapterPercent) {
71
+ return (
72
+ Math.floor(chapter.startPercent) <= val &&
73
+ val < Math.floor(chapter.endPercent)
74
+ );
75
+ }
88
76
  </script>
89
77
  <style lang="scss">
90
78
  .octopus-app .margin-chaptering {
@@ -1,90 +1,84 @@
1
1
  <template>
2
2
  <div>
3
3
  <a
4
- v-if="linkAdvertising"
4
+ v-if="vastStore.linkAdvertising"
5
5
  rel="noreferrer noopener"
6
6
  target="_blank"
7
- :href="linkAdvertising"
7
+ :href="vastStore.linkAdvertising"
8
8
  class="player-image link-image"
9
9
  :class="imageWidth > 50 ? 'big-player-image' : ''"
10
- :title="$t('New window', {text: $t('Advertising')})"
10
+ :title="t('New window', {text: t('Advertising')})"
11
11
  >
12
12
  <LinkVariantIcon />
13
13
  </a>
14
14
  <router-link
15
- v-else-if="podcastImage"
15
+ v-else-if="playerStore.podcastImage"
16
16
  :to="podcastShareUrl"
17
- :title="$t('Episode name page', { name: podcastDisplay?.title })"
17
+ :title="t('Episode name page', { name: podcastDisplay?.title })"
18
18
  >
19
19
  <img
20
- v-lazy="useProxyImageUrl(podcastImage, imageWidth)"
20
+ v-lazy="useProxyImageUrl(playerStore.podcastImage, imageWidth)"
21
21
  :width="imageWidth"
22
22
  :height="imageWidth"
23
- role="presentation"
23
+ aria-hidden="true"
24
+ alt=""
24
25
 
25
- :title="$t('Episode name image', { name: podcastDisplay?.title })"
26
+ :title="t('Episode name image', { name: podcastDisplay?.title })"
26
27
  class="player-image"
27
28
  :class="imageWidth > 50 ? 'big-player-image' : ''"
28
29
  />
29
30
  </router-link>
30
31
  </div>
31
32
  </template>
32
- <script lang="ts">
33
+ <script setup lang="ts">
33
34
  import LinkVariantIcon from "vue-material-design-icons/LinkVariant.vue";
34
35
  import {useImageProxy} from "../../../composable/useImageProxy";
35
- import { defineComponent } from "vue";
36
- import { RouteLocationRaw } from "vue-router";
37
- import { mapState } from "pinia";
36
+ import { computed } from "vue";
38
37
  import { usePlayerStore } from "../../../../stores/PlayerStore";
39
38
  import { useVastStore } from "../../../../stores/VastStore";
40
- import { Podcast } from "@/stores/class/general/podcast";
41
- export default defineComponent({
42
- name: "PlayerImage",
39
+ import { useI18n } from "vue-i18n";
43
40
 
44
- components: { LinkVariantIcon },
45
41
 
46
- props: {
47
- imageWidth: { default: 48, type: Number },
48
- },
49
- setup(){
50
- const { useProxyImageUrl } = useImageProxy();
51
- return { useProxyImageUrl }
52
- },
53
- computed: {
54
- ...mapState(usePlayerStore, [
55
- "playerPodcast",
56
- "playerRadio",
57
- "podcastImage",
58
- ]),
59
- ...mapState(useVastStore, ["linkAdvertising"]),
60
- podcastDisplay(): Podcast | undefined {
61
- if (this.playerRadio?.podcast) {
62
- return this.playerRadio?.podcast;
63
- }
64
- if (this.playerPodcast) {
65
- return this.playerPodcast;
66
- }
67
- return undefined;
68
- },
69
- podcastShareUrl(): RouteLocationRaw | string {
70
- if (this.playerRadio?.podcast?.podcastId) {
71
- return {
72
- name: "podcast",
73
- params: {
74
- podcastId: this.playerRadio?.podcast?.podcastId.toString(),
75
- },
76
- };
77
- }
78
- if (this.playerPodcast) {
79
- return {
80
- name: "podcast",
81
- params: { podcastId: this.playerPodcast.podcastId.toString() },
82
- };
83
- }
84
- return "";
85
- },
86
- },
42
+ //Props
43
+ defineProps({
44
+ imageWidth: { default: 48, type: Number },
45
+ })
46
+
47
+ //Composables
48
+ const { t } = useI18n();
49
+ const { useProxyImageUrl } = useImageProxy();
50
+ const playerStore = usePlayerStore();
51
+ const vastStore = useVastStore();
52
+
53
+
54
+ //Computed
55
+ const podcastDisplay = computed(() => {
56
+ if (playerStore.playerRadio?.podcast) {
57
+ return playerStore.playerRadio?.podcast;
58
+ }
59
+ if (playerStore.playerPodcast) {
60
+ return playerStore.playerPodcast;
61
+ }
62
+ return undefined;
87
63
  });
64
+ const podcastShareUrl = computed(() => {
65
+ if (playerStore.playerRadio?.podcast?.podcastId) {
66
+ return {
67
+ name: "podcast",
68
+ params: {
69
+ podcastId: playerStore.playerRadio?.podcast?.podcastId.toString(),
70
+ },
71
+ };
72
+ }
73
+ if (playerStore.playerPodcast) {
74
+ return {
75
+ name: "podcast",
76
+ params: { podcastId: playerStore.playerPodcast.podcastId.toString() },
77
+ };
78
+ }
79
+ return "";
80
+ });
81
+
88
82
  </script>
89
83
 
90
84
  <style lang="scss">