@saooti/octopus-sdk 37.0.6 → 37.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/index.ts +22 -22
- package/package.json +26 -22
- package/src/App.vue +69 -60
- package/src/api/classicCrud.ts +12 -12
- package/src/api/initialize.ts +1 -1
- package/src/assets/transition.scss +34 -22
- package/src/components/display/aggregator/RssSection.vue +3 -3
- package/src/components/display/categories/CategoryChooser.vue +73 -60
- package/src/components/display/categories/CategoryFilter.vue +134 -90
- package/src/components/display/categories/CategoryList.vue +76 -62
- package/src/components/display/comments/AddCommentModal.vue +44 -44
- package/src/components/display/comments/CommentBasicView.vue +38 -30
- package/src/components/display/comments/CommentInput.vue +121 -106
- package/src/components/display/comments/CommentItem.vue +144 -102
- package/src/components/display/comments/CommentList.vue +117 -85
- package/src/components/display/comments/CommentParentInfo.vue +18 -15
- package/src/components/display/comments/CommentPlayer.vue +39 -41
- package/src/components/display/comments/CommentSection.vue +68 -53
- package/src/components/display/edit/EditBox.vue +7 -7
- package/src/components/display/edit/EditBoxRadio.vue +3 -4
- package/src/components/display/edit/EditCommentBox.vue +34 -36
- package/src/components/display/emission/EmissionInlineList.vue +75 -63
- package/src/components/display/emission/EmissionItem.vue +47 -35
- package/src/components/display/emission/EmissionList.vue +118 -83
- package/src/components/display/emission/EmissionPlayerItem.vue +89 -89
- package/src/components/display/filter/AdvancedSearch.vue +81 -73
- package/src/components/display/filter/CategorySearchFilter.vue +27 -25
- package/src/components/display/filter/DateFilter.vue +38 -38
- package/src/components/display/filter/MonetizableFilter.vue +16 -14
- package/src/components/display/filter/ProductorSearch.vue +55 -47
- package/src/components/display/filter/RubriqueChoice.vue +42 -27
- package/src/components/display/filter/RubriqueFilter.vue +130 -85
- package/src/components/display/filter/SearchOrder.vue +16 -11
- package/src/components/display/list/ListPaginate.vue +72 -70
- package/src/components/display/list/PaginateParams.vue +29 -30
- package/src/components/display/list/PaginateSection.vue +210 -0
- package/src/components/display/list/SwiperList.vue +28 -32
- package/src/components/display/live/CountDown.vue +12 -14
- package/src/components/display/live/LiveHorizontalList.vue +60 -50
- package/src/components/display/live/LiveItem.vue +42 -26
- package/src/components/display/live/LiveList.vue +92 -65
- package/src/components/display/live/RadioCurrently.vue +47 -42
- package/src/components/display/live/RadioImage.vue +40 -42
- package/src/components/display/live/RadioItem.vue +15 -22
- package/src/components/display/live/RadioList.vue +24 -21
- package/src/components/display/live/RadioPlanning.vue +105 -68
- package/src/components/display/organisation/OrganisationChooser.vue +58 -42
- package/src/components/display/organisation/OrganisationChooserLight.vue +27 -19
- package/src/components/display/participant/ParticipantItem.vue +89 -77
- package/src/components/display/participant/ParticipantList.vue +90 -60
- package/src/components/display/playlist/PlaylistItem.vue +32 -35
- package/src/components/display/playlist/PlaylistList.vue +70 -52
- package/src/components/display/playlist/PodcastList.vue +61 -50
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +47 -38
- package/src/components/display/podcasts/AnimatorsItem.vue +17 -15
- package/src/components/display/podcasts/ParticipantDescription.vue +21 -22
- package/src/components/display/podcasts/PodcastFilterList.vue +28 -26
- package/src/components/display/podcasts/PodcastImage.vue +129 -131
- package/src/components/display/podcasts/PodcastInlineList.vue +33 -29
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +91 -71
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +94 -85
- package/src/components/display/podcasts/PodcastItem.vue +96 -90
- package/src/components/display/podcasts/PodcastItemInfo.vue +61 -65
- package/src/components/display/podcasts/PodcastList.vue +115 -84
- package/src/components/display/podcasts/PodcastModuleBox.vue +95 -104
- package/src/components/display/podcasts/PodcastPlayBar.vue +45 -32
- package/src/components/display/podcasts/PodcastSwiperList.vue +65 -55
- package/src/components/display/podcasts/TagList.vue +33 -37
- package/src/components/display/rubriques/RubriqueChooser.vue +70 -51
- package/src/components/display/rubriques/RubriqueList.vue +117 -89
- package/src/components/display/sharing/PlayerParameters.vue +45 -42
- package/src/components/display/sharing/QrCode.vue +52 -46
- package/src/components/display/sharing/ShareButtons.vue +18 -18
- package/src/components/display/sharing/ShareButtonsIntern.vue +100 -78
- package/src/components/display/sharing/ShareDistribution.vue +101 -67
- package/src/components/display/sharing/SharePlayer.vue +207 -127
- package/src/components/display/sharing/SharePlayerColors.vue +15 -15
- package/src/components/display/sharing/SharePlayerRadio.vue +62 -39
- package/src/components/display/sharing/SharePlayerTypes.vue +93 -55
- package/src/components/display/sharing/SubscribeButtons.vue +83 -32
- package/src/components/display/studio/RecordingItemButton.vue +3 -3
- package/src/components/form/ClassicCheckbox.vue +32 -31
- package/src/components/form/ClassicDatePicker.vue +47 -49
- package/src/components/form/ClassicInputText.vue +99 -98
- package/src/components/form/ClassicLoading.vue +11 -14
- package/src/components/form/ClassicMultiselect.vue +125 -126
- package/src/components/form/ClassicRadio.vue +15 -18
- package/src/components/form/ClassicSearch.vue +17 -23
- package/src/components/form/ClassicSelect.vue +35 -27
- package/src/components/form/{Wysiwyg.vue → ClassicWysiwyg.vue} +103 -118
- package/src/components/misc/AcpmImage.vue +6 -6
- package/src/components/misc/ClassicAccordion.vue +73 -0
- package/src/components/misc/ClassicNav.vue +117 -0
- package/src/components/misc/ClassicPopover.vue +212 -0
- package/src/components/misc/{Spinner.vue → ClassicSpinner.vue} +14 -15
- package/src/components/misc/ErrorMessage.vue +9 -17
- package/src/components/misc/FooterSection.vue +198 -0
- package/src/components/misc/HomeDropdown.vue +60 -60
- package/src/components/misc/LeftMenu.vue +115 -79
- package/src/components/misc/ProgressBar.vue +36 -32
- package/src/components/misc/SnackBar.vue +169 -0
- package/src/components/misc/TopBar.vue +162 -116
- package/src/components/misc/modal/ClassicModal.vue +99 -103
- package/src/components/misc/modal/ClipboardModal.vue +21 -23
- package/src/components/misc/modal/MessageModal.vue +22 -28
- package/src/components/misc/modal/NewsletterModal.vue +139 -113
- package/src/components/misc/modal/QrCodeModal.vue +14 -17
- package/src/components/misc/modal/ShareModalPlayer.vue +44 -60
- package/src/components/misc/player/PlayerCompact.vue +47 -62
- package/src/components/misc/player/{Player.vue → PlayerComponent.vue} +54 -46
- package/src/components/misc/player/PlayerLarge.vue +62 -61
- package/src/components/misc/player/PlayerProgressBar.vue +40 -30
- package/src/components/misc/player/PlayerTimeline.vue +32 -36
- package/src/components/misc/player/radio/RadioHistory.vue +62 -59
- package/src/components/misc/player/radio/RadioProgressBar.vue +44 -35
- package/src/components/mixins/cookies.ts +11 -10
- package/src/components/mixins/displayMethods.ts +5 -4
- package/src/components/mixins/handle403.ts +9 -9
- package/src/components/mixins/imageProxy.ts +14 -7
- package/src/components/mixins/init.ts +31 -16
- package/src/components/mixins/orgaComputed.ts +7 -7
- package/src/components/mixins/organisationFilter.ts +36 -22
- package/src/components/mixins/player/playerComment.ts +46 -37
- package/src/components/mixins/player/playerDisplay.ts +122 -87
- package/src/components/mixins/player/playerLive.ts +65 -43
- package/src/components/mixins/player/playerLogic.ts +133 -88
- package/src/components/mixins/player/playerTranscript.ts +48 -30
- package/src/components/mixins/radio/fetchRadioData.ts +40 -23
- package/src/components/mixins/selenium.ts +2 -2
- package/src/components/mixins/tagOfMixins.ts +11 -11
- package/src/components/pages/CategoryPage.vue +43 -0
- package/src/components/pages/{Emission.vue → EmissionPage.vue} +98 -67
- package/src/components/pages/{Emissions.vue → EmissionsPage.vue} +51 -44
- package/src/components/pages/Error403Page.vue +20 -19
- package/src/components/pages/HomePage.vue +144 -0
- package/src/components/pages/LivesPage.vue +66 -0
- package/src/components/pages/PageNotFound.vue +33 -22
- package/src/components/pages/{Participant.vue → ParticipantPage.vue} +63 -49
- package/src/components/pages/{Participants.vue → ParticipantsPage.vue} +9 -9
- package/src/components/pages/PlaylistPage.vue +175 -0
- package/src/components/pages/{Playlists.vue → PlaylistsPage.vue} +16 -14
- package/src/components/pages/PodcastPage.vue +365 -0
- package/src/components/pages/PodcastsPage.vue +152 -0
- package/src/components/pages/RadioPage.vue +131 -0
- package/src/components/pages/RubriquePage.vue +45 -0
- package/src/components/pages/{Search.vue → SearchPage.vue} +19 -19
- package/src/helper/dom.ts +1 -1
- package/src/helper/duration.ts +10 -4
- package/src/helper/useEventListener.ts +7 -8
- package/src/i18n.ts +31 -30
- package/src/locale/de.ts +272 -257
- package/src/locale/educationen.ts +13 -13
- package/src/locale/educationfr.ts +1 -1
- package/src/locale/en.ts +332 -324
- package/src/locale/es.ts +334 -318
- package/src/locale/fr.ts +339 -324
- package/src/locale/it.ts +341 -328
- package/src/locale/messages.ts +9 -9
- package/src/locale/sl.ts +324 -319
- package/src/main.ts +28 -31
- package/src/router/router.ts +218 -198
- package/src/shims-tsx.d.ts +1 -1
- package/src/shims-vue.d.ts +1 -1
- package/src/stores/ApiStore.ts +44 -44
- package/src/stores/AuthStore.ts +21 -15
- package/src/stores/CommentStore.ts +13 -11
- package/src/stores/FilterStore.ts +25 -15
- package/src/stores/GeneralStore.ts +15 -15
- package/src/stores/ParamSdkStore.ts +179 -137
- package/src/stores/PlayerStore.ts +139 -125
- package/src/stores/class/adserver/adserverConfig.ts +1 -1
- package/src/stores/class/adserver/adserverOtherEmission.ts +9 -9
- package/src/stores/class/cartouchier/cartouche.ts +4 -4
- package/src/stores/class/cartouchier/cartouchier.ts +2 -2
- package/src/stores/class/conference/conference.ts +10 -9
- package/src/stores/class/conference/conferenceMessage.ts +2 -2
- package/src/stores/class/conference/conferenceParticipant.ts +1 -1
- package/src/stores/class/conference/studioCall.ts +6 -6
- package/src/stores/class/contract/contractOrganisation.ts +5 -5
- package/src/stores/class/ftp/ftpEmission.ts +9 -9
- package/src/stores/class/ftp/testFtpEmission.ts +4 -4
- package/src/stores/class/general/audioView.ts +19 -19
- package/src/stores/class/general/category.ts +1 -1
- package/src/stores/class/general/classicSelectType.ts +2 -3
- package/src/stores/class/general/customPlayer.ts +8 -8
- package/src/stores/class/general/emission.ts +20 -20
- package/src/stores/class/general/fetchParam.ts +8 -2
- package/src/stores/class/general/initState.ts +31 -31
- package/src/stores/class/general/interfacePageable.ts +13 -13
- package/src/stores/class/general/ituneCategory.ts +4 -4
- package/src/stores/class/general/listReturn.ts +12 -12
- package/src/stores/class/general/media.ts +7 -7
- package/src/stores/class/general/organisation.ts +9 -9
- package/src/stores/class/general/pageable.ts +10 -10
- package/src/stores/class/general/participant.ts +7 -7
- package/src/stores/class/general/player.ts +30 -28
- package/src/stores/class/general/playlist.ts +17 -19
- package/src/stores/class/general/podcast.ts +19 -19
- package/src/stores/class/general/sortPageable.ts +4 -4
- package/src/stores/class/general/soundcastCategory.ts +7 -7
- package/src/stores/class/ouestFrance/ofTag.ts +34 -34
- package/src/stores/class/ouestFrance/ofTagInfo.ts +9 -9
- package/src/stores/class/ouestFrance/ofTagPage.ts +7 -7
- package/src/stores/class/ouestFrance/ofTagSeo.ts +7 -7
- package/src/stores/class/ouestFrance/ofTagVente.ts +6 -6
- package/src/stores/class/ouestFrance/ofTagWithParents.ts +20 -20
- package/src/stores/class/radio/canal.ts +4 -4
- package/src/stores/class/radio/live.ts +6 -6
- package/src/stores/class/radio/mix.ts +16 -16
- package/src/stores/class/radio/playlistMedia.ts +7 -7
- package/src/stores/class/radio/recurrence.ts +54 -54
- package/src/stores/class/rss/rssEmission.ts +13 -13
- package/src/stores/class/rss/rssInfo.ts +7 -7
- package/src/stores/class/rubrique/rubriquage.ts +2 -2
- package/src/stores/class/rubrique/rubrique.ts +1 -1
- package/src/stores/class/stat/statArrayIncome.ts +5 -5
- package/src/stores/class/stat/statArrayObject.ts +26 -26
- package/src/stores/class/stat/statGraph.ts +6 -6
- package/src/stores/class/user/person.ts +4 -2
- package/src/stores/class/user/profile.ts +4 -2
- package/src/stores/class/user/userKeycloak.ts +4 -5
- package/src/components/display/list/Paginate.vue +0 -181
- package/src/components/misc/Accordion.vue +0 -78
- package/src/components/misc/Footer.vue +0 -169
- package/src/components/misc/Nav.vue +0 -119
- package/src/components/misc/Popover.vue +0 -193
- package/src/components/misc/Snackbar.vue +0 -168
- package/src/components/pages/Category.vue +0 -41
- package/src/components/pages/Home.vue +0 -125
- package/src/components/pages/Lives.vue +0 -64
- package/src/components/pages/Playlist.vue +0 -164
- package/src/components/pages/Podcast.vue +0 -307
- package/src/components/pages/Podcasts.vue +0 -146
- package/src/components/pages/Radio.vue +0 -122
- package/src/components/pages/Rubrique.vue +0 -42
|
@@ -1,134 +1,169 @@
|
|
|
1
|
-
import { state } from
|
|
2
|
-
import { defineComponent } from
|
|
3
|
-
import { RouteLocationRaw } from
|
|
4
|
-
import {fetchRadioData} from
|
|
5
|
-
import { MediaRadio } from
|
|
6
|
-
import { usePlayerStore } from
|
|
7
|
-
import { useFilterStore } from
|
|
8
|
-
import { mapState, mapActions } from
|
|
9
|
-
import { Podcast } from
|
|
1
|
+
import { state } from "../../../stores/ParamSdkStore";
|
|
2
|
+
import { defineComponent } from "vue";
|
|
3
|
+
import { RouteLocationRaw } from "vue-router";
|
|
4
|
+
import { fetchRadioData } from "../../mixins/radio/fetchRadioData";
|
|
5
|
+
import { MediaRadio } from "@/stores/class/general/player";
|
|
6
|
+
import { usePlayerStore } from "@/stores/PlayerStore";
|
|
7
|
+
import { useFilterStore } from "@/stores/FilterStore";
|
|
8
|
+
import { mapState, mapActions } from "pinia";
|
|
9
|
+
import { Podcast } from "@/stores/class/general/podcast";
|
|
10
10
|
export const playerDisplay = defineComponent({
|
|
11
|
-
props: {
|
|
12
|
-
hlsReady: { default: false , type: Boolean},
|
|
13
|
-
},
|
|
14
11
|
mixins: [fetchRadioData],
|
|
12
|
+
props: {
|
|
13
|
+
hlsReady: { default: false, type: Boolean },
|
|
14
|
+
},
|
|
15
15
|
data() {
|
|
16
16
|
return {
|
|
17
|
-
radioInterval: undefined as
|
|
17
|
+
radioInterval: undefined as ReturnType<typeof setTimeout> | undefined,
|
|
18
18
|
};
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
computed: {
|
|
21
21
|
...mapState(usePlayerStore, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
"playerPodcast",
|
|
23
|
+
"playerRadio",
|
|
24
|
+
"playerLive",
|
|
25
|
+
"playerMedia",
|
|
26
|
+
"playedTime",
|
|
27
|
+
"totalTime",
|
|
28
|
+
"isPlaying",
|
|
29
|
+
"isPaused",
|
|
30
|
+
"podcastImage",
|
|
31
|
+
"emissionName",
|
|
32
|
+
"transcriptText",
|
|
33
|
+
"radioUrl",
|
|
34
34
|
]),
|
|
35
|
-
...mapState(useFilterStore, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if(this.playerRadio?.podcast?.podcastId){
|
|
35
|
+
...mapState(useFilterStore, ["filterOrgaId"]),
|
|
36
|
+
isImage(): boolean {
|
|
37
|
+
return state.player.image as boolean;
|
|
38
|
+
},
|
|
39
|
+
podcastShareUrl(): RouteLocationRaw | string {
|
|
40
|
+
if (this.playerRadio?.podcast?.podcastId) {
|
|
41
41
|
return {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
name: "podcast",
|
|
43
|
+
params: {
|
|
44
|
+
podcastId: this.playerRadio?.podcast?.podcastId.toString(),
|
|
45
|
+
},
|
|
46
|
+
query: { productor: this.filterOrgaId },
|
|
47
|
+
};
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return
|
|
49
|
+
if (this.playerPodcast) {
|
|
50
|
+
return {
|
|
51
|
+
name: "podcast",
|
|
52
|
+
params: { podcastId: this.playerPodcast.podcastId.toString() },
|
|
53
|
+
query: { productor: this.filterOrgaId },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return "";
|
|
57
|
+
},
|
|
58
|
+
isEmissionName(): boolean {
|
|
59
|
+
return state.player.emissionName as boolean;
|
|
58
60
|
},
|
|
59
|
-
|
|
60
|
-
if(this.playerRadio){
|
|
61
|
-
if(this.playerRadio.podcast){
|
|
61
|
+
podcastTitle(): string {
|
|
62
|
+
if (this.playerRadio) {
|
|
63
|
+
if (this.playerRadio.podcast) {
|
|
62
64
|
return this.playerRadio.podcast.title;
|
|
63
65
|
}
|
|
64
66
|
return this.displayTitle(this.playerRadio.metadata);
|
|
65
67
|
}
|
|
66
68
|
if (this.playerPodcast) {
|
|
67
69
|
if (this.isEmissionName)
|
|
68
|
-
return this.emissionName +
|
|
70
|
+
return this.emissionName + " - " + this.playerPodcast.title;
|
|
69
71
|
return this.playerPodcast.title;
|
|
70
72
|
}
|
|
71
73
|
if (this.playerMedia) return this.playerMedia.title;
|
|
72
74
|
if (this.playerLive) {
|
|
73
75
|
if (!this.hlsReady)
|
|
74
|
-
return
|
|
76
|
+
return (
|
|
77
|
+
this.playerLive.title + " (" + this.$t("Start in a while") + ")"
|
|
78
|
+
);
|
|
75
79
|
return this.playerLive.title;
|
|
76
80
|
}
|
|
77
|
-
return
|
|
81
|
+
return "";
|
|
78
82
|
},
|
|
79
|
-
|
|
80
|
-
watch:{
|
|
83
|
+
},
|
|
84
|
+
watch: {
|
|
81
85
|
playerRadio: {
|
|
82
86
|
deep: true,
|
|
83
|
-
immediate:true,
|
|
84
|
-
handler(newValue,oldValue){
|
|
85
|
-
if(oldValue && newValue && newValue.canalId === oldValue.canalId){
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
immediate: true,
|
|
88
|
+
handler(newValue, oldValue) {
|
|
89
|
+
if (oldValue && newValue && newValue.canalId === oldValue.canalId) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
clearInterval(this.radioInterval as unknown as number);
|
|
93
|
+
if (this.playerRadio) {
|
|
88
94
|
this.fetchCurrentlyPlaying();
|
|
89
95
|
this.radioInterval = setInterval(() => {
|
|
90
96
|
this.fetchCurrentlyPlaying();
|
|
91
97
|
}, 10000);
|
|
92
98
|
}
|
|
93
|
-
}
|
|
99
|
+
},
|
|
94
100
|
},
|
|
95
101
|
},
|
|
96
|
-
|
|
97
|
-
window.addEventListener(
|
|
102
|
+
created() {
|
|
103
|
+
window.addEventListener("keydown", this.addKeyboardControl);
|
|
98
104
|
},
|
|
99
105
|
beforeUnmount() {
|
|
100
|
-
window.removeEventListener(
|
|
106
|
+
window.removeEventListener("keydown", this.addKeyboardControl);
|
|
101
107
|
},
|
|
102
108
|
methods: {
|
|
103
|
-
...mapActions(usePlayerStore, [
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
...mapActions(usePlayerStore, [
|
|
110
|
+
"playerMetadata",
|
|
111
|
+
"playerChangeStatus",
|
|
112
|
+
"playerRadioPodcast",
|
|
113
|
+
]),
|
|
114
|
+
async fetchCurrentlyPlaying(): Promise<void> {
|
|
115
|
+
this.fetchRadioMetadata(
|
|
116
|
+
this.playerRadio?.canalId ?? 0,
|
|
117
|
+
this.playerRadio?.metadata.title ?? "",
|
|
118
|
+
this.updateMetadata,
|
|
119
|
+
);
|
|
106
120
|
},
|
|
107
|
-
updateMetadata(
|
|
108
|
-
|
|
121
|
+
updateMetadata(
|
|
122
|
+
metadata: MediaRadio,
|
|
123
|
+
podcast: Podcast | undefined,
|
|
124
|
+
history?: Array<MediaRadio>,
|
|
125
|
+
): void {
|
|
126
|
+
this.playerMetadata(metadata, history ?? []);
|
|
109
127
|
this.playerRadioPodcast(podcast);
|
|
110
128
|
},
|
|
111
|
-
addKeyboardControl(event: KeyboardEvent): void{
|
|
112
|
-
if(!event || null ===event){
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
129
|
+
addKeyboardControl(event: KeyboardEvent): void {
|
|
130
|
+
if (!event || null === event) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const element = event.target as HTMLElement;
|
|
134
|
+
if (
|
|
135
|
+
!element ||
|
|
136
|
+
"INPUT" == element.tagName.toUpperCase() ||
|
|
137
|
+
"TEXTAREA" == element.tagName.toUpperCase()
|
|
138
|
+
) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (" " === event.key || "Spacebar" === event.key) {
|
|
116
142
|
event.preventDefault();
|
|
117
143
|
this.switchPausePlay();
|
|
118
|
-
|
|
119
|
-
const audioPlayer: HTMLAudioElement|null =
|
|
120
|
-
|
|
144
|
+
} else if ("ArrowRight" === event.key && event.ctrlKey) {
|
|
145
|
+
const audioPlayer: HTMLAudioElement | null =
|
|
146
|
+
document.querySelector("#audio-player");
|
|
147
|
+
if (!audioPlayer) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
121
150
|
audioPlayer.currentTime += 15;
|
|
122
|
-
|
|
123
|
-
const audioPlayer: HTMLAudioElement|null =
|
|
124
|
-
|
|
125
|
-
audioPlayer
|
|
126
|
-
|
|
151
|
+
} else if ("ArrowLeft" === event.key && event.ctrlKey) {
|
|
152
|
+
const audioPlayer: HTMLAudioElement | null =
|
|
153
|
+
document.querySelector("#audio-player");
|
|
154
|
+
if (!audioPlayer) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
audioPlayer.currentTime -= 15;
|
|
158
|
+
}
|
|
127
159
|
},
|
|
128
|
-
|
|
129
|
-
const audioPlayer: HTMLAudioElement|null =
|
|
130
|
-
|
|
160
|
+
switchPausePlay(): void {
|
|
161
|
+
const audioPlayer: HTMLAudioElement | null =
|
|
162
|
+
document.querySelector("#audio-player");
|
|
163
|
+
if (!audioPlayer) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
131
166
|
this.playerChangeStatus(!audioPlayer.paused);
|
|
132
167
|
},
|
|
133
|
-
|
|
134
|
-
});
|
|
168
|
+
},
|
|
169
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { state } from
|
|
2
|
-
import octopusApi from
|
|
3
|
-
import { usePlayerStore } from
|
|
4
|
-
import { useAuthStore } from
|
|
5
|
-
import { mapState, mapActions } from
|
|
1
|
+
import { state } from "../../../stores/ParamSdkStore";
|
|
2
|
+
import octopusApi from "@saooti/octopus-api";
|
|
3
|
+
import { usePlayerStore } from "@/stores/PlayerStore";
|
|
4
|
+
import { useAuthStore } from "@/stores/AuthStore";
|
|
5
|
+
import { mapState, mapActions } from "pinia";
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
let Hls:any = null;
|
|
8
8
|
/* eslint-enable */
|
|
9
|
-
import { defineComponent } from
|
|
9
|
+
import { defineComponent } from "vue";
|
|
10
10
|
export const playerLive = defineComponent({
|
|
11
11
|
data() {
|
|
12
12
|
return {
|
|
@@ -14,21 +14,21 @@ export const playerLive = defineComponent({
|
|
|
14
14
|
notListenTime: 0 as number,
|
|
15
15
|
lastSend: 0 as number,
|
|
16
16
|
hlsReady: false as boolean,
|
|
17
|
-
downloadId: null as string|null,
|
|
18
|
-
audioElement: null as HTMLAudioElement|null,
|
|
17
|
+
downloadId: null as string | null,
|
|
18
|
+
audioElement: null as HTMLAudioElement | null,
|
|
19
19
|
hls: null as any,
|
|
20
20
|
};
|
|
21
21
|
},
|
|
22
22
|
computed: {
|
|
23
|
-
...mapState(usePlayerStore, [
|
|
24
|
-
...mapState(useAuthStore, [
|
|
23
|
+
...mapState(usePlayerStore, ["playerLive", "playerRadio"]),
|
|
24
|
+
...mapState(useAuthStore, ["authOrgaId"]),
|
|
25
25
|
},
|
|
26
26
|
methods: {
|
|
27
|
-
...mapActions(usePlayerStore, [
|
|
27
|
+
...mapActions(usePlayerStore, ["playerChangeStatus"]),
|
|
28
28
|
onPlay(): void {
|
|
29
29
|
this.playerChangeStatus(false);
|
|
30
30
|
},
|
|
31
|
-
playRadio(){
|
|
31
|
+
playRadio() {
|
|
32
32
|
if (!this.playerRadio) return;
|
|
33
33
|
this.playHls(this.playerRadio.url);
|
|
34
34
|
},
|
|
@@ -37,10 +37,12 @@ export const playerLive = defineComponent({
|
|
|
37
37
|
const hlsStreamUrl = `${state.podcastPage.hlsUri}live/dev.${this.playerLive.conferenceId}/index.m3u8`;
|
|
38
38
|
this.playHls(hlsStreamUrl);
|
|
39
39
|
},
|
|
40
|
-
async playHls(hlsStreamUrl: string): Promise<void>{
|
|
40
|
+
async playHls(hlsStreamUrl: string): Promise<void> {
|
|
41
41
|
try {
|
|
42
|
-
this.audioElement =
|
|
43
|
-
|
|
42
|
+
this.audioElement = document.getElementById(
|
|
43
|
+
"audio-player",
|
|
44
|
+
) as HTMLAudioElement;
|
|
45
|
+
if (null === this.audioElement) {
|
|
44
46
|
setTimeout(() => {
|
|
45
47
|
this.playHls(hlsStreamUrl);
|
|
46
48
|
}, 1000);
|
|
@@ -48,12 +50,15 @@ export const playerLive = defineComponent({
|
|
|
48
50
|
}
|
|
49
51
|
const ua = navigator.userAgent.toLowerCase();
|
|
50
52
|
const isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
|
|
51
|
-
if (
|
|
53
|
+
if (
|
|
54
|
+
this.audioElement.canPlayType("application/vnd.apple.mpegurl") &&
|
|
55
|
+
!isAndroid
|
|
56
|
+
) {
|
|
52
57
|
this.audioElement.src = hlsStreamUrl;
|
|
53
58
|
await this.initLiveDownloadId();
|
|
54
59
|
await this.audioElement.play();
|
|
55
60
|
this.onPlay();
|
|
56
|
-
}else{
|
|
61
|
+
} else {
|
|
57
62
|
await this.initHls(hlsStreamUrl);
|
|
58
63
|
}
|
|
59
64
|
} catch (error) {
|
|
@@ -62,55 +67,72 @@ export const playerLive = defineComponent({
|
|
|
62
67
|
}, 1000);
|
|
63
68
|
}
|
|
64
69
|
},
|
|
65
|
-
async initLiveDownloadId(){
|
|
66
|
-
if(!this.playerLive || this.downloadId){
|
|
70
|
+
async initLiveDownloadId() {
|
|
71
|
+
if (!this.playerLive || this.downloadId) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
67
74
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
const downloadId = await octopusApi.putDataPublic<string | null>(
|
|
76
|
+
0,
|
|
77
|
+
"podcast/prepare/live/" + this.playerLive.podcastId,
|
|
78
|
+
undefined,
|
|
79
|
+
);
|
|
80
|
+
await octopusApi.fetchDataPublicWithParams<string | null>(
|
|
81
|
+
0,
|
|
82
|
+
"podcast/download/live/" + this.playerLive.podcastId + ".m3u8",
|
|
83
|
+
{
|
|
84
|
+
downloadId: null !== downloadId ? downloadId : undefined,
|
|
85
|
+
origin: "octopus",
|
|
86
|
+
distributorId: this.authOrgaId,
|
|
87
|
+
},
|
|
88
|
+
);
|
|
74
89
|
this.setDownloadId(downloadId);
|
|
75
90
|
} catch (error) {
|
|
76
91
|
this.downloadId = null;
|
|
77
|
-
console.log(
|
|
92
|
+
console.log("ERROR downloadId");
|
|
78
93
|
}
|
|
79
94
|
this.hlsReady = true;
|
|
80
95
|
},
|
|
81
96
|
async initHls(hlsStreamUrl: string): Promise<void> {
|
|
82
|
-
return new Promise<void>(async(resolve, reject) => {
|
|
83
|
-
if(null === Hls){
|
|
84
|
-
await import(
|
|
97
|
+
return new Promise<void>(async (resolve, reject) => {
|
|
98
|
+
if (null === Hls) {
|
|
99
|
+
await import("hls.js").then((hlsLibrary) => {
|
|
85
100
|
Hls = hlsLibrary.default;
|
|
86
|
-
})
|
|
101
|
+
});
|
|
87
102
|
}
|
|
88
103
|
if (!Hls.isSupported()) {
|
|
89
|
-
reject(
|
|
104
|
+
reject("Hls is not supported ! ");
|
|
90
105
|
}
|
|
91
106
|
this.hls = new Hls();
|
|
92
107
|
this.hls.on(Hls.Events.MANIFEST_PARSED, async () => {
|
|
93
108
|
await this.initLiveDownloadId();
|
|
94
|
-
this.hls.attachMedia(
|
|
109
|
+
this.hls.attachMedia(this.audioElement as HTMLAudioElement);
|
|
95
110
|
await (this.audioElement as HTMLAudioElement).play();
|
|
96
111
|
this.onPlay();
|
|
97
112
|
resolve();
|
|
98
113
|
});
|
|
99
|
-
this.hls.on(Hls.Events.ERROR, async() => {
|
|
100
|
-
reject(
|
|
114
|
+
this.hls.on(Hls.Events.ERROR, async () => {
|
|
115
|
+
reject("There is an error while reading media content");
|
|
101
116
|
});
|
|
102
117
|
this.hls.loadSource(hlsStreamUrl);
|
|
103
118
|
});
|
|
104
119
|
},
|
|
105
|
-
setDownloadId(newValue: string|null): void {
|
|
120
|
+
setDownloadId(newValue: string | null): void {
|
|
106
121
|
this.endListeningProgress();
|
|
107
122
|
this.downloadId = newValue;
|
|
108
123
|
},
|
|
109
124
|
async endListeningProgress(): Promise<void> {
|
|
110
125
|
if (!this.downloadId) return;
|
|
111
126
|
try {
|
|
112
|
-
await octopusApi.putDataPublic(
|
|
113
|
-
|
|
127
|
+
await octopusApi.putDataPublic(
|
|
128
|
+
0,
|
|
129
|
+
"podcast/listen/" +
|
|
130
|
+
this.downloadId +
|
|
131
|
+
"?seconds=" +
|
|
132
|
+
Math.round(this.listenTime),
|
|
133
|
+
undefined,
|
|
134
|
+
);
|
|
135
|
+
} catch {
|
|
114
136
|
//Do nothing
|
|
115
137
|
}
|
|
116
138
|
this.downloadId = null;
|
|
@@ -118,13 +140,13 @@ export const playerLive = defineComponent({
|
|
|
118
140
|
this.lastSend = 0;
|
|
119
141
|
this.listenTime = 0;
|
|
120
142
|
},
|
|
121
|
-
endingLive():void{
|
|
122
|
-
const audio: HTMLElement|null = document.getElementById(
|
|
123
|
-
if(audio && this.hls){
|
|
143
|
+
endingLive(): void {
|
|
144
|
+
const audio: HTMLElement | null = document.getElementById("audio-player");
|
|
145
|
+
if (audio && this.hls) {
|
|
124
146
|
this.hls.destroy();
|
|
125
|
-
(audio as HTMLAudioElement).src =
|
|
147
|
+
(audio as HTMLAudioElement).src = "";
|
|
126
148
|
this.hls = null;
|
|
127
149
|
}
|
|
128
|
-
}
|
|
150
|
+
},
|
|
129
151
|
},
|
|
130
|
-
})
|
|
152
|
+
});
|