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