@saooti/octopus-sdk 1.0.0 → 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.
Files changed (317) hide show
  1. package/README.md +261 -0
  2. package/index.d.ts +4 -0
  3. package/index.ts +55 -3
  4. package/package.json +53 -45
  5. package/public/config.ts +4 -0
  6. package/public/css/fonts/icomoon.eot +0 -0
  7. package/public/css/fonts/icomoon.svg +129 -0
  8. package/public/css/fonts/icomoon.ttf +0 -0
  9. package/public/css/fonts/icomoon.woff +0 -0
  10. package/public/css/fonts/style.css +186 -1224
  11. package/public/img/403.jpeg +0 -0
  12. package/public/img/404.svg +242 -0
  13. package/public/img/ACPM.png +0 -0
  14. package/public/img/ouest_france_logo.svg +12 -0
  15. package/src/App.vue +102 -31
  16. package/src/api/classicCrud.ts +34 -0
  17. package/src/api/initialize.ts +5 -2
  18. package/src/assets/bootstrap-diff.scss +197 -0
  19. package/src/assets/form.scss +77 -77
  20. package/src/assets/general.scss +284 -272
  21. package/src/assets/live.scss +39 -0
  22. package/src/assets/modal.scss +43 -50
  23. package/src/assets/multiselect.scss +522 -573
  24. package/src/assets/octopus-library.scss +18 -4
  25. package/src/assets/share.scss +243 -0
  26. package/src/assets/transition.scss +98 -2
  27. package/src/components/display/aggregator/RssSection.vue +3 -5
  28. package/src/components/display/categories/CategoryChooser.vue +151 -114
  29. package/src/components/display/categories/CategoryFilter.vue +162 -0
  30. package/src/components/display/categories/CategoryList.vue +149 -117
  31. package/src/components/display/comments/AddCommentModal.vue +103 -108
  32. package/src/components/display/comments/CommentBasicView.vue +95 -0
  33. package/src/components/display/comments/CommentInput.vue +195 -183
  34. package/src/components/display/comments/CommentItem.vue +170 -208
  35. package/src/components/display/comments/CommentList.vue +134 -228
  36. package/src/components/display/comments/CommentParentInfo.vue +28 -62
  37. package/src/components/display/comments/CommentPlayer.vue +53 -56
  38. package/src/components/display/comments/CommentSection.vue +52 -83
  39. package/src/components/display/edit/EditBox.vue +10 -4
  40. package/src/components/display/edit/EditCommentBox.vue +124 -38
  41. package/src/components/display/emission/EmissionChooser.vue +88 -108
  42. package/src/components/display/emission/EmissionInlineList.vue +156 -157
  43. package/src/components/display/emission/EmissionItem.vue +72 -226
  44. package/src/components/display/emission/EmissionList.vue +159 -201
  45. package/src/components/display/emission/EmissionPlayerItem.vue +203 -174
  46. package/src/components/display/filter/AdvancedSearch.vue +224 -432
  47. package/src/components/display/filter/CategoryFilter.vue +105 -0
  48. package/src/components/display/filter/MonetizableFilter.vue +18 -15
  49. package/src/components/display/filter/ProductorSearch.vue +153 -176
  50. package/src/components/display/filter/RubriqueChoice.vue +97 -0
  51. package/src/components/display/filter/RubriqueFilter.vue +232 -0
  52. package/src/components/display/list/ListPaginate.vue +145 -0
  53. package/src/components/display/list/Paginate.vue +218 -0
  54. package/src/components/display/live/CountDown.vue +31 -30
  55. package/src/components/display/live/LiveHorizontalList.vue +84 -62
  56. package/src/components/display/live/LiveItem.vue +161 -186
  57. package/src/components/display/live/LiveList.vue +184 -295
  58. package/src/components/display/organisation/OrganisationChooser.vue +124 -162
  59. package/src/components/display/organisation/OrganisationChooserLight.vue +53 -56
  60. package/src/components/display/participant/ParticipantItem.vue +91 -128
  61. package/src/components/display/participant/ParticipantList.vue +134 -121
  62. package/src/components/display/playlist/PlaylistItem.vue +60 -97
  63. package/src/components/display/playlist/PlaylistList.vue +99 -92
  64. package/src/components/display/playlist/PodcastList.vue +117 -132
  65. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +191 -0
  66. package/src/components/display/podcasts/AnimatorsItem.vue +29 -37
  67. package/src/components/display/podcasts/ParticipantDescription.vue +82 -0
  68. package/src/components/display/podcasts/PodcastFilterList.vue +49 -102
  69. package/src/components/display/podcasts/PodcastImage.vue +208 -225
  70. package/src/components/display/podcasts/PodcastInlineList.vue +62 -355
  71. package/src/components/display/podcasts/PodcastInlineListClassic.vue +240 -0
  72. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +167 -0
  73. package/src/components/display/podcasts/PodcastItem.vue +94 -218
  74. package/src/components/display/podcasts/PodcastItemInfo.vue +166 -0
  75. package/src/components/display/podcasts/PodcastList.vue +127 -178
  76. package/src/components/display/podcasts/PodcastModuleBox.vue +234 -0
  77. package/src/components/display/podcasts/PodcastPlayBar.vue +101 -0
  78. package/src/components/display/podcasts/PodcastSwiperList.vue +204 -0
  79. package/src/components/display/podcasts/TagList.vue +60 -38
  80. package/src/components/display/rubriques/RubriqueChooser.vue +144 -131
  81. package/src/components/display/rubriques/RubriqueList.vue +216 -0
  82. package/src/components/display/sharing/PlayerParameters.vue +111 -153
  83. package/src/components/display/sharing/QrCode.vue +96 -0
  84. package/src/components/display/sharing/ShareButtons.vue +63 -233
  85. package/src/components/display/sharing/ShareButtonsIntern.vue +225 -0
  86. package/src/components/display/sharing/ShareDistribution.vue +102 -166
  87. package/src/components/display/sharing/SharePlayer.vue +189 -353
  88. package/src/components/display/sharing/SharePlayerColors.vue +78 -0
  89. package/src/components/display/sharing/SharePlayerTypes.vue +112 -0
  90. package/src/components/display/sharing/SplitButton.vue +42 -0
  91. package/src/components/display/sharing/SubscribeButtons.vue +65 -118
  92. package/src/components/display/studio/RecordingItemButton.vue +3 -5
  93. package/src/components/form/ClassicCheckbox.vue +66 -0
  94. package/src/components/form/ClassicLoading.vue +28 -0
  95. package/src/components/form/ClassicRadio.vue +66 -0
  96. package/src/components/form/ClassicSearch.vue +86 -0
  97. package/src/components/form/ClassicSelect.vue +65 -0
  98. package/src/components/misc/ErrorMessage.vue +27 -18
  99. package/src/components/misc/Footer.vue +151 -108
  100. package/src/components/misc/HomeDropdown.vue +95 -154
  101. package/src/components/misc/LeftMenu.vue +137 -206
  102. package/src/components/misc/Popover.vue +118 -0
  103. package/src/components/misc/Snackbar.vue +73 -37
  104. package/src/components/misc/TopBar.vue +211 -314
  105. package/src/components/misc/modal/ClipboardModal.vue +34 -47
  106. package/src/components/misc/modal/MessageModal.vue +74 -53
  107. package/src/components/misc/modal/NewsletterModal.vue +272 -224
  108. package/src/components/misc/modal/QrCodeModal.vue +58 -0
  109. package/src/components/misc/modal/ShareModalPlayer.vue +140 -74
  110. package/src/components/misc/player/Player.vue +146 -0
  111. package/src/components/misc/player/PlayerCompact.vue +154 -0
  112. package/src/components/misc/player/PlayerLarge.vue +166 -0
  113. package/src/components/misc/player/PlayerProgressBar.vue +112 -0
  114. package/src/components/misc/player/PlayerTimeline.vue +61 -0
  115. package/src/components/mixins/functions.ts +21 -18
  116. package/src/components/mixins/handle403.ts +17 -0
  117. package/src/components/mixins/init.ts +24 -0
  118. package/src/components/mixins/orgaComputed.ts +15 -0
  119. package/src/components/mixins/organisationFilter.ts +41 -0
  120. package/src/components/mixins/player/playerComment.ts +98 -0
  121. package/src/components/mixins/player/playerDisplay.ts +113 -0
  122. package/src/components/mixins/player/playerLive.ts +111 -0
  123. package/src/components/mixins/player/playerLogic.ts +225 -0
  124. package/src/components/mixins/tagOfMixins.ts +19 -0
  125. package/src/components/pages/Category.vue +24 -28
  126. package/src/components/pages/Emission.vue +144 -177
  127. package/src/components/pages/Emissions.vue +94 -110
  128. package/src/components/pages/Error403Page.vue +60 -0
  129. package/src/components/pages/Home.vue +74 -21
  130. package/src/components/pages/Lives.vue +53 -58
  131. package/src/components/pages/PageNotFound.vue +55 -0
  132. package/src/components/pages/Participant.vue +113 -129
  133. package/src/components/pages/Participants.vue +25 -41
  134. package/src/components/pages/Playlist.vue +86 -86
  135. package/src/components/pages/Playlists.vue +33 -52
  136. package/src/components/pages/Podcast.vue +206 -478
  137. package/src/components/pages/Podcasts.vue +112 -156
  138. package/src/components/pages/Rubrique.vue +21 -27
  139. package/src/components/pages/Search.vue +37 -94
  140. package/src/helper/dom.ts +2 -2
  141. package/src/helper/duration.ts +18 -8
  142. package/src/helper/useEventListener.ts +18 -0
  143. package/src/i18n.ts +36 -0
  144. package/src/locale/de.ts +309 -0
  145. package/src/locale/educationen.ts +14 -0
  146. package/src/locale/en.ts +316 -1
  147. package/src/locale/es.ts +309 -0
  148. package/src/locale/fr.ts +47 -15
  149. package/src/locale/it.ts +307 -0
  150. package/src/locale/messages.ts +11 -2
  151. package/src/locale/sl.ts +309 -0
  152. package/src/main.ts +64 -55
  153. package/src/router/router.ts +192 -159
  154. package/src/sass/_variables.scss +10 -8
  155. package/src/shims-tsx.d.ts +15 -0
  156. package/src/shims-vue-recaptcha-v3.d.ts +9 -0
  157. package/src/shims-vue.d.ts +5 -6
  158. package/src/store/AppStore.ts +41 -173
  159. package/src/store/class/adserver/adserverConfig.ts +9 -0
  160. package/src/store/class/adserver/adserverOtherEmission.ts +13 -0
  161. package/src/store/class/adserver/adserverTiming.ts +10 -0
  162. package/src/store/class/cartouchier/cartouche.ts +15 -0
  163. package/src/store/class/cartouchier/cartouchier.ts +9 -0
  164. package/src/store/class/conference/conference.ts +35 -0
  165. package/src/store/class/conference/conferenceMessage.ts +10 -0
  166. package/src/store/class/conference/conferenceParticipant.ts +18 -0
  167. package/src/store/class/conference/pad.ts +15 -0
  168. package/src/store/class/conference/studioCall.ts +7 -0
  169. package/src/store/class/contract/contract.ts +7 -0
  170. package/src/store/class/contract/contractOrganisation.ts +7 -0
  171. package/src/store/class/ftp/ftpEmission.ts +41 -0
  172. package/src/store/class/ftp/ftpParam.ts +12 -0
  173. package/src/store/class/ftp/testFtpEmission.ts +5 -0
  174. package/src/store/class/general/audioView.ts +21 -0
  175. package/src/store/class/general/category.ts +10 -0
  176. package/src/store/class/general/comment.ts +16 -0
  177. package/src/store/class/general/customPlayer.ts +9 -0
  178. package/src/store/class/general/emission.ts +23 -0
  179. package/src/store/class/general/fetchParam.ts +3 -0
  180. package/src/store/class/general/initState.ts +25 -0
  181. package/src/store/class/general/interfacePageable.ts +16 -0
  182. package/src/store/class/general/ituneCategory.ts +5 -0
  183. package/src/store/class/general/media.ts +14 -0
  184. package/src/store/class/general/organisation.ts +20 -0
  185. package/src/store/class/general/pageable.ts +13 -0
  186. package/src/store/class/general/participant.ts +12 -0
  187. package/src/store/class/general/player.ts +14 -0
  188. package/src/store/class/general/playlist.ts +13 -0
  189. package/src/store/class/general/podcast.ts +43 -0
  190. package/src/store/class/general/sortPageable.ts +5 -0
  191. package/src/store/class/general/soundcastCategory.ts +8 -0
  192. package/src/store/class/ouestFrance/ofTag.ts +36 -0
  193. package/src/store/class/ouestFrance/ofTagInfo.ts +9 -0
  194. package/src/store/class/ouestFrance/ofTagPage.ts +7 -0
  195. package/src/store/class/ouestFrance/ofTagSeo.ts +7 -0
  196. package/src/store/class/ouestFrance/ofTagVente.ts +6 -0
  197. package/src/store/class/ouestFrance/ofTagWithParents.ts +26 -0
  198. package/src/store/class/rss/aggregator.ts +28 -0
  199. package/src/store/class/rss/rssEmission.ts +14 -0
  200. package/src/store/class/rss/rssInfo.ts +8 -0
  201. package/src/store/class/rubrique/rubriquage.ts +10 -0
  202. package/src/store/class/rubrique/rubriquageFilter.ts +6 -0
  203. package/src/store/class/rubrique/rubrique.ts +9 -0
  204. package/src/store/class/stat/statArrayIncome.ts +6 -0
  205. package/src/store/class/stat/statArrayObject.ts +34 -0
  206. package/src/store/class/stat/statGraph.ts +7 -0
  207. package/src/store/class/user/person.ts +15 -0
  208. package/src/store/class/user/profile.ts +12 -0
  209. package/src/store/class/user/userKeycloak.ts +24 -0
  210. package/src/store/paramStore.ts +222 -217
  211. package/src/store/typeAppStore.ts +186 -235
  212. package/src/vuex-shim.d.ts +8 -0
  213. package/tsconfig.json +4 -0
  214. package/vue.config.js +16 -0
  215. package/public/css/fonts/saooti-ui.eot +0 -0
  216. package/public/css/fonts/saooti-ui.svg +0 -829
  217. package/public/css/fonts/saooti-ui.ttf +0 -0
  218. package/public/css/fonts/saooti-ui.woff +0 -0
  219. package/public/css/fonts/stitcher-logo.svg +0 -83
  220. package/public/img/ACPM.PNG +0 -0
  221. package/src/api/comments.ts +0 -7
  222. package/src/api/emissions.ts +0 -7
  223. package/src/api/podcasts.ts +0 -7
  224. package/src/api/profile.ts +0 -8
  225. package/src/api/studio.ts +0 -1
  226. package/src/assets/bootstrap_scss/_alert.scss +0 -51
  227. package/src/assets/bootstrap_scss/_badge.scss +0 -54
  228. package/src/assets/bootstrap_scss/_breadcrumb.scss +0 -42
  229. package/src/assets/bootstrap_scss/_button-group.scss +0 -164
  230. package/src/assets/bootstrap_scss/_buttons.scss +0 -291
  231. package/src/assets/bootstrap_scss/_card.scss +0 -278
  232. package/src/assets/bootstrap_scss/_carousel.scss +0 -197
  233. package/src/assets/bootstrap_scss/_close.scss +0 -41
  234. package/src/assets/bootstrap_scss/_code.scss +0 -48
  235. package/src/assets/bootstrap_scss/_custom-forms.scss +0 -522
  236. package/src/assets/bootstrap_scss/_dropdown.scss +0 -201
  237. package/src/assets/bootstrap_scss/_forms.scss +0 -352
  238. package/src/assets/bootstrap_scss/_functions.scss +0 -134
  239. package/src/assets/bootstrap_scss/_grid.scss +0 -69
  240. package/src/assets/bootstrap_scss/_images.scss +0 -42
  241. package/src/assets/bootstrap_scss/_input-group.scss +0 -191
  242. package/src/assets/bootstrap_scss/_jumbotron.scss +0 -17
  243. package/src/assets/bootstrap_scss/_list-group.scss +0 -158
  244. package/src/assets/bootstrap_scss/_media.scss +0 -8
  245. package/src/assets/bootstrap_scss/_mixins.scss +0 -47
  246. package/src/assets/bootstrap_scss/_modal.scss +0 -243
  247. package/src/assets/bootstrap_scss/_nav.scss +0 -120
  248. package/src/assets/bootstrap_scss/_navbar.scss +0 -324
  249. package/src/assets/bootstrap_scss/_pagination.scss +0 -74
  250. package/src/assets/bootstrap_scss/_popover.scss +0 -170
  251. package/src/assets/bootstrap_scss/_print.scss +0 -141
  252. package/src/assets/bootstrap_scss/_progress.scss +0 -46
  253. package/src/assets/bootstrap_scss/_reboot.scss +0 -482
  254. package/src/assets/bootstrap_scss/_root.scss +0 -20
  255. package/src/assets/bootstrap_scss/_spinners.scss +0 -55
  256. package/src/assets/bootstrap_scss/_tables.scss +0 -185
  257. package/src/assets/bootstrap_scss/_toasts.scss +0 -44
  258. package/src/assets/bootstrap_scss/_tooltip.scss +0 -115
  259. package/src/assets/bootstrap_scss/_transitions.scss +0 -20
  260. package/src/assets/bootstrap_scss/_type.scss +0 -125
  261. package/src/assets/bootstrap_scss/_utilities.scss +0 -17
  262. package/src/assets/bootstrap_scss/_variables.scss +0 -1145
  263. package/src/assets/bootstrap_scss/bootstrap-grid.scss +0 -29
  264. package/src/assets/bootstrap_scss/bootstrap-reboot.scss +0 -12
  265. package/src/assets/bootstrap_scss/bootstrap.scss +0 -44
  266. package/src/assets/bootstrap_scss/mixins/_alert.scss +0 -13
  267. package/src/assets/bootstrap_scss/mixins/_background-variant.scss +0 -22
  268. package/src/assets/bootstrap_scss/mixins/_badge.scss +0 -17
  269. package/src/assets/bootstrap_scss/mixins/_border-radius.scss +0 -63
  270. package/src/assets/bootstrap_scss/mixins/_box-shadow.scss +0 -20
  271. package/src/assets/bootstrap_scss/mixins/_breakpoints.scss +0 -123
  272. package/src/assets/bootstrap_scss/mixins/_buttons.scss +0 -110
  273. package/src/assets/bootstrap_scss/mixins/_caret.scss +0 -62
  274. package/src/assets/bootstrap_scss/mixins/_clearfix.scss +0 -7
  275. package/src/assets/bootstrap_scss/mixins/_deprecate.scss +0 -10
  276. package/src/assets/bootstrap_scss/mixins/_float.scss +0 -14
  277. package/src/assets/bootstrap_scss/mixins/_forms.scss +0 -177
  278. package/src/assets/bootstrap_scss/mixins/_gradients.scss +0 -45
  279. package/src/assets/bootstrap_scss/mixins/_grid-framework.scss +0 -71
  280. package/src/assets/bootstrap_scss/mixins/_grid.scss +0 -69
  281. package/src/assets/bootstrap_scss/mixins/_hover.scss +0 -37
  282. package/src/assets/bootstrap_scss/mixins/_image.scss +0 -36
  283. package/src/assets/bootstrap_scss/mixins/_list-group.scss +0 -21
  284. package/src/assets/bootstrap_scss/mixins/_lists.scss +0 -7
  285. package/src/assets/bootstrap_scss/mixins/_nav-divider.scss +0 -11
  286. package/src/assets/bootstrap_scss/mixins/_pagination.scss +0 -22
  287. package/src/assets/bootstrap_scss/mixins/_reset-text.scss +0 -17
  288. package/src/assets/bootstrap_scss/mixins/_resize.scss +0 -6
  289. package/src/assets/bootstrap_scss/mixins/_screen-reader.scss +0 -34
  290. package/src/assets/bootstrap_scss/mixins/_size.scss +0 -7
  291. package/src/assets/bootstrap_scss/mixins/_table-row.scss +0 -39
  292. package/src/assets/bootstrap_scss/mixins/_text-emphasis.scss +0 -17
  293. package/src/assets/bootstrap_scss/mixins/_text-hide.scss +0 -11
  294. package/src/assets/bootstrap_scss/mixins/_text-truncate.scss +0 -8
  295. package/src/assets/bootstrap_scss/mixins/_transition.scss +0 -16
  296. package/src/assets/bootstrap_scss/mixins/_visibility.scss +0 -8
  297. package/src/assets/bootstrap_scss/utilities/_align.scss +0 -8
  298. package/src/assets/bootstrap_scss/utilities/_background.scss +0 -19
  299. package/src/assets/bootstrap_scss/utilities/_borders.scss +0 -75
  300. package/src/assets/bootstrap_scss/utilities/_clearfix.scss +0 -3
  301. package/src/assets/bootstrap_scss/utilities/_display.scss +0 -26
  302. package/src/assets/bootstrap_scss/utilities/_embed.scss +0 -39
  303. package/src/assets/bootstrap_scss/utilities/_flex.scss +0 -51
  304. package/src/assets/bootstrap_scss/utilities/_float.scss +0 -11
  305. package/src/assets/bootstrap_scss/utilities/_overflow.scss +0 -5
  306. package/src/assets/bootstrap_scss/utilities/_position.scss +0 -32
  307. package/src/assets/bootstrap_scss/utilities/_screenreaders.scss +0 -11
  308. package/src/assets/bootstrap_scss/utilities/_shadows.scss +0 -6
  309. package/src/assets/bootstrap_scss/utilities/_sizing.scss +0 -20
  310. package/src/assets/bootstrap_scss/utilities/_spacing.scss +0 -73
  311. package/src/assets/bootstrap_scss/utilities/_stretched-link.scss +0 -19
  312. package/src/assets/bootstrap_scss/utilities/_text.scss +0 -72
  313. package/src/assets/bootstrap_scss/utilities/_visibility.scss +0 -13
  314. package/src/assets/bootstrap_scss/vendor/_rfs.scss +0 -204
  315. package/src/components/misc/Player.vue +0 -792
  316. package/src/shims-vuex.d.ts +0 -7
  317. package/src/views/Home.vue +0 -18
