@saooti/octopus-sdk 33.0.0 → 33.0.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 (73) hide show
  1. package/README.md +2 -1
  2. package/docker-compose.sonar.yml +8 -0
  3. package/package.json +13 -3
  4. package/public/css/fonts/icomoon.eot +0 -0
  5. package/public/css/fonts/icomoon.svg +1 -0
  6. package/public/css/fonts/icomoon.ttf +0 -0
  7. package/public/css/fonts/icomoon.woff +0 -0
  8. package/public/css/fonts/style.css +35 -32
  9. package/sonarqube-scanner.js +18 -0
  10. package/src/assets/bootstrap-diff.scss +0 -1
  11. package/src/assets/general.scss +2 -3
  12. package/src/assets/multiselect.scss +0 -4
  13. package/src/assets/share.scss +0 -8
  14. package/src/components/display/categories/CategoryList.vue +2 -3
  15. package/src/components/display/comments/AddCommentModal.vue +4 -1
  16. package/src/components/display/comments/CommentBasicView.vue +4 -4
  17. package/src/components/display/comments/CommentInput.vue +2 -2
  18. package/src/components/display/comments/CommentItem.vue +32 -25
  19. package/src/components/display/comments/CommentList.vue +34 -21
  20. package/src/components/display/comments/CommentSection.vue +2 -3
  21. package/src/components/display/edit/EditBox.vue +0 -1
  22. package/src/components/display/emission/EmissionChooser.vue +1 -1
  23. package/src/components/display/emission/EmissionItem.vue +2 -2
  24. package/src/components/display/emission/EmissionList.vue +4 -4
  25. package/src/components/display/filter/AdvancedSearch.vue +1 -1
  26. package/src/components/display/filter/DateFilter.vue +2 -2
  27. package/src/components/display/filter/SearchOrder.vue +1 -1
  28. package/src/components/display/list/ListPaginate.vue +6 -3
  29. package/src/components/display/list/Paginate.vue +32 -28
  30. package/src/components/display/live/LiveHorizontalList.vue +4 -4
  31. package/src/components/display/live/LiveList.vue +41 -33
  32. package/src/components/display/participant/ParticipantItem.vue +3 -3
  33. package/src/components/display/participant/ParticipantList.vue +4 -9
  34. package/src/components/display/playlist/PlaylistItem.vue +3 -3
  35. package/src/components/display/playlist/PlaylistList.vue +4 -4
  36. package/src/components/display/playlist/PodcastList.vue +2 -2
  37. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +1 -1
  38. package/src/components/display/podcasts/ParticipantDescription.vue +1 -1
  39. package/src/components/display/podcasts/PodcastImage.vue +4 -3
  40. package/src/components/display/podcasts/PodcastInlineList.vue +2 -0
  41. package/src/components/display/podcasts/PodcastInlineListClassic.vue +22 -1
  42. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +7 -4
  43. package/src/components/display/podcasts/PodcastItem.vue +2 -2
  44. package/src/components/display/podcasts/PodcastList.vue +4 -4
  45. package/src/components/display/podcasts/PodcastSwiperList.vue +1 -1
  46. package/src/components/display/rubriques/RubriqueChooser.vue +1 -1
  47. package/src/components/display/rubriques/RubriqueList.vue +2 -2
  48. package/src/components/display/sharing/PlayerParameters.vue +1 -1
  49. package/src/components/display/sharing/QrCode.vue +1 -2
  50. package/src/components/display/sharing/ShareButtonsIntern.vue +1 -2
  51. package/src/components/display/sharing/ShareDistribution.vue +1 -2
  52. package/src/components/display/sharing/SharePlayer.vue +47 -33
  53. package/src/components/display/sharing/SharePlayerTypes.vue +1 -1
  54. package/src/components/form/ClassicSelect.vue +0 -1
  55. package/src/components/misc/Footer.vue +1 -1
  56. package/src/components/misc/modal/NewsletterModal.vue +2 -3
  57. package/src/components/misc/modal/ShareModalPlayer.vue +1 -2
  58. package/src/components/misc/player/PlayerCompact.vue +1 -1
  59. package/src/components/misc/player/PlayerLarge.vue +1 -1
  60. package/src/components/mixins/functions.ts +3 -14
  61. package/src/components/mixins/player/playerComment.ts +34 -27
  62. package/src/components/mixins/player/playerLive.ts +1 -10
  63. package/src/components/mixins/player/playerLogic.ts +40 -29
  64. package/src/components/pages/Podcast.vue +4 -0
  65. package/src/helper/duration.ts +7 -36
  66. package/src/i18n.ts +1 -1
  67. package/src/locale/it.ts +0 -1
  68. package/src/main.ts +3 -10
  69. package/src/store/class/adserver/adserverConfig.ts +1 -1
  70. package/src/store/class/general/emission.ts +1 -1
  71. package/src/store/class/general/organisation.ts +1 -1
  72. package/src/store/class/general/podcast.ts +1 -1
  73. package/src/store/paramStore.ts +15 -13
