@saooti/octopus-sdk 40.2.19 → 41.0.0
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.
- package/index.ts +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
3
|
v-if="!playerError"
|
|
4
|
-
:title="
|
|
4
|
+
:title="t('Play')"
|
|
5
5
|
:class="{
|
|
6
6
|
'p-0': !displayIsPaused && !displayIsPlaying,
|
|
7
7
|
'play-button-box': !isBigButton,
|
|
@@ -18,104 +18,93 @@
|
|
|
18
18
|
/>
|
|
19
19
|
</button>
|
|
20
20
|
</template>
|
|
21
|
-
<script lang="ts">
|
|
21
|
+
<script setup lang="ts">
|
|
22
22
|
import PlayIcon from "vue-material-design-icons/Play.vue";
|
|
23
23
|
import PauseIcon from "vue-material-design-icons/Pause.vue";
|
|
24
24
|
import ClassicSpinner from "../../ClassicSpinner.vue";
|
|
25
|
-
import {
|
|
26
|
-
import { mapActions, mapState } from "pinia";
|
|
25
|
+
import { computed, onMounted, onUnmounted } from "vue";
|
|
27
26
|
import { usePlayerStore } from "../../../../stores/PlayerStore";
|
|
28
27
|
import { useVastStore } from "../../../../stores/VastStore";
|
|
29
|
-
|
|
30
|
-
name: "PlayerPlayButton",
|
|
28
|
+
import { useI18n } from "vue-i18n";
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(!this.isAdPlaying && this.isPlaying)
|
|
51
|
-
);
|
|
52
|
-
},
|
|
53
|
-
displayIsPaused(): boolean {
|
|
54
|
-
return (
|
|
55
|
-
(this.isAdPlaying && this.isAdPaused) ||
|
|
56
|
-
(!this.isAdPlaying && this.isPaused)
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
created() {
|
|
61
|
-
window.addEventListener("keydown", this.addKeyboardControl);
|
|
62
|
-
},
|
|
63
|
-
beforeUnmount() {
|
|
64
|
-
window.removeEventListener("keydown", this.addKeyboardControl);
|
|
65
|
-
},
|
|
66
|
-
methods: {
|
|
67
|
-
...mapActions(useVastStore, ["updateIsAdPaused"]),
|
|
68
|
-
...mapActions(usePlayerStore, ["playerChangeStatus"]),
|
|
69
|
-
addKeyboardControl(event: KeyboardEvent): void {
|
|
70
|
-
if (!event || null === event) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const element = event.target as HTMLElement;
|
|
74
|
-
if (
|
|
75
|
-
!element ||
|
|
76
|
-
"INPUT" == element.tagName.toUpperCase() ||
|
|
77
|
-
"TEXTAREA" == element.tagName.toUpperCase()
|
|
78
|
-
) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (" " === event.key || "Spacebar" === event.key) {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
this.switchPausePlay();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (this.isAdPlaying) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if ("ArrowRight" === event.key && event.ctrlKey) {
|
|
90
|
-
this.changeCurrentTime(15);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if ("ArrowLeft" === event.key && event.ctrlKey) {
|
|
94
|
-
this.changeCurrentTime(-15);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
changeCurrentTime(delay: number) {
|
|
98
|
-
const audioPlayer: HTMLAudioElement | null =
|
|
99
|
-
document.querySelector("#audio-player");
|
|
100
|
-
if (!audioPlayer) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
audioPlayer.currentTime += delay;
|
|
104
|
-
},
|
|
105
|
-
switchPausePlay(): void {
|
|
106
|
-
if (this.isAdPlaying) {
|
|
107
|
-
this.updateIsAdPaused(!this.isAdPaused);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const audioPlayer: HTMLAudioElement | null =
|
|
111
|
-
document.querySelector("#audio-player");
|
|
112
|
-
if (!audioPlayer) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
this.playerChangeStatus(!audioPlayer.paused);
|
|
116
|
-
},
|
|
117
|
-
},
|
|
30
|
+
//Props
|
|
31
|
+
defineProps({
|
|
32
|
+
playerError: { default: false, type: Boolean },
|
|
33
|
+
isBigButton: { default: false, type: Boolean },
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
//Composables
|
|
37
|
+
const { t } = useI18n();
|
|
38
|
+
const playerStore = usePlayerStore();
|
|
39
|
+
const vastStore = useVastStore();
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
//Computed
|
|
43
|
+
const displayIsPlaying = computed(() => {
|
|
44
|
+
return (
|
|
45
|
+
(vastStore.isAdPlaying && !vastStore.isAdPaused) ||
|
|
46
|
+
(!vastStore.isAdPlaying && playerStore.isPlaying)
|
|
47
|
+
);
|
|
118
48
|
});
|
|
49
|
+
const displayIsPaused = computed(() => {
|
|
50
|
+
return (
|
|
51
|
+
(vastStore.isAdPlaying && vastStore.isAdPaused) ||
|
|
52
|
+
(!vastStore.isAdPlaying && playerStore.isPaused)
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
onMounted(()=>window.addEventListener("keydown", addKeyboardControl));
|
|
58
|
+
onUnmounted(()=>window.removeEventListener("keydown", addKeyboardControl))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
//Methods
|
|
62
|
+
function addKeyboardControl(event: KeyboardEvent): void {
|
|
63
|
+
if (!event || null === event) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const element = event.target as HTMLElement;
|
|
67
|
+
if (
|
|
68
|
+
!element ||
|
|
69
|
+
"INPUT" == element.tagName.toUpperCase() ||
|
|
70
|
+
"TEXTAREA" == element.tagName.toUpperCase()
|
|
71
|
+
) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (" " === event.key || "Spacebar" === event.key) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
switchPausePlay();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (vastStore.isAdPlaying) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if ("ArrowRight" === event.key && event.ctrlKey) {
|
|
83
|
+
changeCurrentTime(15);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if ("ArrowLeft" === event.key && event.ctrlKey) {
|
|
87
|
+
changeCurrentTime(-15);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function changeCurrentTime(delay: number) {
|
|
91
|
+
const audioPlayer: HTMLAudioElement | null = document.querySelector("#audio-player");
|
|
92
|
+
if (!audioPlayer) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
audioPlayer.currentTime += delay;
|
|
96
|
+
}
|
|
97
|
+
function switchPausePlay(): void {
|
|
98
|
+
if (vastStore.isAdPlaying) {
|
|
99
|
+
vastStore.updateIsAdPaused(!vastStore.isAdPaused);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const audioPlayer: HTMLAudioElement | null =document.querySelector("#audio-player");
|
|
103
|
+
if (!audioPlayer) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
playerStore.playerChangeStatus(!audioPlayer.paused);
|
|
107
|
+
}
|
|
119
108
|
</script>
|
|
120
109
|
|
|
121
110
|
<style lang="scss">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
3
|
id="player-speed-button"
|
|
4
|
-
:title="
|
|
4
|
+
:title="t('Change speed')"
|
|
5
5
|
class="btn play-button-box small-font btn-transparent text-light me-0"
|
|
6
6
|
>
|
|
7
7
|
{{ "×" + speedArray[speedIndex] }}
|
|
@@ -25,34 +25,30 @@
|
|
|
25
25
|
</button>
|
|
26
26
|
</ClassicPopover>
|
|
27
27
|
</template>
|
|
28
|
-
<script lang="ts">
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { useI18n } from "vue-i18n";
|
|
29
30
|
import ClassicPopover from "../../ClassicPopover.vue";
|
|
30
|
-
import {
|
|
31
|
-
export default defineComponent({
|
|
32
|
-
name: "PlayerSpeedButton",
|
|
33
|
-
components: {
|
|
34
|
-
ClassicPopover,
|
|
35
|
-
},
|
|
31
|
+
import { onMounted, Ref, ref } from "vue";
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
33
|
+
//Data
|
|
34
|
+
const speedIndex = ref(2);
|
|
35
|
+
const speedArray = ref([0.5, 0.75, 1, 1.25, 1.5, 1.75]);
|
|
36
|
+
const audioPlayer: Ref<HTMLAudioElement | null> = ref(null);
|
|
37
|
+
|
|
38
|
+
//Composables
|
|
39
|
+
const { t } = useI18n();
|
|
40
|
+
|
|
41
|
+
onMounted(()=>{
|
|
42
|
+
audioPlayer.value = document.querySelector("#audio-player");
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
//Methods
|
|
46
|
+
function changeSpeed(index: number) {
|
|
47
|
+
speedIndex.value = index;
|
|
48
|
+
if (audioPlayer.value) {
|
|
49
|
+
audioPlayer.value.playbackRate = speedArray.value[speedIndex.value];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
56
52
|
</script>
|
|
57
53
|
|
|
58
54
|
<style lang="scss">
|
|
@@ -1,134 +1,108 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="playerError" class="text-warning mx-2">
|
|
3
|
-
{{
|
|
3
|
+
{{ t("Podcast play error") + " - " }}
|
|
4
4
|
</div>
|
|
5
5
|
<component
|
|
6
|
-
:is="linkAdvertising ? 'a' : 'div'"
|
|
6
|
+
:is="vastStore.linkAdvertising ? 'a' : 'div'"
|
|
7
7
|
class="flex-grow-1 text-truncate text-light"
|
|
8
8
|
:class="titleClass"
|
|
9
|
-
:href="linkAdvertising"
|
|
9
|
+
:href="vastStore.linkAdvertising"
|
|
10
10
|
rel="noreferrer noopener"
|
|
11
11
|
target="_blank"
|
|
12
|
-
:title="
|
|
12
|
+
:title="t('New window', {text: podcastTitle})"
|
|
13
13
|
>
|
|
14
14
|
{{ podcastTitle }}
|
|
15
15
|
</component>
|
|
16
16
|
</template>
|
|
17
|
-
<script lang="ts">
|
|
17
|
+
<script setup lang="ts">
|
|
18
18
|
import {useFetchRadio} from "../../../composable/radio/usefetchRadioData";
|
|
19
|
-
import { state } from "../../../../stores/ParamSdkStore";
|
|
20
19
|
import { usePlayerStore } from "../../../../stores/PlayerStore";
|
|
21
20
|
import { useVastStore } from "../../../../stores/VastStore";
|
|
22
|
-
import {
|
|
23
|
-
import { defineComponent } from "vue";
|
|
21
|
+
import { computed, onUnmounted, Ref, ref, watch } from "vue";
|
|
24
22
|
import { MediaRadio, NextAdvertising } from "@/stores/class/general/player";
|
|
25
23
|
import { Podcast } from "@/stores/class/general/podcast";
|
|
26
|
-
|
|
27
|
-
name: "PlayerTitle",
|
|
24
|
+
import { useI18n } from "vue-i18n";
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
26
|
+
//Props
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
playerError: { default: false, type: Boolean },
|
|
29
|
+
hlsReady: { default: false, type: Boolean },
|
|
30
|
+
titleClass: { default: "", type: String },
|
|
31
|
+
})
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return { fetchRadioMetadata, displayTitle };
|
|
38
|
-
},
|
|
33
|
+
//Data
|
|
34
|
+
const radioInterval: Ref<ReturnType<typeof setTimeout> | undefined> = ref(undefined);
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (this.playerRadio.podcast) {
|
|
67
|
-
return this.playerRadio.podcast.title;
|
|
68
|
-
}
|
|
69
|
-
return this.displayTitle(this.playerRadio.metadata);
|
|
70
|
-
}
|
|
71
|
-
if (this.playerPodcast) {
|
|
72
|
-
return this.playerPodcast.title;
|
|
73
|
-
}
|
|
74
|
-
if (this.playerMedia) return this.playerMedia.title;
|
|
75
|
-
if (this.playerLive) {
|
|
76
|
-
if (!this.hlsReady)
|
|
77
|
-
return (
|
|
78
|
-
this.playerLive.title + " (" + this.$t("Start in a while") + ")"
|
|
79
|
-
);
|
|
80
|
-
return this.playerLive.title;
|
|
81
|
-
}
|
|
82
|
-
return "";
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
watch: {
|
|
86
|
-
playerRadio: {
|
|
87
|
-
deep: true,
|
|
88
|
-
immediate: true,
|
|
89
|
-
handler(newValue, oldValue) {
|
|
90
|
-
if (oldValue && newValue && newValue.canalId === oldValue.canalId) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
clearInterval(this.radioInterval as unknown as number);
|
|
94
|
-
if (this.playerRadio) {
|
|
95
|
-
this.fetchCurrentlyPlaying();
|
|
96
|
-
this.radioInterval = setInterval(() => {
|
|
97
|
-
this.fetchCurrentlyPlaying();
|
|
98
|
-
}, 10000);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
unmounted(){
|
|
104
|
-
clearInterval(this.radioInterval as unknown as number);
|
|
105
|
-
this.radioInterval= undefined;
|
|
106
|
-
},
|
|
107
|
-
methods: {
|
|
108
|
-
...mapActions(usePlayerStore, [
|
|
109
|
-
"playerMetadata",
|
|
110
|
-
"playerRadioPodcast",
|
|
111
|
-
"playerRadioUpdateNextAdvertising",
|
|
112
|
-
]),
|
|
113
|
-
async fetchCurrentlyPlaying(): Promise<void> {
|
|
114
|
-
this.fetchRadioMetadata(
|
|
115
|
-
this.playerRadio?.canalId ?? 0,
|
|
116
|
-
this.playerRadio?.metadata.title ?? "",
|
|
117
|
-
this.updateMetadata,
|
|
118
|
-
this.updateAdvertising,
|
|
36
|
+
//Composables
|
|
37
|
+
const { t } = useI18n();
|
|
38
|
+
const { fetchRadioMetadata, displayTitle } = useFetchRadio();
|
|
39
|
+
const playerStore = usePlayerStore();
|
|
40
|
+
const vastStore = useVastStore();
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
//Computed
|
|
44
|
+
const podcastTitle = computed(() => {
|
|
45
|
+
if (vastStore.isAdPlaying) {
|
|
46
|
+
return t("Advertising") + vastStore.titleAdvertising;
|
|
47
|
+
}
|
|
48
|
+
if (playerStore.playerRadio) {
|
|
49
|
+
if (playerStore.playerRadio.podcast) {
|
|
50
|
+
return playerStore.playerRadio.podcast.title;
|
|
51
|
+
}
|
|
52
|
+
return displayTitle(playerStore.playerRadio.metadata);
|
|
53
|
+
}
|
|
54
|
+
if (playerStore.playerPodcast) {
|
|
55
|
+
return playerStore.playerPodcast.title;
|
|
56
|
+
}
|
|
57
|
+
if (playerStore.playerMedia) return playerStore.playerMedia.title;
|
|
58
|
+
if (playerStore.playerLive) {
|
|
59
|
+
if (!props.hlsReady)
|
|
60
|
+
return (
|
|
61
|
+
playerStore.playerLive.title + " (" + t("Start in a while") + ")"
|
|
119
62
|
);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
updateMetadata(
|
|
125
|
-
metadata: MediaRadio,
|
|
126
|
-
podcast: Podcast | undefined,
|
|
127
|
-
history: Array<MediaRadio>,
|
|
128
|
-
): void {
|
|
129
|
-
this.playerMetadata(metadata, history);
|
|
130
|
-
this.playerRadioPodcast(podcast);
|
|
131
|
-
},
|
|
132
|
-
},
|
|
63
|
+
return playerStore.playerLive.title;
|
|
64
|
+
}
|
|
65
|
+
return "";
|
|
133
66
|
});
|
|
67
|
+
|
|
68
|
+
//Watch
|
|
69
|
+
watch(()=>playerStore.playerRadio, (newValue, oldValue) => {
|
|
70
|
+
if (oldValue && newValue && newValue.canalId === oldValue.canalId) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
clearInterval(radioInterval.value as unknown as number);
|
|
74
|
+
if (playerStore.playerRadio) {
|
|
75
|
+
fetchCurrentlyPlaying();
|
|
76
|
+
radioInterval.value = setInterval(() => {
|
|
77
|
+
fetchCurrentlyPlaying();
|
|
78
|
+
}, 10000);
|
|
79
|
+
}
|
|
80
|
+
}, {deep: true,immediate: true});
|
|
81
|
+
|
|
82
|
+
onUnmounted(()=>{
|
|
83
|
+
clearInterval(radioInterval.value as unknown as number);
|
|
84
|
+
radioInterval.value= undefined;
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
//Methods
|
|
89
|
+
async function fetchCurrentlyPlaying(): Promise<void> {
|
|
90
|
+
fetchRadioMetadata(
|
|
91
|
+
playerStore.playerRadio?.canalId ?? 0,
|
|
92
|
+
playerStore.playerRadio?.metadata.title ?? "",
|
|
93
|
+
updateMetadata,
|
|
94
|
+
updateAdvertising,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function updateAdvertising(nextAdvertising: NextAdvertising): void {
|
|
98
|
+
playerStore.playerRadioUpdateNextAdvertising(nextAdvertising);
|
|
99
|
+
}
|
|
100
|
+
function updateMetadata(
|
|
101
|
+
metadata: MediaRadio,
|
|
102
|
+
podcast: Podcast | undefined,
|
|
103
|
+
history: Array<MediaRadio>,
|
|
104
|
+
): void {
|
|
105
|
+
playerStore.playerMetadata(metadata, history);
|
|
106
|
+
playerStore.playerRadioPodcast(podcast);
|
|
107
|
+
}
|
|
134
108
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<AdsProgressBar v-if="isAdPlaying" :class="classProgress" />
|
|
3
|
-
<RadioProgressBar v-else-if="radioUrl" :class="classProgress" />
|
|
2
|
+
<AdsProgressBar v-if="vastStore.isAdPlaying" :class="classProgress" />
|
|
3
|
+
<RadioProgressBar v-else-if="playerStore.radioUrl" :class="classProgress" />
|
|
4
4
|
<PodcastProgressBar
|
|
5
5
|
v-else
|
|
6
6
|
:show-comments="showComments"
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
:class-progress="classProgress"
|
|
13
13
|
/>
|
|
14
14
|
</template>
|
|
15
|
-
<script lang="ts">
|
|
16
|
-
import { defineAsyncComponent
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { defineAsyncComponent } from "vue";
|
|
17
17
|
import { usePlayerStore } from "../../../../stores/PlayerStore";
|
|
18
18
|
import { useVastStore } from "../../../../stores/VastStore";
|
|
19
|
-
import { mapState } from "pinia";
|
|
20
19
|
const RadioProgressBar = defineAsyncComponent(
|
|
21
20
|
() => import("../radio/RadioProgressBar.vue"),
|
|
22
21
|
);
|
|
@@ -26,30 +25,20 @@ const AdsProgressBar = defineAsyncComponent(
|
|
|
26
25
|
const PodcastProgressBar = defineAsyncComponent(
|
|
27
26
|
() => import("./PodcastProgressBar.vue"),
|
|
28
27
|
);
|
|
29
|
-
export default defineComponent({
|
|
30
|
-
name: "PlayerProgressBar",
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
29
|
+
//Props
|
|
30
|
+
defineProps({
|
|
31
|
+
classProgress: { default: "", type: String },
|
|
32
|
+
playerError: { default: false, type: Boolean },
|
|
33
|
+
showComments: { default: false, type: Boolean },
|
|
34
|
+
displayAlertBar: { default: false, type: Boolean },
|
|
35
|
+
percentLiveProgress: { default: 0, type: Number },
|
|
36
|
+
durationLivePosition: { default: 0, type: Number },
|
|
37
|
+
listenTime: { default: 0, type: Number },
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
//Composables
|
|
41
|
+
const playerStore = usePlayerStore();
|
|
42
|
+
const vastStore = useVastStore();
|
|
37
43
|
|
|
38
|
-
props: {
|
|
39
|
-
classProgress: { default: "", type: String },
|
|
40
|
-
playerError: { default: false, type: Boolean },
|
|
41
|
-
showComments: { default: false, type: Boolean },
|
|
42
|
-
displayAlertBar: { default: false, type: Boolean },
|
|
43
|
-
percentLiveProgress: { default: 0, type: Number },
|
|
44
|
-
durationLivePosition: { default: 0, type: Number },
|
|
45
|
-
listenTime: { default: 0, type: Number },
|
|
46
|
-
},
|
|
47
|
-
data() {
|
|
48
|
-
return {};
|
|
49
|
-
},
|
|
50
|
-
computed: {
|
|
51
|
-
...mapState(useVastStore, ["isAdPlaying"]),
|
|
52
|
-
...mapState(usePlayerStore, ["radioUrl"]),
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
44
|
</script>
|
|
@@ -11,69 +11,58 @@
|
|
|
11
11
|
<CommentPlayer v-if="showComments" />
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
|
-
<script lang="ts">
|
|
14
|
+
<script setup lang="ts">
|
|
15
15
|
import { usePlayerStore } from "../../../../stores/PlayerStore";
|
|
16
|
-
import { mapState, mapActions } from "pinia";
|
|
17
16
|
import ProgressBar from "../../ProgressBar.vue";
|
|
18
|
-
import {
|
|
17
|
+
import { defineAsyncComponent, computed } from "vue";
|
|
19
18
|
const CommentPlayer = defineAsyncComponent(
|
|
20
19
|
() => import("../../../display/comments/CommentPlayer.vue"),
|
|
21
20
|
);
|
|
22
|
-
export default defineComponent({
|
|
23
|
-
name: "PodcastProgressBar",
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
playerError: { default: false, type: Boolean },
|
|
36
|
-
listenTime: { default: 0, type: Number },
|
|
37
|
-
},
|
|
22
|
+
//Props
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
classProgress: { default: "", type: String },
|
|
25
|
+
showComments: { default: false, type: Boolean },
|
|
26
|
+
displayAlertBar: { default: false, type: Boolean },
|
|
27
|
+
percentLiveProgress: { default: 0, type: Number },
|
|
28
|
+
durationLivePosition: { default: 0, type: Number },
|
|
29
|
+
playerError: { default: false, type: Boolean },
|
|
30
|
+
listenTime: { default: 0, type: Number },
|
|
31
|
+
})
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"playerElapsed",
|
|
42
|
-
"playerTotal",
|
|
43
|
-
"playerPodcast",
|
|
44
|
-
"playerLive",
|
|
45
|
-
]),
|
|
46
|
-
percentProgress(): number {
|
|
47
|
-
if (!this.playerElapsed) {
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
return this.playerElapsed * 100;
|
|
51
|
-
},
|
|
52
|
-
},
|
|
33
|
+
//Composables
|
|
34
|
+
const playerStore = usePlayerStore();
|
|
53
35
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
const rect = (event.currentTarget as Element).getBoundingClientRect();
|
|
63
|
-
const barWidth = (event.currentTarget as Element).clientWidth;
|
|
64
|
-
const x = event.clientX - rect.left;
|
|
65
|
-
const percentPosition = x / barWidth;
|
|
66
|
-
if (this.playerLive && percentPosition * 100 >= this.percentLiveProgress) return;
|
|
67
|
-
const seekTime = this.playerTotal * percentPosition;
|
|
68
|
-
this.isSeekTo(audioPlayer, seekTime);
|
|
69
|
-
},
|
|
70
|
-
isSeekTo(audioPlayer: HTMLAudioElement, seekTime: number): void {
|
|
71
|
-
if (this.playerPodcast || this.playerLive) {
|
|
72
|
-
this.playerUpdateSeekTime(seekTime);
|
|
73
|
-
} else {
|
|
74
|
-
audioPlayer.currentTime = seekTime;
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
},
|
|
36
|
+
|
|
37
|
+
//Computed
|
|
38
|
+
const percentProgress = computed(() => {
|
|
39
|
+
if (!playerStore.playerElapsed) {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
return playerStore.playerElapsed * 100;
|
|
78
43
|
});
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
//Methods
|
|
47
|
+
function seekTo(event: MouseEvent): void {
|
|
48
|
+
const audioPlayer: HTMLAudioElement | null =
|
|
49
|
+
document.querySelector("#audio-player");
|
|
50
|
+
if (!audioPlayer || null === event.currentTarget) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const rect = (event.currentTarget as Element).getBoundingClientRect();
|
|
54
|
+
const barWidth = (event.currentTarget as Element).clientWidth;
|
|
55
|
+
const x = event.clientX - rect.left;
|
|
56
|
+
const percentPosition = x / barWidth;
|
|
57
|
+
if (playerStore.playerLive && percentPosition * 100 >= props.percentLiveProgress) return;
|
|
58
|
+
const seekTime = playerStore.playerTotal * percentPosition;
|
|
59
|
+
isSeekTo(audioPlayer, seekTime);
|
|
60
|
+
}
|
|
61
|
+
function isSeekTo(audioPlayer: HTMLAudioElement, seekTime: number): void {
|
|
62
|
+
if (playerStore.playerPodcast || playerStore.playerLive) {
|
|
63
|
+
playerStore.playerUpdateSeekTime(seekTime);
|
|
64
|
+
} else {
|
|
65
|
+
audioPlayer.currentTime = seekTime;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
79
68
|
</script>
|