@@ -1,792 +0,0 @@
1
- <template>
2
- <div
3
- class="w-100 transition-height bg-dark"
4
- v-bind:style="{ height: playerHeight }"
5
- >
6
- <div
7
- class="player-container"
8
- v-bind:style="{ height: playerHeight }"
9
- @transitionend="onHidden"
10
- >
11
- <div
12
- class="progress secondary-bg c-hand"
13
- @mouseup="seekTo"
14
- v-if="isBarTop"
15
- >
16
- <div
17
- class="progress-bar primary-bg"
18
- role="progressbar"
19
- aria-valuenow="0"
20
- aria-valuemin="0"
21
- aria-valuemax="100"
22
- :style="'width: ' + percentProgress + '%'"
23
- ></div>
24
- <div class="player-progress-border"></div>
25
- </div>
26
- <div
27
- class="d-flex align-items-center justify-center flex-grow pr-5 pl-5"
28
- v-if="display"
29
- >
30
- <audio
31
- id="audio-player"
32
- v-bind:src="audioUrl"
33
- autoplay
34
- @timeupdate="onTimeUpdate"
35
- @ended="onFinished"
36
- @playing="onPlay"
37
- @durationChange="onTimeUpdate"
38
- @error="onError"
39
- v-if="!live"
40
- />
41
- <audio
42
- id="audio-player"
43
- src
44
- @timeupdate="onTimeUpdate"
45
- @ended="onFinished"
46
- @playing="onPlay"
47
- @durationChange="onTimeUpdate"
48
- @error="onError"
49
- v-else
50
- />
51
- <router-link :to="podcastShareUrl" v-if="isImage && podcastImage">
52
- <img
53
- v-bind:src="podcastImage"
54
- :alt="$t('Podcast image')"
55
- class="player-image c-hand"
56
- />
57
- </router-link>
58
-
59
- <div
60
- v-if="!playerError"
61
- class="play-button-box"
62
- v-bind:class="{
63
- 'primary-bg': !isLoading,
64
- 'text-light': !isLoading,
65
- }"
66
- @click="switchPausePlay"
67
- >
68
- <div
69
- class="text-light"
70
- :aria-label="$t('Play')"
71
- v-bind:class="{
72
- saooti: isPlaying || isPaused,
73
- 'saooti-play2-bounty': isPaused,
74
- 'saooti-pause-bounty': isPlaying,
75
- loading: isLoading,
76
- }"
77
- ></div>
78
- </div>
79
- <div
80
- v-if="(isPlaying || isPaused) && (media || isStop)"
81
- class="play-button-box primary-bg text-light"
82
- @click="stopPlayer"
83
- >
84
- <div
85
- class="text-light saooti-stop-bounty"
86
- :aria-label="$t('Stop')"
87
- ></div>
88
- </div>
89
- <div class="text-light player-grow-content">
90
- <div class="d-flex">
91
- <div class="text-warning player-title ml-2 mr-2" v-if="playerError">
92
- {{ $t('Podcast play error') + ' - ' }}
93
- </div>
94
- <div class="flex-grow player-title">{{ podcastTitle }}</div>
95
- <div v-if="!playerError" v-show="!isBarTop" class="hide-phone">
96
- {{ playedTime }} / {{ totalTime }}
97
- </div>
98
- </div>
99
- <div
100
- class="progress c-hand custom-bg-darkgrey"
101
- @mouseup="seekTo"
102
- style="height: 3px;"
103
- v-if="!playerError"
104
- v-show="!isBarTop"
105
- >
106
- <div
107
- class="progress-bar custom-bg-grey"
108
- role="progressbar"
109
- aria-valuenow="0"
110
- aria-valuemin="0"
111
- aria-valuemax="100"
112
- :style="'width: ' + percentLiveProgress + '%'"
113
- ></div>
114
- <div
115
- class="progress-bar primary-bg"
116
- role="progressbar"
117
- aria-valuenow="0"
118
- aria-valuemin="0"
119
- aria-valuemax="100"
120
- :style="'width: ' + percentProgress + '%'"
121
- ></div>
122
- <div
123
- class="progress-bar progress-bar-duration bg-danger"
124
- v-if="displayAlertBar"
125
- :style="'left: ' + durationLivePosition + '%'"
126
- ></div>
127
- </div>
128
- <CommentPlayer
129
- v-if="showTimeline"
130
- :totalTime="totalSecondes"
131
- :comments="comments"
132
- />
133
- </div>
134
- <div
135
- class="timeline-button"
136
- v-if="0 !== comments.length"
137
- @click="showTimeline = !showTimeline"
138
- >
139
- <div
140
- class="saooti-arrow_down saooti-arrow_down-margin"
141
- :class="showTimeline ? '' : 'arrow-transform'"
142
- ></div>
143
- <div>Timeline</div>
144
- </div>
145
- <div
146
- class="d-flex text-light align-items-center hide-phone"
147
- v-if="isClock"
148
- >
149
- <div class="saooti-clock-stud m-2"></div>
150
- <div>{{ actualTime }}</div>
151
- </div>
152
- </div>
153
- </div>
154
- </div>
155
- </template>
156
- <style lang="scss">
157
- @import '../../sass/_variables.scss';
158
-
159
- .play-button-box {
160
- height: 2.5rem;
161
- width: 2.5rem;
162
- display: flex;
163
- align-items: center;
164
- justify-content: center;
165
- margin: 0 0.5rem;
166
- border-radius: 50%;
167
- font-size: 1.2rem;
168
- flex-shrink: 0;
169
- cursor: pointer;
170
- }
171
-
172
- .player-container {
173
- position: fixed;
174
- overflow: hidden;
175
- z-index: 12;
176
- width: 100%;
177
- bottom: 0;
178
- display: flex;
179
- flex-direction: column;
180
- transition: height 1s;
181
- background: #282828 !important;
182
- max-width: 100%;
183
- font-size: 1rem;
184
-
185
- .player-image {
186
- border-radius: 0.2rem;
187
- height: 2.4rem;
188
- width: 2.4rem;
189
- }
190
- .player-progress-border {
191
- height: 10px;
192
- width: 3px;
193
- background: black;
194
- }
195
- .progress {
196
- align-items: flex-end;
197
- height: 10px;
198
- position: relative;
199
- }
200
- .progress-bar-duration {
201
- width: 10px;
202
- }
203
- .progress-bar {
204
- height: 4px;
205
- position: absolute;
206
- }
207
-
208
- .progress.custom-bg-darkgrey {
209
- background: #555;
210
- }
211
-
212
- .progress-bar.custom-bg-grey {
213
- background: #e9ecef;
214
- }
215
-
216
- .player-title,
217
- .hide-phone {
218
- font-size: 0.8rem;
219
- margin: 0 0 5px 0;
220
- }
221
- .player-grow-content {
222
- display: flex;
223
- flex-grow: 1;
224
- flex-direction: column;
225
- flex-shrink: 1;
226
- flex-basis: 20px;
227
- overflow: hidden;
228
- }
229
- .player-title {
230
- font-size: 0.8rem;
231
- margin: 0 0 5px 0;
232
- }
233
-
234
- .hide-phone {
235
- font-size: 0.8rem;
236
- margin: 0 0 5px 0;
237
- }
238
- .timeline-button {
239
- background: black;
240
- padding: 0.1rem;
241
- border-radius: 50%;
242
- width: 70px;
243
- height: 70px;
244
- font-size: 0.7rem;
245
- font-weight: bold;
246
- justify-content: center;
247
- display: flex;
248
- flex-direction: column;
249
- align-items: center;
250
- cursor: pointer;
251
- color: $octopus-primary-color;
252
- margin-left: 0.5rem;
253
- @media (max-width: 960px) {
254
- display: none;
255
- }
256
- }
257
- }
258
- /** PHONES*/
259
- @media (max-width: 450px) {
260
- .player-container {
261
- .player-image {
262
- height: 2rem;
263
- width: 2rem;
264
- }
265
- }
266
- }
267
-
268
- @media (max-width: 960px) {
269
- .player-container {
270
- .d-flex {
271
- @media (max-width: 960px) {
272
- flex-wrap: nowrap !important;
273
- }
274
- }
275
- .player-title {
276
- font-size: 12px;
277
- overflow: hidden;
278
- white-space: nowrap;
279
- text-overflow: ellipsis;
280
- }
281
- }
282
- }
283
- </style>
284
-
285
- <script lang="ts">
286
- import { mapState } from 'vuex';
287
- import { state } from '../../store/paramStore';
288
- import DurationHelper from '../../helper/duration';
289
- import CommentPlayer from '../display/comments/CommentPlayer.vue';
290
- const octopusApi = require('@saooti/octopus-api');
291
- import Hls from 'hls.js';
292
-
293
- const moment = require('moment');
294
- //const axios = require("axios");
295
-
296
- import { defineComponent } from 'vue'
297
- export default defineComponent({
298
- name: 'Player',
299
-
300
- components: {
301
- CommentPlayer,
302
- },
303
-
304
- emits: ['hide'],
305
-
306
- mounted() {
307
- moment.locale('fr');
308
- if (this.isClock) {
309
- setInterval(() => {
310
- this.actualTime = moment(new Date()).format('HH:mm:ss');
311
- }, 1000);
312
- }
313
- window.addEventListener('beforeunload', this.endListeningProgress);
314
- this.watchPlayerStatus();
315
- },
316
-
317
- data() {
318
- return {
319
- forceHide: false,
320
- actualTime: '',
321
- listenTime: 0,
322
- notListenTime: 0,
323
- lastSend: 0,
324
- downloadId: null,
325
- playerError: false,
326
- listenError: false,
327
- percentLiveProgress: 0,
328
- durationLivePosition: 0,
329
- displayAlertBar: false,
330
- hlsReady: false,
331
- comments: [] as any,
332
- showTimeline: false,
333
- };
334
- },
335
-
336
- computed: {
337
- isPlaying():boolean {
338
- return 'PLAYING' === this.status;
339
- },
340
- isPaused():boolean {
341
- return 'PAUSED' === this.status;
342
- },
343
- isLoading():boolean {
344
- return 'LOADING' === this.status;
345
- },
346
- isImage() {
347
- return state.player.image;
348
- },
349
- isEmissionName() {
350
- return state.player.emissionName;
351
- },
352
- isClock() {
353
- return state.player.clock;
354
- },
355
- isBarTop() {
356
- return state.player.barTop;
357
- },
358
- ...mapState({
359
- display: (state:any) => 'STOPPED' !== state.player.status,
360
- playerHeight(state:any) {
361
- if ('STOPPED' === state.player.status || this.forceHide) return 0;
362
- if (window.innerWidth > 450 && !this.showTimeline) return '5rem';
363
- if (window.innerWidth > 450 && this.showTimeline) return '6rem';
364
- return '3.5rem';
365
- },
366
- status: (state:any) => state.player.status,
367
- podcast: (state:any) => state.player.podcast,
368
- media: (state:any) => state.player.media,
369
- live: (state:any) => state.player.live,
370
- volume: (state:any) => state.player.volume,
371
- isStop: (state:any) => state.player.stop,
372
- commentsLoaded: (state:any) => state.comments.loadedComments,
373
-
374
- podcastImage: (state:any) => {
375
- if (state.player.podcast) return state.player.podcast.imageUrl;
376
- return '';
377
- },
378
-
379
- playedTime: (state:any) => {
380
- if (state.player.elapsed > 0 && state.player.total > 0) {
381
- return DurationHelper.formatDuration(
382
- Math.round(state.player.elapsed * state.player.total)
383
- );
384
- }
385
- return '--:--';
386
- },
387
-
388
- percentProgress: (state:any) => {
389
- return state.player.elapsed * 100;
390
- },
391
-
392
- totalTime: (state:any) => {
393
- if (state.player.elapsed > 0 && state.player.total > 0)
394
- return DurationHelper.formatDuration(Math.round(state.player.total));
395
- return '--:--';
396
- },
397
- totalSecondes: (state:any) => state.player.total,
398
- }),
399
-
400
- audioUrl():any {
401
- if (this.media) return this.media.audioUrl;
402
- if (!this.podcast) return '';
403
- if (!this.podcast.availability.visibility)
404
- return this.podcast.audioStorageUrl;
405
- if (this.listenError) return this.podcast.audioStorageUrl;
406
- let parameters = [];
407
- parameters.push('origin=octopus');
408
- parameters.push('cookieName=player_' + this.podcast.podcastId);
409
- if (
410
- this.$store.state.authentication &&
411
- this.$store.state.authentication.organisationId
412
- ) {
413
- parameters.push(
414
- 'distributorId=' + this.$store.state.authentication.organisationId
415
- );
416
- }
417
- return this.podcast.audioUrl + '?' + parameters.join('&');
418
- },
419
-
420
- podcastShareUrl():any {
421
- if (this.podcast) {
422
- return {
423
- name: 'podcast',
424
- params: { podcastId: this.podcast.podcastId },
425
- query: { productor: this.$store.state.filter.organisationId },
426
- };
427
- }
428
- return '';
429
- },
430
-
431
- podcastTitle():string {
432
- if (this.podcast) {
433
- if (this.isEmissionName)
434
- return this.emissionName + ' - ' + this.podcast.title;
435
- return this.podcast.title;
436
- }
437
- if (this.media) return this.media.title;
438
- if (this.live) {
439
- if (!this.hlsReady)
440
- return this.live.title + ' (' + this.$t('Start in a while') + ')';
441
- return this.live.title;
442
- }
443
- return '';
444
- },
445
-
446
- emissionName():string {
447
- if (this.podcast) return this.podcast.emission.name;
448
- return '';
449
- },
450
-
451
- organisationId() {
452
- return state.generalParameters.organisationId;
453
- },
454
- },
455
-
456
- methods: {
457
- watchPlayerStatus() {
458
- this.$store.watch(
459
- (state:any) => state.player.status,
460
- (newValue:any) => {
461
- const audioPlayer:any = document.querySelector('#audio-player');
462
- if (!audioPlayer) return;
463
- if (this.live && !this.hlsReady) {
464
- audioPlayer.pause();
465
- this.percentLiveProgress = 0;
466
- this.durationLivePosition = 0;
467
- return;
468
- }
469
- if ('PAUSED' === newValue) {
470
- audioPlayer.pause();
471
- } else {
472
- audioPlayer.play();
473
- }
474
- }
475
- );
476
- },
477
- getDownloadId() {
478
- //TODO
479
- return undefined;
480
- /* return this._downloadId; */
481
- },
482
-
483
- setDownloadId(newValue?: any) {
484
- this.endListeningProgress();
485
- //TODO
486
- console.log(newValue);
487
- /* this._downloadId = newValue; */
488
- },
489
-
490
- onError() {
491
- if (this.podcast && !this.listenError) {
492
- this.listenError = true;
493
- } else if (this.podcast || this.media) {
494
- this.playerError = true;
495
- }
496
- },
497
-
498
- switchPausePlay() {
499
- const audioPlayer:any = document.querySelector('#audio-player');
500
- if (audioPlayer.paused) {
501
- this.onPlay();
502
- } else {
503
- this.onPause();
504
- }
505
- },
506
-
507
- stopPlayer() {
508
- this.$store.commit('playerPlayPodcast');
509
- },
510
-
511
- seekTo(event: { currentTarget: { getBoundingClientRect: () => any; clientWidth: any; }; clientX: number; }) {
512
- const audioPlayer:any = document.querySelector('#audio-player');
513
- const rect = event.currentTarget.getBoundingClientRect();
514
- const barWidth = event.currentTarget.clientWidth;
515
- const x = event.clientX - rect.left; //x position within the element.
516
-
517
- const percentPosition = x / barWidth;
518
- if (percentPosition * 100 >= this.percentLiveProgress) return;
519
-
520
- const seekTime = this.$store.state.player.total! * percentPosition;
521
- if (this.podcast || this.live) {
522
- this.notListenTime = seekTime - this.listenTime;
523
- }
524
- audioPlayer.currentTime = seekTime;
525
- },
526
-
527
- onTimeUpdate(event: { currentTarget: { currentTime: number; duration: any; }; }) {
528
- if (this.podcast || this.live) {
529
- if (!this.getDownloadId()) {
530
- this.loadDownloadId();
531
- }
532
- if (
533
- this.live &&
534
- 0 === this.listenTime &&
535
- 0 !== event.currentTarget.currentTime
536
- ) {
537
- this.notListenTime = event.currentTarget.currentTime;
538
- this.listenTime = 1;
539
- } else {
540
- this.listenTime =
541
- event.currentTarget.currentTime - this.notListenTime;
542
- }
543
- }
544
- const streamDuration = event.currentTarget.duration;
545
- if (!streamDuration) return;
546
-
547
- const playerCurrentTime = event.currentTarget.currentTime;
548
- if (!playerCurrentTime) return;
549
-
550
- if (!this.live) {
551
- this.displayAlertBar = false;
552
- this.percentLiveProgress = 100;
553
- this.$store.commit('playerTotalTime', streamDuration);
554
- this.$store.commit('playerElapsed', playerCurrentTime / streamDuration);
555
- return;
556
- }
557
-
558
- const scheduledDuration = this.live.duration / 1000;
559
- if (scheduledDuration > streamDuration) {
560
- this.displayAlertBar = false;
561
- this.percentLiveProgress = (streamDuration / scheduledDuration) * 100;
562
- this.$store.commit('playerTotalTime', scheduledDuration);
563
- this.$store.commit(
564
- 'playerElapsed',
565
- playerCurrentTime / scheduledDuration
566
- );
567
- } else {
568
- this.percentLiveProgress = 100;
569
- this.displayAlertBar = true;
570
- this.durationLivePosition = (scheduledDuration / streamDuration) * 100;
571
- this.$store.commit('playerTotalTime', streamDuration);
572
- this.$store.commit('playerElapsed', playerCurrentTime / streamDuration);
573
- }
574
- },
575
-
576
- onPlay() {
577
- this.$store.commit('playerPause', false);
578
- },
579
-
580
- onPause() {
581
- this.$store.commit('playerPause', true);
582
- },
583
-
584
- onFinished() {
585
- this.setDownloadId(null);
586
- if (this.live) {
587
- let audio:any = document.getElementById('audio-player');
588
- audio.src = '';
589
- }
590
- this.forceHide = true;
591
- },
592
-
593
- onHidden() {
594
- if (this.forceHide) {
595
- this.$store.commit('playerPlayPodcast');
596
- this.forceHide = false;
597
- }
598
- },
599
-
600
- loadDownloadId() {
601
- if (!this.podcast) return;
602
- const matching_cookies = document.cookie
603
- .split(';')
604
- .map(item => {
605
- const _return = item.trim().split('=');
606
- return _return.map(item => item.trim());
607
- })
608
- .filter(item => {
609
- return 'player_' + this.podcast.podcastId === item[0];
610
- });
611
- if (1 === matching_cookies.length) {
612
- this.setDownloadId(matching_cookies[0][1]);
613
- }
614
- },
615
-
616
- async endListeningProgress() {
617
- if (!this.getDownloadId()) return;
618
- await octopusApi.updatePlayerTime(
619
- this.getDownloadId(),
620
- Math.round(this.listenTime)
621
- );
622
- this.setDownloadId(null);
623
- this.notListenTime = 0;
624
- this.lastSend = 0;
625
- this.listenTime = 0;
626
- },
627
-
628
- async initHls(hlsStreamUrl: string) {
629
- return new Promise<void>((resolve, reject) => {
630
- if (!Hls.isSupported()) {
631
- reject('Hls is not supported ! ');
632
- }
633
- var hls = new Hls();
634
- hls.on(Hls.Events.MANIFEST_PARSED, async () => {
635
- let downloadId = null;
636
- try {
637
- downloadId = await octopusApi.requestLiveDownloadId(
638
- this.live.livePodcastId
639
- );
640
- await octopusApi.markPlayingLive(
641
- this.live.livePodcastId,
642
- downloadId,
643
- 'octopus',
644
- this.$store.state.authentication.organisationId
645
- );
646
- this.setDownloadId(downloadId);
647
- } catch (error) {
648
- console.log('ERROR downloadId');
649
- }
650
- this.hlsReady = true;
651
- let audio:any = document.getElementById('audio-player');
652
- hls.attachMedia(audio);
653
- await audio.play();
654
- this.onPlay();
655
- resolve();
656
- });
657
- hls.on(Hls.Events.ERROR, async () => {
658
- reject('There is an error while reading media content');
659
- });
660
- hls.loadSource(hlsStreamUrl);
661
- });
662
- },
663
-
664
- async playLive() {
665
- if (!this.live) return;
666
- let hlsStreamUrl =
667
- state.podcastPage.hlsUri +
668
- 'stream/dev.' +
669
- this.live.conferenceId +
670
- '/index.m3u8';
671
- try {
672
- await this.initHls(hlsStreamUrl);
673
- } catch (error) {
674
- console.log(error);
675
- setTimeout(() => {
676
- this.playLive();
677
- }, 1000);
678
- }
679
- },
680
-
681
- editRight(organisation: any) {
682
- if (
683
- (state.generalParameters.isCommments &&
684
- this.organisationId === organisation) ||
685
- state.generalParameters.isAdmin
686
- )
687
- return true;
688
- return false;
689
- },
690
-
691
- async initComments(refresh = false) {
692
- let podcastId, organisation;
693
- if (this.podcast) {
694
- podcastId = this.podcast.podcastId;
695
- organisation = this.podcast.organisation.id;
696
- } else if (this.live) {
697
- podcastId = this.live.livePodcastId;
698
- organisation = this.live.organisation;
699
- }
700
- if (
701
- refresh &&
702
- podcastId &&
703
- this.$store.state.comments.actualPodcastId !== podcastId
704
- ) {
705
- return;
706
- }
707
- let first = 0;
708
- let count = 0;
709
- let size = 50;
710
- if (
711
- podcastId &&
712
- this.$store.state.comments.actualPodcastId === podcastId
713
- ) {
714
- this.comments = this.commentsLoaded;
715
- if (
716
- this.commentsLoaded &&
717
- this.commentsLoaded.length < this.$store.state.comments.totalCount
718
- ) {
719
- first = this.commentsLoaded.length;
720
- count = this.$store.state.comments.totalCount;
721
- }
722
- }
723
- if (
724
- (!podcastId ||
725
- this.$store.state.comments.actualPodcastId === podcastId) &&
726
- 0 === first
727
- )
728
- return;
729
- while (0 === first || this.comments.length < count) {
730
- let param:any = {
731
- first: first,
732
- size: size,
733
- podcastId: podcastId,
734
- };
735
- if (!this.editRight(organisation)) {
736
- param.status = 'Valid';
737
- }
738
- const data = await octopusApi.fetchRootComments(param);
739
- first += size;
740
- count = data.totalElements;
741
- this.comments = this.comments.concat(data.content).filter((c: null) => {
742
- return null !== c;
743
- });
744
- }
745
- },
746
- },
747
-
748
- watch: {
749
- async live() {
750
- this.hlsReady = false;
751
- this.setDownloadId(null);
752
- this.listenError = false;
753
- await this.playLive();
754
- this.initComments();
755
- },
756
-
757
- playerHeight(newVal) {
758
- this.$emit('hide', 0 === newVal ? true : false);
759
- },
760
-
761
- podcast() {
762
- this.setDownloadId(null);
763
- this.listenError = false;
764
- this.initComments();
765
- },
766
-
767
- async listenTime(newVal) {
768
- if (!this.podcast && !this.live) {
769
- //Nothing can be done there is no listen time
770
- return;
771
- }
772
- if (!this.getDownloadId()) {
773
- //nothing can be done there is no downloadId
774
- return;
775
- }
776
- if (newVal - this.lastSend < 10) {
777
- //Last send is too recent, do nothing
778
- return;
779
- }
780
- this.lastSend = newVal;
781
- await octopusApi.updatePlayerTime(
782
- this.getDownloadId(),
783
- Math.round(newVal)
784
- );
785
- },
786
-
787
- commentsLoaded() {
788
- this.initComments(true);
789
- },
790
- },
791
- });
792
- </script>