@@ -12,7 +12,7 @@
12
12
  :just-size-chosen="justSizeChosen"
13
13
  >
14
14
  <template #list>
15
- <ul
15
+ <div
16
16
  class="podcast-list"
17
17
  >
18
18
  <template
@@ -24,7 +24,7 @@
24
24
  :podcast="p"
25
25
  />
26
26
  </template>
27
- </ul>
27
+ </div>
28
28
  </template>
29
29
  </ListPaginate>
30
30
  </template>
@@ -77,8 +77,8 @@ export default defineComponent({
77
77
  data() {
78
78
  return {
79
79
  loading: true as boolean,
80
- dfirst: this.first as number,
81
- dsize: this.size as number,
80
+ dfirst: this.first,
81
+ dsize: this.size,
82
82
  totalCount: 0 as number,
83
83
  podcasts: [] as Array<Podcast>,
84
84
  isMobile: false as boolean,
@@ -102,7 +102,7 @@ export default defineComponent({
102
102
  return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}|${this.query}`;
103
103
  },
104
104
  sizeItem(): number {
105
- return state.generalParameters.podcastItem ? (state.generalParameters.podcastItem as number): 13;
105
+ return state.generalParameters.podcastItem ? state.generalParameters.podcastItem: 13;
106
106
  },
107
107
  },
108
108
  watch: {
@@ -102,7 +102,7 @@ export default defineComponent({
102
102
  data() {
103
103
  return {
104
104
  rubriques: [] as Array<Rubrique>,
105
- rubrique: getDefaultRubrique(this.defaultanswer) as Rubrique|undefined,
105
+ rubrique: getDefaultRubrique(this.defaultanswer),
106
106
  rubriqueForArray: [] as Array<Rubrique>,
107
107
  isLoading: false as boolean,
108
108
  withoutItem: { name: this.$t('Without rubric'), rubriqueId: -1 } as {name: string, rubriqueId:number},
@@ -37,7 +37,7 @@
37
37
  aria-expanded="false"
38
38
  :title="$t('See more')"
39
39
  />
40
- <ul class="dropdown-menu dropdown-menu-right px-4">
40
+ <div class="dropdown-menu dropdown-menu-right px-4">
41
41
  <div
42
42
  v-for="rubrique in hidenRubriques"
43
43
  :key="rubrique.rubriqueId"
@@ -46,7 +46,7 @@
46
46
  >
47
47
  {{ rubrique.name }}
48
48
  </div>
49
- </ul>
49
+ </div>
50
50
  </div>
51
51
  </div>
52
52
  </template>
@@ -128,7 +128,7 @@ export default defineComponent({
128
128
  proceedReading: true as boolean,
129
129
  episodeNumbers: 'number' as string,
130
130
  iFrameNumberPriv: '3' as string,
131
- isVisibleTemp: this.isVisible as boolean,
131
+ isVisibleTemp: this.isVisible,
132
132
  displayArticle: true as boolean,
133
133
  displayTranscript:true as boolean,
134
134
  };
@@ -35,7 +35,6 @@ import octopusApi from '@saooti/octopus-api';
35
35
  import Snackbar from '../../misc/Snackbar.vue';
36
36
  import QrcodeVue from 'qrcode.vue'
37
37
  import { defineComponent } from 'vue'
38
- import SnackbarVue from '../../misc/Snackbar.vue';
39
38
  export default defineComponent({
40
39
  name: 'QrCode',
41
40
 
@@ -72,7 +71,7 @@ export default defineComponent({
72
71
  if(canvas && canvas.length > 0 && canvas[0]){
73
72
  link.href = (canvas[0] as HTMLCanvasElement).toDataURL();
74
73
  link.click();
75
- (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Download started'));
74
+ (this.$refs.snackbar as InstanceType<typeof Snackbar>).open(this.$t('Download started'));
76
75
  }
77
76
  },
78
77
  async initColor(): Promise<void> {
@@ -99,7 +99,6 @@ import { state } from '../../../store/paramStore';
99
99
  import Snackbar from '../../misc/Snackbar.vue';
100
100
  import { displayMethods } from '../../mixins/functions';
101
101
  import { defineComponent, defineAsyncComponent } from 'vue';
102
- import SnackbarVue from '../../misc/Snackbar.vue';
103
102
  import { Playlist } from '@/store/class/general/playlist';
104
103
  const ClipboardModal = defineAsyncComponent(() => import('../../misc/modal/ClipboardModal.vue'));
105
104
  const NewsletterModal = defineAsyncComponent(() => import('../../misc/modal/NewsletterModal.vue'));
@@ -201,7 +200,7 @@ export default defineComponent({
201
200
  this.dataRSSSave = !this.dataRSSSave;
202
201
  },
203
202
  afterCopy(): void{
204
- (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Link in clipboard'));
203
+ (this.$refs.snackbar as InstanceType<typeof Snackbar>).open(this.$t('Link in clipboard'));
205
204
  },
206
205
  onDownload(urlToDownload: string, nameOfDownload: string): void{
207
206
  const xhr = new XMLHttpRequest();
@@ -47,7 +47,6 @@ import { displayMethods } from '../../mixins/functions';
47
47
  import { Emission } from '@/store/class/general/emission';
48
48
 
49
49
  import { defineComponent, defineAsyncComponent } from 'vue';
50
- import SnackbarVue from '../../misc/Snackbar.vue';
51
50
  const RssSection = defineAsyncComponent(() => import('@/components/display/aggregator/RssSection.vue'));
52
51
  export default defineComponent({
53
52
  components: {
@@ -99,7 +98,7 @@ export default defineComponent({
99
98
  this.rss = `${state.octopusApi.url}rss/emission/${this.emissionId}.rss`;
100
99
  },
101
100
  afterCopy(): void{
102
- (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Link in clipboard'));
101
+ (this.$refs.snackbar as InstanceType<typeof Snackbar>).open(this.$t('Link in clipboard'));
103
102
  }
104
103
  },
105
104
  })
@@ -15,8 +15,6 @@
15
15
  id="miniplayerIframe"
16
16
  title="miniplayer"
17
17
  :src="iFrameSrc"
18
- scrolling="no"
19
- frameborder="0"
20
18
  width="100%"
21
19
  :height="iFrameHeight"
22
20
  class="max-iframe my-2"
@@ -45,8 +43,8 @@
45
43
  :is-visible="isVisible"
46
44
  :chose-number-episode="displayChoiceAllEpisodes|| isLargeSuggestion"
47
45
  :display-choice-all-episodes="displayChoiceAllEpisodes"
48
- :displayTranscriptParam="displayTranscriptParam"
49
- :displayArticleParam="displayArticleParam"
46
+ :display-transcript-param="displayTranscriptParam"
47
+ :display-article-param="displayArticleParam"
50
48
  @displayArticle="displayArticle = $event"
51
49
  @displayTranscript="displayTranscript = $event"
52
50
  @episodeNumbers="episodeNumbers = $event"
@@ -177,23 +175,13 @@ export default defineComponent({
177
175
  'NO' === this.podcast?.emission.monetisable);
178
176
  },
179
177
  iFrameSrc(): string {
180
- const url = [''];
178
+ let url = [''];
181
179
  let iFrameNumber = this.displayChoiceAllEpisodes && 'all' === this.episodeNumbers ? '/0' : '/' + this.iFrameNumber;
182
180
  url.push(`${this.baseUrl}miniplayer/`);
183
181
  if (!this.podcast && !this.playlist && this.emission) {
184
- switch (this.iFrameModel) {
185
- case 'default': url.push('emission'); break;
186
- case 'large': url.push('emissionLarge'); break;
187
- default: url.push(`${this.iFrameModel}`);break;
188
- }
189
- url.push(`/${this.emission.emissionId}${iFrameNumber}`);
182
+ url = this.constructEmissionUrl(url);
190
183
  } else if (this.playlist) {
191
- switch (this.iFrameModel) {
192
- case 'default': url.push('playlist'); break;
193
- case 'large': url.push('playlistLarge'); break;
194
- default: url.push(`${this.iFrameModel}`);break;
195
- }
196
- url.push(`/${this.playlist.playlistId}`);
184
+ url = this.constructPlaylistUrl(url);
197
185
  } else if(this.emission && this.podcast){
198
186
  url.push(`${this.iFrameModel}/`);
199
187
  if (this.isEmission || this.isLargeEmission) {
@@ -204,21 +192,7 @@ export default defineComponent({
204
192
  url.push(`${this.podcast.podcastId}`);
205
193
  }
206
194
  }
207
- url.push('?distributorId=' + this.organisationId);
208
- url.push(`&color=${this.color.substring(1)}&theme=${this.theme.substring(1)}`);
209
- if (!this.proceedReading) {
210
- url.push('&proceed=false');
211
- }
212
- if(!this.displayArticle){
213
- url.push('&article=false');
214
- }
215
- if(!this.displayTranscript){
216
- url.push('&transcript=false');
217
- }
218
- if (this.isVisible) {
219
- url.push('&key=' + window.btoa(this.dataTitle.toString()));
220
- }
221
- return url.join('');
195
+ return this.addUrlParameters(url).join('');
222
196
  },
223
197
  iFrameHeight(): string {
224
198
  switch (this.iFrameModel) {
@@ -278,12 +252,52 @@ export default defineComponent({
278
252
  },
279
253
  async created() {
280
254
  await this.fetchOrgaAttributes();
281
- await this.initColor();
255
+ this.initColor();
282
256
  if (this.isLiveReadyToRecord) {
283
257
  this.iFrameModel = 'large';
284
258
  }
285
259
  },
286
260
  methods: {
261
+ getIframeNumber(): string{
262
+ return this.displayChoiceAllEpisodes && 'all' === this.episodeNumbers ? '/0' : '/' + this.iFrameNumber;
263
+ },
264
+ constructEmissionUrl(url: Array<string>){
265
+ if(!this.emission){return [];}
266
+ switch (this.iFrameModel) {
267
+ case 'default': url.push('emission'); break;
268
+ case 'large': url.push('emissionLarge'); break;
269
+ default: url.push(`${this.iFrameModel}`);break;
270
+ }
271
+ url.push(`/${this.emission.emissionId}${this.getIframeNumber()}`);
272
+ return url;
273
+ },
274
+ constructPlaylistUrl(url: Array<string>){
275
+ if(!this.playlist){return [];}
276
+ switch (this.iFrameModel) {
277
+ case 'default': url.push('playlist'); break;
278
+ case 'large': url.push('playlistLarge'); break;
279
+ default: url.push(`${this.iFrameModel}`);break;
280
+ }
281
+ url.push(`/${this.playlist.playlistId}`);
282
+ return url;
283
+ },
284
+ addUrlParameters(url: Array<string>){
285
+ url.push('?distributorId=' + this.organisationId);
286
+ url.push(`&color=${this.color.substring(1)}&theme=${this.theme.substring(1)}`);
287
+ if (!this.proceedReading) {
288
+ url.push('&proceed=false');
289
+ }
290
+ if(!this.displayArticle){
291
+ url.push('&article=false');
292
+ }
293
+ if(!this.displayTranscript){
294
+ url.push('&transcript=false');
295
+ }
296
+ if (this.isVisible) {
297
+ url.push('&key=' + window.btoa(this.dataTitle.toString()));
298
+ }
299
+ return url;
300
+ },
287
301
  async fetchOrgaAttributes(): Promise<void>{
288
302
  if(this.$store.state.organisation?.attributes && Object.keys(this.$store.state.organisation.attributes).length > 1){
289
303
  this.orgaAttributes = this.$store.state.organisation.attributes;
@@ -104,7 +104,7 @@ export default defineComponent({
104
104
  let playerTrySelect = true;
105
105
  playerTrySelect = await this.fetchCustomPlayers('EPISODE', playerTrySelect);
106
106
  playerTrySelect = await this.fetchCustomPlayers('EMISSION', playerTrySelect);
107
- playerTrySelect = await this.fetchCustomPlayers('SUGGESTION', playerTrySelect);
107
+ await this.fetchCustomPlayers('SUGGESTION', playerTrySelect);
108
108
  }
109
109
  },
110
110
  }
@@ -25,7 +25,6 @@
25
25
  </template>
26
26
  <script lang="ts">
27
27
  import { defineComponent } from 'vue';
28
- import { displayMethods } from '../mixins/functions';
29
28
  export default defineComponent({
30
29
  name: 'ClassicSelect',
31
30
  props: {
@@ -114,7 +114,7 @@ export default defineComponent({
114
114
  },
115
115
  data() {
116
116
  return {
117
- language: this.$i18n.locale as string,
117
+ language: this.$i18n.locale,
118
118
  };
119
119
  },
120
120
  computed: {
@@ -110,7 +110,6 @@ import { Participant } from '@/store/class/general/participant';
110
110
  import { Podcast } from '@/store/class/general/podcast';
111
111
  import { state } from '../../../store/paramStore';
112
112
  import { defineComponent } from 'vue'
113
- import SnackbarVue from '../../misc/Snackbar.vue';
114
113
  import octopusApi from '@saooti/octopus-api';
115
114
  import { Emission } from '@/store/class/general/emission';
116
115
  import { Playlist } from '@/store/class/general/playlist';
@@ -138,7 +137,7 @@ export default defineComponent({
138
137
  displayParticipantsNames: true as boolean,
139
138
  displayEmissionName: true as boolean,
140
139
  color: '#40a372' as string,
141
- shareUrl: window.location.href as string,
140
+ shareUrl: window.location.href,
142
141
 
143
142
  };
144
143
  },
@@ -299,7 +298,7 @@ export default defineComponent({
299
298
  }
300
299
  },
301
300
  afterCopy(): void{
302
- (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Data in clipboard'));
301
+ (this.$refs.snackbar as InstanceType<typeof Snackbar>).open(this.$t('Data in clipboard'));
303
302
  },
304
303
  async initData(): Promise<void> {
305
304
  let attributes;
@@ -99,7 +99,6 @@ import { displayMethods } from '../../mixins/functions';
99
99
  import QrCode from '../../display/sharing/QrCode.vue';
100
100
  import { defineComponent } from 'vue'
101
101
  import { Podcast } from '@/store/class/general/podcast';
102
- import SnackbarVue from '../Snackbar.vue';
103
102
  export default defineComponent({
104
103
  name: 'ShareModalPlayer',
105
104
 
@@ -136,7 +135,7 @@ export default defineComponent({
136
135
  this.$emit('close');
137
136
  },
138
137
  afterCopy(): void{
139
- (this.$refs.snackbar as InstanceType<typeof SnackbarVue>).open(this.$t('Data in clipboard'));
138
+ (this.$refs.snackbar as InstanceType<typeof Snackbar>).open(this.$t('Data in clipboard'));
140
139
  }
141
140
  },
142
141
  })
@@ -146,7 +146,7 @@ export default defineComponent({
146
146
  align-items: center;
147
147
  justify-content: center;
148
148
  margin: 0 0.5rem;
149
- border-radius: 50%;
149
+ border-radius: 50% !important;
150
150
  font-size: 0.7rem !important;
151
151
  flex-shrink: 0;
152
152
  cursor: pointer;
@@ -158,7 +158,7 @@ export default defineComponent({
158
158
  align-items: center;
159
159
  justify-content: center;
160
160
  margin: 0 0.5rem;
161
- border-radius: 50%;
161
+ border-radius: 50% !important;
162
162
  font-size: 2.5rem !important;
163
163
  flex-shrink: 0;
164
164
  cursor: pointer;
@@ -32,8 +32,8 @@ export const cookies =
32
32
  getCookie(name: string): string|null {
33
33
  const nameEQ = name + '=';
34
34
  const ca = document.cookie.split(';');
35
- for (let i = 0; i < ca.length; i++) {
36
- let c = ca[i];
35
+ for (let cookieValue of ca) {
36
+ let c = cookieValue;
37
37
  while (c.charAt(0) == ' ') c = c.substring(1, c.length);
38
38
  if (0 === c.indexOf(nameEQ))
39
39
  return c.substring(nameEQ.length, c.length);
@@ -53,18 +53,7 @@ export const displayMethods ={
53
53
  });
54
54
  },
55
55
  async onCopyCode(link: string, callback: () => void): Promise<void> {
56
- if ('undefined' !== typeof navigator.clipboard) {
57
- await navigator.clipboard.writeText(link);
58
- return callback();
59
- }
60
- const textArea = document.createElement('textarea');
61
- textArea.value = link;
62
- textArea.style.position = 'fixed';
63
- document.body.appendChild(textArea);
64
- textArea.focus();
65
- textArea.select();
66
- document.execCommand('copy');
67
- document.body.removeChild(textArea);
56
+ await navigator.clipboard.writeText(link);
68
57
  return callback();
69
58
  },
70
59
  },
@@ -39,25 +39,7 @@ export const playerComment = defineComponent({
39
39
  return true;
40
40
  return false;
41
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;
42
+ initCommentCurrentPodcast(podcastId?: number): Array<number>{
61
43
  if (
62
44
  podcastId &&
63
45
  this.$store.state.comments.actualPodcastId === podcastId
@@ -67,16 +49,13 @@ export const playerComment = defineComponent({
67
49
  this.commentsLoaded &&
68
50
  this.commentsLoaded.length < this.$store.state.comments.totalCount
69
51
  ) {
70
- first = this.commentsLoaded.length;
71
- count = this.$store.state.comments.totalCount;
52
+ return [this.commentsLoaded.length, this.$store.state.comments.totalCount];
72
53
  }
73
54
  }
74
- if (
75
- (!podcastId ||
76
- this.$store.state.comments.actualPodcastId === podcastId) &&
77
- 0 === first
78
- )
79
- return;
55
+ return [0, 0];
56
+ },
57
+ async fetchComments(first: number, count:number,podcastId?:number,organisation?:string){
58
+ const size = 50;
80
59
  while (0 === first || this.comments.length < count) {
81
60
  const param: FetchParam = {
82
61
  first: first,
@@ -94,5 +73,33 @@ export const playerComment = defineComponent({
94
73
  });
95
74
  }
96
75
  },
76
+ async initComments(refresh = false): Promise<void> {
77
+ let podcastId, organisation;
78
+ if (this.podcast) {
79
+ podcastId = this.podcast.podcastId;
80
+ organisation = this.podcast.organisation.id;
81
+ } else if (this.live) {
82
+ podcastId = this.live.livePodcastId;
83
+ organisation = this.live.organisation.id;
84
+ }
85
+ if (
86
+ refresh &&
87
+ podcastId &&
88
+ this.$store.state.comments.actualPodcastId !== podcastId
89
+ ) {
90
+ return;
91
+ }
92
+ const param= this.initCommentCurrentPodcast(podcastId);
93
+ let first = param[0];
94
+ let count = param[1];
95
+ if (
96
+ (!podcastId ||
97
+ this.$store.state.comments.actualPodcastId === podcastId) &&
98
+ 0 === first
99
+ ){
100
+ return;
101
+ }
102
+ await this.fetchComments(first, count, podcastId, organisation);
103
+ },
97
104
  },
98
105
  })
@@ -44,7 +44,7 @@ export const playerLive = defineComponent({
44
44
  if (this.audioElement.canPlayType('application/vnd.apple.mpegurl')) {
45
45
  this.audioElement.src = hlsStreamUrl;
46
46
  await this.initLiveDownloadId();
47
- await (this.audioElement as HTMLAudioElement).play();
47
+ await this.audioElement.play();
48
48
  this.onPlay();
49
49
  }else{
50
50
  await this.initHls(hlsStreamUrl);
@@ -74,7 +74,6 @@ export const playerLive = defineComponent({
74
74
  async initHls(hlsStreamUrl: string): Promise<void> {
75
75
  return new Promise<void>(async(resolve, reject) => {
76
76
  if(null === Hls){
77
- //TODO -> Version light min quand ce sera possible
78
77
  await import('hls.js/dist/hls.js').then((hlsLibrary) => {
79
78
  Hls = hlsLibrary.default;
80
79
  })
@@ -86,14 +85,6 @@ export const playerLive = defineComponent({
86
85
  reject('Hls is not supported ! ');
87
86
  }
88
87
  const hls = new Hls();
89
- /* if(this.$store.state.authentication.isAuthenticated && this.$store.state.oAuthParam.accessToken){
90
- hls = new Hls({xhrSetup:
91
- (xhr: XMLHttpRequest) => {
92
- xhr.setRequestHeader("Authorization", "Bearer " + this.$store.state.oAuthParam.accessToken);
93
- }
94
- }
95
- );
96
- } */
97
88
  hls.on(Hls.Events.MANIFEST_PARSED, async () => {
98
89
  await this.initLiveDownloadId();
99
90
  hls.attachMedia((this.audioElement as HTMLAudioElement));
@@ -172,24 +172,7 @@ export const playerLogic = defineComponent({
172
172
  this.playerError = true;
173
173
  }
174
174
  },
175
- onTimeUpdate(event: Event): void {
176
- const mediaTarget = (event.currentTarget as HTMLMediaElement);
177
- if (this.podcast || this.live) {
178
- if (!this.downloadId) {
179
- return;
180
- }
181
- if (
182
- this.live &&
183
- 0 === this.listenTime &&
184
- 0 !== mediaTarget.currentTime
185
- ) {
186
- this.notListenTime = mediaTarget.currentTime;
187
- this.listenTime = 1;
188
- } else {
189
- this.listenTime =
190
- mediaTarget.currentTime - this.notListenTime;
191
- }
192
- }
175
+ streamDurationForSafari(mediaTarget:HTMLMediaElement){
193
176
  let streamDuration = mediaTarget.duration;
194
177
  if(Infinity===streamDuration){
195
178
  const seekable = mediaTarget.seekable;
@@ -199,15 +182,16 @@ export const playerLogic = defineComponent({
199
182
  streamDuration = mediaTarget.currentTime;
200
183
  }
201
184
  }
202
- if (!streamDuration) return;
203
- if (!mediaTarget.currentTime) return;
204
- if (!this.live) {
205
- this.displayAlertBar = false;
206
- this.percentLiveProgress = 100;
207
- this.$store.commit('playerTotalTime', streamDuration);
208
- this.$store.commit('playerElapsed', mediaTarget.currentTime / streamDuration);
209
- return;
210
- }
185
+ return streamDuration;
186
+ },
187
+ onTimeUpdatePodcast(streamDuration:number, currentTime:number){
188
+ this.displayAlertBar = false;
189
+ this.percentLiveProgress = 100;
190
+ this.$store.commit('playerTotalTime', streamDuration);
191
+ this.$store.commit('playerElapsed', currentTime / streamDuration);
192
+ },
193
+ onTimeUpdateLive(streamDuration: number, currentTime:number){
194
+ if(!this.live){return;}
211
195
  const scheduledDuration = this.live.duration / 1000;
212
196
  if (scheduledDuration > streamDuration) {
213
197
  this.displayAlertBar = false;
@@ -215,15 +199,42 @@ export const playerLogic = defineComponent({
215
199
  this.$store.commit('playerTotalTime', scheduledDuration);
216
200
  this.$store.commit(
217
201
  'playerElapsed',
218
- mediaTarget.currentTime / scheduledDuration
202
+ currentTime / scheduledDuration
219
203
  );
220
204
  } else {
221
205
  this.percentLiveProgress = 100;
222
206
  this.displayAlertBar = true;
223
207
  this.durationLivePosition = (scheduledDuration / streamDuration) * 100;
224
208
  this.$store.commit('playerTotalTime', streamDuration);
225
- this.$store.commit('playerElapsed', mediaTarget.currentTime / streamDuration);
209
+ this.$store.commit('playerElapsed', currentTime / streamDuration);
210
+ }
211
+ },
212
+ onTimeUpdate(event: Event): void {
213
+ const mediaTarget = (event.currentTarget as HTMLMediaElement);
214
+ if (this.podcast || this.live) {
215
+ if (!this.downloadId) {
216
+ return;
217
+ }
218
+ if (
219
+ this.live &&
220
+ 0 === this.listenTime &&
221
+ 0 !== mediaTarget.currentTime
222
+ ) {
223
+ this.notListenTime = mediaTarget.currentTime;
224
+ this.listenTime = 1;
225
+ } else {
226
+ this.listenTime =
227
+ mediaTarget.currentTime - this.notListenTime;
228
+ }
229
+ }
230
+ let streamDuration = this.streamDurationForSafari(mediaTarget);
231
+ if (!streamDuration) return;
232
+ if (!mediaTarget.currentTime) return;
233
+ if (!this.live) {
234
+ this.onTimeUpdatePodcast(streamDuration,mediaTarget.currentTime);
235
+ return;
226
236
  }
237
+ this.onTimeUpdateLive(streamDuration,mediaTarget.currentTime);
227
238
  },
228
239
  onFinished(): void {
229
240
  this.setDownloadId(null);
@@ -71,6 +71,10 @@
71
71
  :title="$t('More episodes of this emission')"
72
72
  :button-text="$t('All podcast emission button')"
73
73
  />
74
+ <PodcastInlineList
75
+ :podcastId="podcastId"
76
+ title="Les recommendations de Vincent !"
77
+ />
74
78
  <PodcastInlineList
75
79
  v-for="c in categories"
76
80
  :key="c.id"
@@ -1,43 +1,14 @@
1
1
  export default {
2
+ formatToString(value: number){
3
+ if (value < 10) {
4
+ return '0' + value;
5
+ }
6
+ return value.toString();
7
+ },
2
8
  formatDuration(totalSeconds: number): string {
3
9
  const hours = Math.floor(totalSeconds / 3600);
4
10
  const minutes = Math.floor((totalSeconds - hours * 3600) / 60);
5
11
  const seconds = totalSeconds - hours * 3600 - minutes * 60;
6
- let hoursString = "";
7
- let minutesString = "";
8
- let secondsString = "";
9
-
10
- if (hours > 0) {
11
- if (hours < 10) {
12
- hoursString = '0' + hours;
13
- }else{
14
- hoursString = hours.toString();
15
- }
16
- if (minutes < 10) {
17
- minutesString = '0' + minutes;
18
- }else{
19
- minutesString = minutes.toString();
20
- }
21
- if (seconds < 10) {
22
- secondsString = '0' + seconds;
23
- }else{
24
- secondsString = seconds.toString();
25
- }
26
-
27
- return hoursString + "'" + minutesString + "'" + secondsString + "'";
28
- } else {
29
- if (minutes < 10) {
30
- minutesString = '0' + minutes;
31
- }else{
32
- minutesString = minutes.toString();
33
- }
34
- if (seconds < 10) {
35
- secondsString = '0' + seconds;
36
- }else{
37
- secondsString = seconds.toString();
38
- }
39
-
40
- return minutesString + "'" + secondsString + "'";
41
- }
12
+ return (hours > 0? this.formatToString(hours)+"'":"") + this.formatToString(minutes) +"'"+ this.formatToString(seconds)+"'";
42
13
  },
43
14
  };
package/src/i18n.ts CHANGED
@@ -8,7 +8,7 @@ import 'moment/dist/locale/fr.js';
8
8
  import 'moment/dist/locale/it.js';
9
9
  import 'moment/dist/locale/sl.js';
10
10
 
11
- export function setupI18n(options = { locale: 'en' }, isEducation: boolean) {
11
+ export function setupI18n(options: { locale: string }, isEducation: boolean) {
12
12
  const i18n = createI18n(options)
13
13
  loadLocaleMessages(i18n.global, options.locale, isEducation);
14
14
  return i18n;