@saooti/octopus-sdk 0.28.16 → 1.1.1
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 +188 -2
- package/index.ts +45 -11
- package/package.json +46 -48
- package/public/config.ts +4 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +129 -0
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/style.css +185 -1266
- package/public/img/403.jpeg +0 -0
- package/public/img/404.svg +242 -0
- package/public/img/ouest_france_logo.svg +12 -0
- package/src/App.vue +45 -24
- package/src/api/classicCrud.ts +34 -0
- package/src/api/initialize.ts +4 -2
- package/src/assets/bootstrap-diff.scss +197 -0
- package/src/assets/form.scss +77 -77
- package/src/assets/general.scss +287 -301
- package/src/assets/live.scss +39 -0
- package/src/assets/modal.scss +43 -50
- package/src/assets/multiselect.scss +522 -590
- package/src/assets/octopus-library.scss +17 -4
- package/src/assets/share.scss +150 -250
- package/src/assets/transition.scss +98 -2
- package/src/components/display/aggregator/RssSection.vue +4 -6
- package/src/components/display/categories/CategoryChooser.vue +100 -79
- package/src/components/display/categories/CategoryFilter.vue +117 -37
- package/src/components/display/categories/CategoryList.vue +121 -108
- package/src/components/display/comments/AddCommentModal.vue +98 -94
- package/src/components/display/comments/CommentBasicView.vue +95 -0
- package/src/components/display/comments/CommentInput.vue +175 -155
- package/src/components/display/comments/CommentItem.vue +152 -168
- package/src/components/display/comments/CommentList.vue +123 -229
- package/src/components/display/comments/CommentParentInfo.vue +26 -58
- package/src/components/display/comments/CommentPlayer.vue +51 -49
- package/src/components/display/comments/CommentSection.vue +44 -67
- package/src/components/display/edit/EditBox.vue +11 -5
- package/src/components/display/edit/EditCommentBox.vue +121 -29
- package/src/components/display/emission/EmissionChooser.vue +73 -81
- package/src/components/display/emission/EmissionInlineList.vue +130 -128
- package/src/components/display/emission/EmissionItem.vue +68 -109
- package/src/components/display/emission/EmissionList.vue +140 -146
- package/src/components/display/emission/EmissionPlayerItem.vue +186 -148
- package/src/components/display/filter/AdvancedSearch.vue +192 -273
- package/src/components/display/filter/CategoryFilter.vue +51 -59
- package/src/components/display/filter/MonetizableFilter.vue +17 -16
- package/src/components/display/filter/ProductorSearch.vue +149 -149
- package/src/components/display/filter/RubriqueChoice.vue +33 -37
- package/src/components/display/filter/RubriqueFilter.vue +132 -122
- package/src/components/display/list/ListPaginate.vue +145 -0
- package/src/components/display/list/Paginate.vue +218 -0
- package/src/components/display/live/CountDown.vue +19 -12
- package/src/components/display/live/LiveHorizontalList.vue +78 -55
- package/src/components/display/live/LiveItem.vue +136 -121
- package/src/components/display/live/LiveList.vue +172 -276
- package/src/components/display/organisation/OrganisationChooser.vue +104 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +46 -37
- package/src/components/display/participant/ParticipantItem.vue +91 -115
- package/src/components/display/participant/ParticipantList.vue +131 -117
- package/src/components/display/playlist/PlaylistItem.vue +54 -78
- package/src/components/display/playlist/PlaylistList.vue +91 -83
- package/src/components/display/playlist/PodcastList.vue +113 -128
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +191 -0
- package/src/components/display/podcasts/AnimatorsItem.vue +28 -39
- package/src/components/display/podcasts/ParticipantDescription.vue +62 -74
- package/src/components/display/podcasts/PodcastFilterList.vue +47 -89
- package/src/components/display/podcasts/PodcastImage.vue +195 -229
- package/src/components/display/podcasts/PodcastInlineList.vue +64 -282
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +240 -0
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +167 -0
- package/src/components/display/podcasts/PodcastItem.vue +93 -227
- package/src/components/display/podcasts/PodcastItemInfo.vue +166 -0
- package/src/components/display/podcasts/PodcastList.vue +115 -134
- package/src/components/display/podcasts/PodcastModuleBox.vue +234 -0
- package/src/components/display/podcasts/PodcastPlayBar.vue +101 -0
- package/src/components/display/podcasts/PodcastSwiperList.vue +204 -0
- package/src/components/display/podcasts/TagList.vue +60 -39
- package/src/components/display/rubriques/RubriqueChooser.vue +114 -95
- package/src/components/display/rubriques/RubriqueList.vue +111 -106
- package/src/components/display/sharing/PlayerParameters.vue +90 -151
- package/src/components/display/sharing/QrCode.vue +40 -27
- package/src/components/display/sharing/ShareButtons.vue +64 -299
- package/src/components/display/sharing/ShareButtonsIntern.vue +225 -0
- package/src/components/display/sharing/ShareDistribution.vue +99 -140
- package/src/components/display/sharing/SharePlayer.vue +155 -370
- package/src/components/display/sharing/SharePlayerColors.vue +78 -0
- package/src/components/display/sharing/SharePlayerTypes.vue +112 -0
- package/src/components/display/sharing/SplitButton.vue +42 -0
- package/src/components/display/sharing/SubscribeButtons.vue +62 -179
- package/src/components/display/studio/RecordingItemButton.vue +4 -6
- package/src/components/form/ClassicCheckbox.vue +66 -0
- package/src/components/form/ClassicLoading.vue +28 -0
- package/src/components/form/ClassicRadio.vue +66 -0
- package/src/components/form/ClassicSearch.vue +86 -0
- package/src/components/form/ClassicSelect.vue +65 -0
- package/src/components/misc/ErrorMessage.vue +27 -14
- package/src/components/misc/Footer.vue +132 -127
- package/src/components/misc/HomeDropdown.vue +93 -150
- package/src/components/misc/LeftMenu.vue +121 -192
- package/src/components/misc/Popover.vue +118 -0
- package/src/components/misc/Snackbar.vue +70 -35
- package/src/components/misc/TopBar.vue +192 -308
- package/src/components/misc/modal/ClipboardModal.vue +35 -50
- package/src/components/misc/modal/MessageModal.vue +71 -48
- package/src/components/misc/modal/NewsletterModal.vue +260 -231
- package/src/components/misc/modal/QrCodeModal.vue +42 -60
- package/src/components/misc/modal/ShareModalPlayer.vue +136 -70
- package/src/components/misc/player/Player.vue +146 -0
- package/src/components/misc/player/PlayerCompact.vue +154 -0
- package/src/components/misc/player/PlayerLarge.vue +166 -0
- package/src/components/misc/player/PlayerProgressBar.vue +112 -0
- package/src/components/misc/player/PlayerTimeline.vue +61 -0
- package/src/components/mixins/functions.ts +11 -43
- package/src/components/mixins/handle403.ts +17 -0
- package/src/components/mixins/init.ts +8 -6
- package/src/components/mixins/orgaComputed.ts +15 -0
- package/src/components/mixins/organisationFilter.ts +35 -18
- package/src/components/mixins/player/playerComment.ts +98 -0
- package/src/components/mixins/player/playerDisplay.ts +113 -0
- package/src/components/mixins/player/playerLive.ts +111 -0
- package/src/components/mixins/player/playerLogic.ts +225 -0
- package/src/components/mixins/tagOfMixins.ts +19 -0
- package/src/components/pages/Category.vue +21 -26
- package/src/components/pages/Emission.vue +136 -162
- package/src/components/pages/Emissions.vue +60 -93
- package/src/components/pages/Error403Page.vue +60 -0
- package/src/components/pages/Home.vue +32 -39
- package/src/components/pages/Lives.vue +40 -46
- package/src/components/pages/PageNotFound.vue +55 -0
- package/src/components/pages/Participant.vue +110 -113
- package/src/components/pages/Participants.vue +21 -45
- package/src/components/pages/Playlist.vue +84 -75
- package/src/components/pages/Playlists.vue +29 -47
- package/src/components/pages/Podcast.vue +203 -434
- package/src/components/pages/Podcasts.vue +75 -134
- package/src/components/pages/Rubrique.vue +21 -29
- package/src/components/pages/Search.vue +33 -79
- package/src/helper/dom.ts +1 -1
- package/src/helper/duration.ts +1 -1
- package/src/helper/useEventListener.ts +18 -0
- package/src/i18n.ts +36 -0
- package/src/locale/de.ts +309 -0
- package/src/locale/educationen.ts +1 -1
- package/src/locale/educationfr.ts +1 -1
- package/src/locale/en.ts +45 -28
- package/src/locale/es.ts +309 -0
- package/src/locale/fr.ts +25 -8
- package/src/locale/it.ts +307 -0
- package/src/locale/messages.ts +9 -2
- package/src/locale/sl.ts +309 -0
- package/src/main.ts +59 -85
- package/src/router/router.ts +60 -39
- package/src/sass/_variables.scss +10 -8
- package/src/shims-tsx.d.ts +2 -0
- package/src/shims-vue-recaptcha-v3.d.ts +9 -0
- package/src/shims-vue.d.ts +5 -4
- package/src/store/AppStore.ts +8 -9
- package/src/store/class/adserver/adserverConfig.ts +9 -0
- package/src/store/class/adserver/adserverOtherEmission.ts +13 -0
- package/src/store/class/adserver/adserverTiming.ts +10 -0
- package/src/store/class/cartouchier/cartouche.ts +15 -0
- package/src/store/class/cartouchier/cartouchier.ts +9 -0
- package/src/store/class/conference/conference.ts +35 -0
- package/src/store/class/conference/conferenceMessage.ts +10 -0
- package/src/store/class/conference/conferenceParticipant.ts +18 -0
- package/src/store/class/conference/pad.ts +15 -0
- package/src/store/class/conference/studioCall.ts +7 -0
- package/src/store/class/contract/contract.ts +7 -0
- package/src/store/class/contract/contractOrganisation.ts +7 -0
- package/src/store/class/ftp/ftpEmission.ts +41 -0
- package/src/store/class/ftp/ftpParam.ts +12 -0
- package/src/store/class/ftp/testFtpEmission.ts +5 -0
- package/src/store/class/general/audioView.ts +21 -0
- package/src/store/class/general/category.ts +10 -0
- package/src/store/class/general/comment.ts +16 -0
- package/src/store/class/general/customPlayer.ts +9 -0
- package/src/store/class/general/emission.ts +23 -0
- package/src/store/class/general/fetchParam.ts +3 -0
- package/src/store/class/general/initState.ts +25 -0
- package/src/store/class/general/interfacePageable.ts +16 -0
- package/src/store/class/general/ituneCategory.ts +5 -0
- package/src/store/class/general/media.ts +14 -0
- package/src/store/class/general/organisation.ts +20 -0
- package/src/store/class/general/pageable.ts +13 -0
- package/src/store/class/general/participant.ts +12 -0
- package/src/store/class/{player.ts → general/player.ts} +5 -3
- package/src/store/class/general/playlist.ts +13 -0
- package/src/store/class/general/podcast.ts +43 -0
- package/src/store/class/general/sortPageable.ts +5 -0
- package/src/store/class/general/soundcastCategory.ts +8 -0
- package/src/store/class/ouestFrance/ofTag.ts +36 -0
- package/src/store/class/ouestFrance/ofTagInfo.ts +9 -0
- package/src/store/class/ouestFrance/ofTagPage.ts +7 -0
- package/src/store/class/ouestFrance/ofTagSeo.ts +7 -0
- package/src/store/class/ouestFrance/ofTagVente.ts +6 -0
- package/src/store/class/ouestFrance/ofTagWithParents.ts +26 -0
- package/src/store/class/rss/aggregator.ts +28 -0
- package/src/store/class/rss/rssEmission.ts +14 -0
- package/src/store/class/rss/rssInfo.ts +8 -0
- package/src/store/class/rubrique/rubriquage.ts +10 -0
- package/src/store/class/rubrique/rubriquageFilter.ts +6 -0
- package/src/store/class/rubrique/rubrique.ts +9 -0
- package/src/store/class/stat/statArrayIncome.ts +6 -0
- package/src/store/class/stat/statArrayObject.ts +34 -0
- package/src/store/class/stat/statGraph.ts +7 -0
- package/src/store/class/user/person.ts +15 -0
- package/src/store/class/user/profile.ts +12 -0
- package/src/store/class/user/userKeycloak.ts +24 -0
- package/src/store/paramStore.ts +221 -241
- package/src/store/typeAppStore.ts +45 -28
- package/src/vuex-shim.d.ts +8 -0
- package/tsconfig.json +2 -1
- package/vue.config.js +3 -1
- package/public/css/fonts/saooti-ui.eot +0 -0
- package/public/css/fonts/saooti-ui.svg +0 -840
- package/public/css/fonts/saooti-ui.ttf +0 -0
- package/public/css/fonts/saooti-ui.woff +0 -0
- package/public/css/fonts/stitcher-logo.svg +0 -83
- package/public/img/article.png +0 -0
- package/src/api/comments.ts +0 -7
- package/src/api/emissions.ts +0 -7
- package/src/api/podcasts.ts +0 -7
- package/src/api/profile.ts +0 -8
- package/src/api/studio.ts +0 -8
- package/src/assets/bootstrap_scss/_alert.scss +0 -51
- package/src/assets/bootstrap_scss/_badge.scss +0 -54
- package/src/assets/bootstrap_scss/_breadcrumb.scss +0 -42
- package/src/assets/bootstrap_scss/_button-group.scss +0 -164
- package/src/assets/bootstrap_scss/_buttons.scss +0 -298
- package/src/assets/bootstrap_scss/_card.scss +0 -278
- package/src/assets/bootstrap_scss/_carousel.scss +0 -197
- package/src/assets/bootstrap_scss/_close.scss +0 -41
- package/src/assets/bootstrap_scss/_code.scss +0 -48
- package/src/assets/bootstrap_scss/_custom-forms.scss +0 -522
- package/src/assets/bootstrap_scss/_dropdown.scss +0 -201
- package/src/assets/bootstrap_scss/_forms.scss +0 -352
- package/src/assets/bootstrap_scss/_functions.scss +0 -134
- package/src/assets/bootstrap_scss/_grid.scss +0 -69
- package/src/assets/bootstrap_scss/_images.scss +0 -42
- package/src/assets/bootstrap_scss/_input-group.scss +0 -191
- package/src/assets/bootstrap_scss/_jumbotron.scss +0 -17
- package/src/assets/bootstrap_scss/_list-group.scss +0 -158
- package/src/assets/bootstrap_scss/_media.scss +0 -8
- package/src/assets/bootstrap_scss/_mixins.scss +0 -47
- package/src/assets/bootstrap_scss/_modal.scss +0 -243
- package/src/assets/bootstrap_scss/_nav.scss +0 -120
- package/src/assets/bootstrap_scss/_navbar.scss +0 -324
- package/src/assets/bootstrap_scss/_pagination.scss +0 -74
- package/src/assets/bootstrap_scss/_popover.scss +0 -170
- package/src/assets/bootstrap_scss/_print.scss +0 -141
- package/src/assets/bootstrap_scss/_progress.scss +0 -46
- package/src/assets/bootstrap_scss/_reboot.scss +0 -482
- package/src/assets/bootstrap_scss/_root.scss +0 -20
- package/src/assets/bootstrap_scss/_spinners.scss +0 -55
- package/src/assets/bootstrap_scss/_tables.scss +0 -185
- package/src/assets/bootstrap_scss/_toasts.scss +0 -44
- package/src/assets/bootstrap_scss/_tooltip.scss +0 -115
- package/src/assets/bootstrap_scss/_transitions.scss +0 -20
- package/src/assets/bootstrap_scss/_type.scss +0 -125
- package/src/assets/bootstrap_scss/_utilities.scss +0 -17
- package/src/assets/bootstrap_scss/_variables.scss +0 -1145
- package/src/assets/bootstrap_scss/bootstrap-grid.scss +0 -29
- package/src/assets/bootstrap_scss/bootstrap-reboot.scss +0 -12
- package/src/assets/bootstrap_scss/bootstrap.scss +0 -44
- package/src/assets/bootstrap_scss/mixins/_alert.scss +0 -13
- package/src/assets/bootstrap_scss/mixins/_background-variant.scss +0 -22
- package/src/assets/bootstrap_scss/mixins/_badge.scss +0 -17
- package/src/assets/bootstrap_scss/mixins/_border-radius.scss +0 -63
- package/src/assets/bootstrap_scss/mixins/_box-shadow.scss +0 -20
- package/src/assets/bootstrap_scss/mixins/_breakpoints.scss +0 -123
- package/src/assets/bootstrap_scss/mixins/_buttons.scss +0 -110
- package/src/assets/bootstrap_scss/mixins/_caret.scss +0 -62
- package/src/assets/bootstrap_scss/mixins/_clearfix.scss +0 -7
- package/src/assets/bootstrap_scss/mixins/_deprecate.scss +0 -10
- package/src/assets/bootstrap_scss/mixins/_float.scss +0 -14
- package/src/assets/bootstrap_scss/mixins/_forms.scss +0 -177
- package/src/assets/bootstrap_scss/mixins/_gradients.scss +0 -45
- package/src/assets/bootstrap_scss/mixins/_grid-framework.scss +0 -71
- package/src/assets/bootstrap_scss/mixins/_grid.scss +0 -69
- package/src/assets/bootstrap_scss/mixins/_hover.scss +0 -37
- package/src/assets/bootstrap_scss/mixins/_image.scss +0 -36
- package/src/assets/bootstrap_scss/mixins/_list-group.scss +0 -21
- package/src/assets/bootstrap_scss/mixins/_lists.scss +0 -7
- package/src/assets/bootstrap_scss/mixins/_nav-divider.scss +0 -11
- package/src/assets/bootstrap_scss/mixins/_pagination.scss +0 -22
- package/src/assets/bootstrap_scss/mixins/_reset-text.scss +0 -17
- package/src/assets/bootstrap_scss/mixins/_resize.scss +0 -6
- package/src/assets/bootstrap_scss/mixins/_screen-reader.scss +0 -34
- package/src/assets/bootstrap_scss/mixins/_size.scss +0 -7
- package/src/assets/bootstrap_scss/mixins/_table-row.scss +0 -39
- package/src/assets/bootstrap_scss/mixins/_text-emphasis.scss +0 -17
- package/src/assets/bootstrap_scss/mixins/_text-hide.scss +0 -11
- package/src/assets/bootstrap_scss/mixins/_text-truncate.scss +0 -8
- package/src/assets/bootstrap_scss/mixins/_transition.scss +0 -16
- package/src/assets/bootstrap_scss/mixins/_visibility.scss +0 -8
- package/src/assets/bootstrap_scss/utilities/_align.scss +0 -8
- package/src/assets/bootstrap_scss/utilities/_background.scss +0 -19
- package/src/assets/bootstrap_scss/utilities/_borders.scss +0 -75
- package/src/assets/bootstrap_scss/utilities/_clearfix.scss +0 -3
- package/src/assets/bootstrap_scss/utilities/_display.scss +0 -26
- package/src/assets/bootstrap_scss/utilities/_embed.scss +0 -39
- package/src/assets/bootstrap_scss/utilities/_flex.scss +0 -51
- package/src/assets/bootstrap_scss/utilities/_float.scss +0 -11
- package/src/assets/bootstrap_scss/utilities/_overflow.scss +0 -5
- package/src/assets/bootstrap_scss/utilities/_position.scss +0 -32
- package/src/assets/bootstrap_scss/utilities/_screenreaders.scss +0 -11
- package/src/assets/bootstrap_scss/utilities/_shadows.scss +0 -6
- package/src/assets/bootstrap_scss/utilities/_sizing.scss +0 -20
- package/src/assets/bootstrap_scss/utilities/_spacing.scss +0 -73
- package/src/assets/bootstrap_scss/utilities/_stretched-link.scss +0 -19
- package/src/assets/bootstrap_scss/utilities/_text.scss +0 -72
- package/src/assets/bootstrap_scss/utilities/_visibility.scss +0 -13
- package/src/assets/bootstrap_scss/vendor/_rfs.scss +0 -204
- package/src/components/misc/Player.vue +0 -772
- package/src/store/class/category.ts +0 -8
- package/src/store/class/comment.ts +0 -17
- package/src/store/class/conference.ts +0 -27
- package/src/store/class/customPlayer.ts +0 -8
- package/src/store/class/emission.ts +0 -20
- package/src/store/class/media.ts +0 -13
- package/src/store/class/organisation.ts +0 -19
- package/src/store/class/participant.ts +0 -12
- package/src/store/class/person.ts +0 -13
- package/src/store/class/playlist.ts +0 -15
- package/src/store/class/podcast.ts +0 -37
- package/src/store/class/rubriquage.ts +0 -9
- package/src/store/class/rubriquageFilter.ts +0 -5
- package/src/store/class/rubrique.ts +0 -8
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="d-flex flex-column align-items-center my-2 flex-grow-1 text-light position-relative overflow-y-auto"
|
|
4
|
+
>
|
|
5
|
+
<button
|
|
6
|
+
:title="$t('Reduce')"
|
|
7
|
+
class="player-reduce-button btn bg-transparent text-light saooti-down"
|
|
8
|
+
@click="changePlayerLargeVersion"
|
|
9
|
+
/>
|
|
10
|
+
<router-link
|
|
11
|
+
v-if="isImage && podcastImage"
|
|
12
|
+
:to="podcastShareUrl"
|
|
13
|
+
>
|
|
14
|
+
<img
|
|
15
|
+
v-lazy="podcastImage"
|
|
16
|
+
:alt="$t('Podcast image')"
|
|
17
|
+
class="img-box"
|
|
18
|
+
>
|
|
19
|
+
</router-link>
|
|
20
|
+
<div class="d-flex w-100 px-2 mt-2 text-center">
|
|
21
|
+
<div
|
|
22
|
+
v-if="playerError"
|
|
23
|
+
class="text-warning mx-2"
|
|
24
|
+
>
|
|
25
|
+
{{ $t('Podcast play error') + ' - ' }}
|
|
26
|
+
</div>
|
|
27
|
+
<div class="flex-grow-1 text-truncate h3">
|
|
28
|
+
{{ podcastTitle }}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="player-grow-large-content">
|
|
32
|
+
<PlayerProgressBar
|
|
33
|
+
ref="progressbar"
|
|
34
|
+
:hls-ready="hlsReady"
|
|
35
|
+
:show-timeline="showTimeline"
|
|
36
|
+
:comments="comments"
|
|
37
|
+
:display-alert-bar="displayAlertBar"
|
|
38
|
+
:percent-live-progress="percentLiveProgress"
|
|
39
|
+
:duration-live-position="durationLivePosition"
|
|
40
|
+
:player-error="playerError"
|
|
41
|
+
:listen-time="listenTime"
|
|
42
|
+
@updateNotListenTime="$emit('update:notListenTime', $event)"
|
|
43
|
+
/>
|
|
44
|
+
<div class="d-flex justify-content-between">
|
|
45
|
+
<div>{{ playedTime }}</div>
|
|
46
|
+
<div>{{ totalTime }}</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="d-flex align-items-center">
|
|
50
|
+
<button
|
|
51
|
+
class="btn fs-1 bg-transparent text-light saooti-backward"
|
|
52
|
+
@click="seekClick(-15)"
|
|
53
|
+
/>
|
|
54
|
+
<button
|
|
55
|
+
v-if="!playerError"
|
|
56
|
+
:title="$t('Play')"
|
|
57
|
+
:class="{
|
|
58
|
+
'saooti-play': isPaused,
|
|
59
|
+
'saooti-pause': isPlaying,
|
|
60
|
+
'':!isPaused&&!isPlaying
|
|
61
|
+
}"
|
|
62
|
+
class="btn play-big-button-box text-light primary-bg"
|
|
63
|
+
@click="switchPausePlay"
|
|
64
|
+
>
|
|
65
|
+
<span
|
|
66
|
+
v-if="!isPaused&&!isPlaying"
|
|
67
|
+
class="spinner-border flex-shrink-0"
|
|
68
|
+
/>
|
|
69
|
+
</button>
|
|
70
|
+
<button
|
|
71
|
+
class="btn fs-1 bg-transparent text-light saooti-forward"
|
|
72
|
+
@click="seekClick(15)"
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
<PlayerTimeline
|
|
76
|
+
v-model:showTimeline="showTimeline"
|
|
77
|
+
:comments="comments"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
<script lang="ts">
|
|
82
|
+
import { playerDisplay } from '../../mixins/player/playerDisplay';
|
|
83
|
+
import PlayerProgressBar from './PlayerProgressBar.vue';
|
|
84
|
+
import PlayerTimeline from './PlayerTimeline.vue';
|
|
85
|
+
import { defineComponent } from 'vue';
|
|
86
|
+
import { CommentPodcast } from '@/store/class/general/comment';
|
|
87
|
+
export default defineComponent({
|
|
88
|
+
name: 'PlayerLarge',
|
|
89
|
+
|
|
90
|
+
components: {
|
|
91
|
+
PlayerProgressBar,
|
|
92
|
+
PlayerTimeline
|
|
93
|
+
},
|
|
94
|
+
mixins:[playerDisplay],
|
|
95
|
+
|
|
96
|
+
props: {
|
|
97
|
+
playerError: { default: false, type: Boolean},
|
|
98
|
+
notListenTime: { default: 0 , type: Number},
|
|
99
|
+
hlsReady: { default: false , type: Boolean},
|
|
100
|
+
comments: { default: ()=>[] , type: Array as ()=> Array<CommentPodcast> },
|
|
101
|
+
displayAlertBar: { default: false , type: Boolean},
|
|
102
|
+
percentLiveProgress: { default: 0 , type: Number},
|
|
103
|
+
durationLivePosition: { default: 0 , type: Number},
|
|
104
|
+
listenTime: { default: 0 , type: Number},
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
emits: ['stopPlayer', 'update:notListenTime', 'changePlayerLargeVersion'],
|
|
108
|
+
data() {
|
|
109
|
+
return {
|
|
110
|
+
showTimeline: false as boolean,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
methods:{
|
|
114
|
+
stopPlayer(){
|
|
115
|
+
this.$emit('stopPlayer');
|
|
116
|
+
},
|
|
117
|
+
changePlayerLargeVersion(){
|
|
118
|
+
this.$emit('changePlayerLargeVersion');
|
|
119
|
+
},
|
|
120
|
+
seekClick(addTime: number):void{
|
|
121
|
+
const audioPlayer: HTMLAudioElement|null = document.querySelector('#audio-player');
|
|
122
|
+
if(!audioPlayer){return;}
|
|
123
|
+
const seekTo = audioPlayer.currentTime + addTime;
|
|
124
|
+
(this.$refs.progressbar as InstanceType<typeof PlayerProgressBar>).isSeekTo(audioPlayer, seekTo >0?seekTo: 0);
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style lang="scss">
|
|
131
|
+
.octopus-app{
|
|
132
|
+
.player-container .img-box{
|
|
133
|
+
@media (max-width: 960px) {
|
|
134
|
+
width: 10rem;
|
|
135
|
+
height: 10rem;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
.player-reduce-button{
|
|
139
|
+
position: absolute;
|
|
140
|
+
right: 0;
|
|
141
|
+
font-size: 1.2rem !important;
|
|
142
|
+
}
|
|
143
|
+
.player-grow-large-content{
|
|
144
|
+
width: 100%;
|
|
145
|
+
padding: 1rem 2rem;
|
|
146
|
+
@media (max-width: 960px) {
|
|
147
|
+
padding: 0.5rem;
|
|
148
|
+
}
|
|
149
|
+
.progress, .progress-bar{
|
|
150
|
+
height: 15px !important;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
.play-big-button-box {
|
|
154
|
+
height: 5rem;
|
|
155
|
+
width: 5rem;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
margin: 0 0.5rem;
|
|
160
|
+
border-radius: 50%;
|
|
161
|
+
font-size: 2.5rem !important;
|
|
162
|
+
flex-shrink: 0;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="!playerError"
|
|
4
|
+
class="progress c-hand"
|
|
5
|
+
@mouseup="seekTo"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="progress-bar bg-light"
|
|
9
|
+
role="progressbar"
|
|
10
|
+
aria-valuenow="0"
|
|
11
|
+
aria-valuemin="0"
|
|
12
|
+
aria-valuemax="100"
|
|
13
|
+
:style="'width: ' + percentLiveProgress + '%'"
|
|
14
|
+
/>
|
|
15
|
+
<div
|
|
16
|
+
class="progress-bar primary-bg"
|
|
17
|
+
role="progressbar"
|
|
18
|
+
aria-valuenow="0"
|
|
19
|
+
aria-valuemin="0"
|
|
20
|
+
aria-valuemax="100"
|
|
21
|
+
:style="'width: ' + percentProgress + '%'"
|
|
22
|
+
/>
|
|
23
|
+
<div
|
|
24
|
+
v-if="displayAlertBar"
|
|
25
|
+
class="progress-bar progress-bar-duration bg-danger"
|
|
26
|
+
:style="'left: ' + durationLivePosition + '%'"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
<CommentPlayer
|
|
30
|
+
v-if="showTimeline"
|
|
31
|
+
:total-time="totalSecondes"
|
|
32
|
+
:comments="comments"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import { CommentPodcast } from '@/store/class/general/comment';
|
|
38
|
+
import { defineComponent, defineAsyncComponent } from 'vue';
|
|
39
|
+
const CommentPlayer = defineAsyncComponent(() => import('../../display/comments/CommentPlayer.vue'));
|
|
40
|
+
export default defineComponent({
|
|
41
|
+
name: 'PlayerProgressBar',
|
|
42
|
+
|
|
43
|
+
components: {
|
|
44
|
+
CommentPlayer,
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
hlsReady: { default: false, type: Boolean},
|
|
48
|
+
showTimeline: { default: false, type: Boolean},
|
|
49
|
+
comments: { default: ()=>[], type: Array as ()=>Array<CommentPodcast>},
|
|
50
|
+
displayAlertBar: { default: false, type: Boolean},
|
|
51
|
+
percentLiveProgress: { default: 0, type: Number},
|
|
52
|
+
durationLivePosition: { default: 0, type: Number},
|
|
53
|
+
playerError: { default: false, type: Boolean},
|
|
54
|
+
listenTime: { default: 0, type: Number},
|
|
55
|
+
},
|
|
56
|
+
emits: ['updateNotListenTime'],
|
|
57
|
+
|
|
58
|
+
computed: {
|
|
59
|
+
percentProgress(): number{
|
|
60
|
+
if(!this.$store.state.player.elapsed){return 0;}
|
|
61
|
+
return this.$store.state.player.elapsed * 100;
|
|
62
|
+
},
|
|
63
|
+
totalSecondes(): number{
|
|
64
|
+
return this.$store.state.player.total;
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
methods: {
|
|
70
|
+
seekTo(event: MouseEvent): void {
|
|
71
|
+
const audioPlayer: HTMLAudioElement|null = document.querySelector('#audio-player');
|
|
72
|
+
if(!audioPlayer || null===event.currentTarget){return;}
|
|
73
|
+
const rect = (event.currentTarget as Element).getBoundingClientRect();
|
|
74
|
+
const barWidth = (event.currentTarget as Element).clientWidth;
|
|
75
|
+
const x = event.clientX - rect.left;
|
|
76
|
+
const percentPosition = x / barWidth;
|
|
77
|
+
if (percentPosition * 100 >= this.percentLiveProgress) return;
|
|
78
|
+
const seekTime = this.$store.state.player.total * percentPosition;
|
|
79
|
+
this.isSeekTo(audioPlayer, seekTime);
|
|
80
|
+
},
|
|
81
|
+
isSeekTo(audioPlayer: HTMLAudioElement, seekTime: number): void {
|
|
82
|
+
if (this.$store.state.player.podcast || this.$store.state.player.live) {
|
|
83
|
+
this.$emit('updateNotListenTime',seekTime - this.listenTime);
|
|
84
|
+
}
|
|
85
|
+
audioPlayer.currentTime = seekTime;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style lang="scss">
|
|
93
|
+
.octopus-app{
|
|
94
|
+
.progress {
|
|
95
|
+
height: 4px;
|
|
96
|
+
position: relative;
|
|
97
|
+
@media (max-width: 960px) {
|
|
98
|
+
height: 8px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
.progress-bar-duration {
|
|
102
|
+
width: 10px;
|
|
103
|
+
}
|
|
104
|
+
.progress-bar {
|
|
105
|
+
height: 4px;
|
|
106
|
+
position: absolute;
|
|
107
|
+
@media (max-width: 960px) {
|
|
108
|
+
height: 8px;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="0 !== comments.length && !isPodcastmaker"
|
|
4
|
+
class="timeline-button"
|
|
5
|
+
@click="$emit('update:showTimeline', !showTimeline)"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="saooti-down"
|
|
9
|
+
:class="showTimeline ? '' : 'arrow-transform'"
|
|
10
|
+
/>
|
|
11
|
+
<div>Timeline</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import { state } from '../../../store/paramStore';
|
|
17
|
+
import { defineComponent } from 'vue';
|
|
18
|
+
import { CommentPodcast } from '@/store/class/general/comment';
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: 'PlayerTimeline',
|
|
21
|
+
|
|
22
|
+
props: {
|
|
23
|
+
showTimeline: { default: false, type: Boolean},
|
|
24
|
+
comments: { default: ()=>[], type: Array as ()=>Array<CommentPodcast>},
|
|
25
|
+
},
|
|
26
|
+
emits:['update:showTimeline'],
|
|
27
|
+
|
|
28
|
+
computed: {
|
|
29
|
+
isPodcastmaker(): boolean {
|
|
30
|
+
return (state.generalParameters.podcastmaker as boolean);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
})
|
|
35
|
+
</script>
|
|
36
|
+
<style lang="scss">
|
|
37
|
+
@import '../../../sass/_variables.scss';
|
|
38
|
+
.octopus-app{
|
|
39
|
+
.player-container {
|
|
40
|
+
.timeline-button {
|
|
41
|
+
background: black;
|
|
42
|
+
padding: 0.1rem;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
width: 70px;
|
|
45
|
+
height: 70px;
|
|
46
|
+
font-size: 0.7rem;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
align-items: center;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
color: $octopus-primary-color;
|
|
54
|
+
margin-left: 0.5rem;
|
|
55
|
+
@media (max-width: 960px) {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
export const selenium = Vue.extend({
|
|
2
|
+
export const selenium ={
|
|
4
3
|
methods: {
|
|
5
|
-
seleniumFormat(string: string) {
|
|
4
|
+
seleniumFormat(string: string): string {
|
|
6
5
|
return string.toLowerCase().replace(/\s/g, '');
|
|
7
6
|
},
|
|
8
7
|
},
|
|
9
|
-
}
|
|
10
|
-
export const cookies =
|
|
8
|
+
};
|
|
9
|
+
export const cookies =
|
|
11
10
|
{
|
|
12
11
|
methods: {
|
|
13
|
-
setCookie(name: string, value: string, domain= "") {
|
|
12
|
+
setCookie(name: string, value: string, domain= ""): void {
|
|
14
13
|
const date = new Date();
|
|
15
14
|
date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
|
|
16
15
|
const expires = '; expires=' + date.toUTCString();
|
|
17
16
|
document.cookie = name + '=' + (value || '') + expires +domain+ '; path=/';
|
|
18
17
|
},
|
|
19
|
-
getCookie(name: string) {
|
|
18
|
+
getCookie(name: string): string|null {
|
|
20
19
|
const nameEQ = name + '=';
|
|
21
20
|
const ca = document.cookie.split(';');
|
|
22
21
|
for (let i = 0; i < ca.length; i++) {
|
|
@@ -28,18 +27,18 @@ export const cookies = Vue.extend(
|
|
|
28
27
|
return null;
|
|
29
28
|
},
|
|
30
29
|
},
|
|
31
|
-
}
|
|
30
|
+
};
|
|
32
31
|
|
|
33
|
-
export const displayMethods =
|
|
32
|
+
export const displayMethods ={
|
|
34
33
|
methods: {
|
|
35
|
-
urlify(text: string) {
|
|
34
|
+
urlify(text: string): string {
|
|
36
35
|
const urlRegex = /(https?:\/\/[^\s<]+)/g;
|
|
37
36
|
if (!text) return '';
|
|
38
37
|
return text.replace(urlRegex, (url: string) => {
|
|
39
38
|
return '<a href="' + url + '" target="_blank" rel="noopener">' + url + '</a>';
|
|
40
39
|
});
|
|
41
40
|
},
|
|
42
|
-
async onCopyCode(link: string, callback: () => void) {
|
|
41
|
+
async onCopyCode(link: string, callback: () => void): Promise<void> {
|
|
43
42
|
if ('undefined' !== typeof navigator.clipboard) {
|
|
44
43
|
await navigator.clipboard.writeText(link);
|
|
45
44
|
return callback();
|
|
@@ -55,36 +54,5 @@ export const displayMethods =Vue.extend({
|
|
|
55
54
|
return callback();
|
|
56
55
|
},
|
|
57
56
|
},
|
|
58
|
-
}
|
|
57
|
+
};
|
|
59
58
|
|
|
60
|
-
export const cookiesAndMethods = displayMethods.extend(
|
|
61
|
-
{
|
|
62
|
-
methods: {
|
|
63
|
-
setCookie(name: string, value: string, domain = "") {
|
|
64
|
-
const date = new Date();
|
|
65
|
-
date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
|
|
66
|
-
const expires = '; expires=' + date.toUTCString();
|
|
67
|
-
document.cookie = name + '=' + (value || '') + expires +domain+ '; path=/';
|
|
68
|
-
},
|
|
69
|
-
getCookie(name: string) {
|
|
70
|
-
const nameEQ = name + '=';
|
|
71
|
-
const ca = document.cookie.split(';');
|
|
72
|
-
for (let i = 0; i < ca.length; i++) {
|
|
73
|
-
let c = ca[i];
|
|
74
|
-
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
75
|
-
if (0 === c.indexOf(nameEQ))
|
|
76
|
-
return c.substring(nameEQ.length, c.length);
|
|
77
|
-
}
|
|
78
|
-
return null;
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
export const seleniumAndMethods = displayMethods.extend(
|
|
84
|
-
{
|
|
85
|
-
methods: {
|
|
86
|
-
seleniumFormat(string: string) {
|
|
87
|
-
return string.toLowerCase().replace(/\s/g, '');
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
export const handle403 = defineComponent({
|
|
4
|
+
methods: {
|
|
5
|
+
handle403(error: AxiosError): void {
|
|
6
|
+
if (403 === error.response?.status) {
|
|
7
|
+
if(!this.$store.state.authentication.isAuthenticated){
|
|
8
|
+
window.location.href = window.location.origin + "/sso/login";
|
|
9
|
+
}else{
|
|
10
|
+
this.$router.push({
|
|
11
|
+
path: '/main/pub/error'
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
import { Category } from "@/store/class/category";
|
|
2
|
+
import { Category } from "@/store/class/general/category";
|
|
3
3
|
import { orgaFilter } from '../mixins/organisationFilter';
|
|
4
|
-
|
|
4
|
+
import octopusApi from '@saooti/octopus-api';
|
|
5
5
|
import { state } from '../../store/paramStore';
|
|
6
|
-
|
|
6
|
+
import { defineComponent } from 'vue';
|
|
7
|
+
export const initSDK = defineComponent({
|
|
8
|
+
mixins: [orgaFilter],
|
|
7
9
|
methods: {
|
|
8
10
|
async initSdk() {
|
|
9
|
-
if (0 === state.generalParameters.allCategories.length) {
|
|
10
|
-
octopusApi.
|
|
11
|
+
if (0 === (state.generalParameters.allCategories as Array<Category>).length) {
|
|
12
|
+
octopusApi.fetchDataWithParams<Array<Category>>(0, `iab/list${state.octopusApi.organisationId? '/'+state.octopusApi.organisationId : ''}`, { lang: this.$i18n.locale }).then((data: Array<Category>) => {
|
|
11
13
|
this.$store.commit('categoriesSet', data);
|
|
12
14
|
});
|
|
13
15
|
}else{
|
|
14
|
-
this.$store.commit('categoriesSet', state.generalParameters.allCategories);
|
|
16
|
+
this.$store.commit('categoriesSet', (state.generalParameters.allCategories as Array<Category>));
|
|
15
17
|
}
|
|
16
18
|
const captcha = (document.getElementsByClassName('grecaptcha-badge')[0] as HTMLElement);
|
|
17
19
|
if (captcha) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { state } from '../../store/paramStore';
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
export const orgaComputed = defineComponent({
|
|
4
|
+
computed: {
|
|
5
|
+
myOrganisationId(): string|undefined {
|
|
6
|
+
return state.generalParameters.organisationId;
|
|
7
|
+
},
|
|
8
|
+
authenticated(): boolean {
|
|
9
|
+
return (state.generalParameters.authenticated as boolean);
|
|
10
|
+
},
|
|
11
|
+
filterOrga(): string {
|
|
12
|
+
return this.$store.state.filter.organisationId;
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { handle403 } from '../mixins/handle403';
|
|
3
|
+
import { Rubriquage } from "@/store/class/rubrique/rubriquage";
|
|
4
|
+
import octopusApi from '@saooti/octopus-api';
|
|
5
|
+
import { defineComponent } from 'vue'
|
|
6
|
+
import { AxiosError } from 'axios';
|
|
7
|
+
import { Organisation } from '@/store/class/general/organisation';
|
|
8
|
+
export const orgaFilter = defineComponent({
|
|
9
|
+
mixins: [handle403],
|
|
6
10
|
methods: {
|
|
7
11
|
async selectOrganisation(organisationId: string): Promise<void> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
try {
|
|
13
|
+
const response = await octopusApi.fetchData<Organisation>(0,`organisation/${organisationId}`);
|
|
14
|
+
const data = await octopusApi.fetchDataWithParams<Array<Rubriquage>>(0, 'rubriquage/find/'+organisationId,{
|
|
15
|
+
sort:'HOMEPAGEORDER',
|
|
16
|
+
homePageOrder: true
|
|
17
|
+
}, true);
|
|
18
|
+
const isLive = await octopusApi.fetchData<boolean>(0, 'organisation/liveEnabled/'+organisationId);
|
|
19
|
+
this.$store.commit('filterOrga', {
|
|
20
|
+
orgaId: organisationId,
|
|
21
|
+
imgUrl: response.imageUrl,
|
|
22
|
+
name: response.name,
|
|
23
|
+
rubriquageArray: data.filter((element: Rubriquage)=>{
|
|
24
|
+
return element.rubriques.length;
|
|
25
|
+
}),
|
|
26
|
+
isLive: isLive
|
|
27
|
+
});
|
|
28
|
+
const queries = this.$route.query;
|
|
29
|
+
this.$router.replace({ query: {...queries, ...{productor: organisationId} } });
|
|
30
|
+
} catch (error) {
|
|
31
|
+
this.handle403((error as AxiosError));
|
|
32
|
+
}
|
|
22
33
|
},
|
|
34
|
+
removeSelectedOrga(): void{
|
|
35
|
+
if (this.$route.query.productor) {
|
|
36
|
+
this.$router.push({ query: {...this.$route.query, ...{productor: undefined} } });
|
|
37
|
+
}
|
|
38
|
+
this.$store.commit('filterOrga', { orgaId: undefined });
|
|
39
|
+
}
|
|
23
40
|
},
|
|
24
41
|
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
|
|
2
|
+
import { mapState } from 'vuex';
|
|
3
|
+
import { state } from '../../../store/paramStore';
|
|
4
|
+
import octopusApi from '@saooti/octopus-api';
|
|
5
|
+
import { CommentPodcast } from '@/store/class/general/comment';
|
|
6
|
+
import { StoreState } from '@/store/typeAppStore';
|
|
7
|
+
import { defineComponent } from 'vue';
|
|
8
|
+
import { FetchParam } from '@/store/class/general/fetchParam';
|
|
9
|
+
import { InterfacePageable } from '@/store/class/general/interfacePageable';
|
|
10
|
+
export const playerComment = defineComponent({
|
|
11
|
+
data() {
|
|
12
|
+
return {
|
|
13
|
+
comments: [] as Array<CommentPodcast>,
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
...mapState({
|
|
18
|
+
commentsLoaded(state: StoreState){ return state.comments.loadedComments},
|
|
19
|
+
live(state: StoreState) { return state.player.live},
|
|
20
|
+
podcast(state: StoreState) { return state.player.podcast}
|
|
21
|
+
}),
|
|
22
|
+
organisationId(): string|undefined {
|
|
23
|
+
return state.generalParameters.organisationId;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
watch: {
|
|
28
|
+
commentsLoaded(): void {
|
|
29
|
+
this.initComments(true);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
editRight(organisation: string): boolean {
|
|
34
|
+
if (
|
|
35
|
+
(state.generalParameters.isCommments &&
|
|
36
|
+
this.organisationId === organisation) ||
|
|
37
|
+
state.generalParameters.isAdmin
|
|
38
|
+
)
|
|
39
|
+
return true;
|
|
40
|
+
return false;
|
|
41
|
+
},
|
|
42
|
+
async initComments(refresh = false): Promise<void> {
|
|
43
|
+
let podcastId, organisation;
|
|
44
|
+
if (this.podcast) {
|
|
45
|
+
podcastId = this.podcast.podcastId;
|
|
46
|
+
organisation = this.podcast.organisation.id;
|
|
47
|
+
} else if (this.live) {
|
|
48
|
+
podcastId = this.live.livePodcastId;
|
|
49
|
+
organisation = this.live.organisation.id;
|
|
50
|
+
}
|
|
51
|
+
if (
|
|
52
|
+
refresh &&
|
|
53
|
+
podcastId &&
|
|
54
|
+
this.$store.state.comments.actualPodcastId !== podcastId
|
|
55
|
+
) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let first = 0;
|
|
59
|
+
let count = 0;
|
|
60
|
+
const size = 50;
|
|
61
|
+
if (
|
|
62
|
+
podcastId &&
|
|
63
|
+
this.$store.state.comments.actualPodcastId === podcastId
|
|
64
|
+
) {
|
|
65
|
+
this.comments = this.commentsLoaded;
|
|
66
|
+
if (
|
|
67
|
+
this.commentsLoaded &&
|
|
68
|
+
this.commentsLoaded.length < this.$store.state.comments.totalCount
|
|
69
|
+
) {
|
|
70
|
+
first = this.commentsLoaded.length;
|
|
71
|
+
count = this.$store.state.comments.totalCount;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (
|
|
75
|
+
(!podcastId ||
|
|
76
|
+
this.$store.state.comments.actualPodcastId === podcastId) &&
|
|
77
|
+
0 === first
|
|
78
|
+
)
|
|
79
|
+
return;
|
|
80
|
+
while (0 === first || this.comments.length < count) {
|
|
81
|
+
const param: FetchParam = {
|
|
82
|
+
first: first,
|
|
83
|
+
size: size,
|
|
84
|
+
podcastId: podcastId,
|
|
85
|
+
};
|
|
86
|
+
if (!this.editRight(organisation? organisation : '')) {
|
|
87
|
+
param.status = ['Valid'];
|
|
88
|
+
}
|
|
89
|
+
const data = await octopusApi.postDataPublic<InterfacePageable<CommentPodcast>>(2, 'getRootCom',param);
|
|
90
|
+
first += size;
|
|
91
|
+
count = data.totalElements;
|
|
92
|
+
this.comments = this.comments.concat(data.content).filter((c: CommentPodcast) => {
|
|
93
|
+
return null !== c;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
})
|