@saooti/octopus-sdk 31.0.20 → 31.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -596,3 +596,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
596
596
  * 31.0.18 Bug #11015
597
597
  * 31.0.19 Add access_token player
598
598
  * 31.0.20 Player mobile
599
+ * 31.0.21 Player mobile
600
+ * 31.0.22 Merge 30
601
+ * 31.0.23 Qr Code option noir
package/index.ts CHANGED
@@ -15,7 +15,7 @@ import Rubrique from "./src/components/pages/Rubrique.vue";
15
15
  //Misc
16
16
  import Footer from "./src/components/misc/Footer.vue";
17
17
  import LeftMenu from "./src/components/misc/LeftMenu.vue";
18
- import Player from "./src/components/misc/Player.vue";
18
+ import Player from "./src/components/misc/player/Player.vue";
19
19
  import Snackbar from "./src/components/misc/Snackbar.vue";
20
20
  import TopBar from "./src/components/misc/TopBar.vue";
21
21
  import HomeDropdown from "./src/components/misc/HomeDropdown.vue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "31.0.20",
3
+ "version": "31.0.23",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "main": "./dist/octopus.common.js",
16
16
  "dependencies": {
17
- "@saooti/octopus-api": "^0.31.2",
17
+ "@saooti/octopus-api": "^0.31.3",
18
18
  "@vue/cli": "^5.0.4",
19
19
  "@vue/compat": "^3.2.31",
20
20
  "axios": "^0.24.0",
@@ -8,6 +8,13 @@
8
8
  class="myQrCode"
9
9
  :margin="2"
10
10
  />
11
+ <ClassicCheckbox
12
+ v-if="'#000000'!==otherColor"
13
+ v-model:textInit="isNotBlack"
14
+ class="flex-shrink-0"
15
+ id-checkbox="is-black-qr-code"
16
+ :label="$t('Use organization color')"
17
+ />
11
18
  <button
12
19
  class="btn m-3"
13
20
  @click="download"
@@ -22,6 +29,7 @@
22
29
  </template>
23
30
 
24
31
  <script lang="ts">
32
+ import ClassicCheckbox from '../../form/ClassicCheckbox.vue';
25
33
  import { state } from '../../../store/paramStore';
26
34
  import octopusApi from '@saooti/octopus-api';
27
35
  import Snackbar from '../../misc/Snackbar.vue';
@@ -33,7 +41,8 @@ export default defineComponent({
33
41
 
34
42
  components: {
35
43
  Snackbar,
36
- QrcodeVue
44
+ QrcodeVue,
45
+ ClassicCheckbox
37
46
  },
38
47
  props: {
39
48
  url: { default: '', type: String},
@@ -42,7 +51,9 @@ export default defineComponent({
42
51
  data() {
43
52
  return {
44
53
  size: 200 as number,
45
- color: "#40a372" as string
54
+ color: "#000000" as string,
55
+ otherColor:"#000000" as string,
56
+ isNotBlack: false as boolean,
46
57
  };
47
58
  },
48
59
  computed:{
@@ -50,6 +61,15 @@ export default defineComponent({
50
61
  return (state.generalParameters.authenticated as boolean);
51
62
  },
52
63
  },
64
+ watch:{
65
+ isNotBlack(){
66
+ if(this.isNotBlack){
67
+ this.color = this.otherColor;
68
+ }else{
69
+ this.color = "#000000";
70
+ }
71
+ }
72
+ },
53
73
  created(){
54
74
  this.initColor();
55
75
  },
@@ -66,7 +86,7 @@ export default defineComponent({
66
86
  },
67
87
  async initColor(): Promise<void> {
68
88
  if(state.generalParameters.podcastmaker && state.generalParameters.podcastmakerColor){
69
- this.color = state.generalParameters.podcastmakerColor;
89
+ this.otherColor = state.generalParameters.podcastmakerColor;
70
90
  return;
71
91
  }
72
92
  if (!this.authenticated) return;
@@ -79,7 +99,7 @@ export default defineComponent({
79
99
  );
80
100
  }
81
101
  if (Object.prototype.hasOwnProperty.call(data,'COLOR')) {
82
- this.color = data.COLOR;
102
+ this.otherColor = data.COLOR;
83
103
  }
84
104
  },
85
105
  }
@@ -11,7 +11,7 @@
11
11
  <template v-if="display">
12
12
  <audio
13
13
  id="audio-player"
14
- :src="!live? audioUrl: undefined"
14
+ :src="!live? audioUrlToPlay: undefined"
15
15
  autoplay
16
16
  @timeupdate="onTimeUpdate"
17
17
  @ended="onFinished"
@@ -82,6 +82,7 @@ export default defineComponent({
82
82
  comments: [] as Array<CommentPodcast>,
83
83
  showTimeline: false as boolean,
84
84
  largeVersion: false as boolean,
85
+ audioUrlToPlay: "" as string
85
86
  };
86
87
  },
87
88
  computed: {
@@ -1,6 +1,6 @@
1
1
  import { Podcast } from '@/store/class/general/podcast';
2
2
  import DurationHelper from '../../../helper/duration';
3
- import { state } from '@/store/paramStore';
3
+ import { state } from '../../../store/paramStore';
4
4
  import { defineComponent } from 'vue';
5
5
  import { RouteLocationRaw } from 'vue-router';
6
6
  export const playerDisplay = defineComponent({
@@ -100,11 +100,15 @@ export const playerLive = defineComponent({
100
100
  },
101
101
  async endListeningProgress(): Promise<void> {
102
102
  if (!this.downloadId) return;
103
- await octopusApi.updatePlayerTime(
104
- this.downloadId,
105
- Math.round(this.listenTime)
106
- );
107
- this.setDownloadId(null);
103
+ try {
104
+ await octopusApi.updatePlayerTime(
105
+ this.downloadId,
106
+ Math.round(this.listenTime)
107
+ );
108
+ } catch{
109
+ //Do nothing
110
+ }
111
+ this.downloadId = null;
108
112
  this.notListenTime = 0;
109
113
  this.lastSend = 0;
110
114
  this.listenTime = 0;
@@ -23,6 +23,7 @@ export const playerLogic = defineComponent({
23
23
  hlsReady: false as boolean,
24
24
  comments: [] as Array<CommentPodcast>,
25
25
  showTimeline: false as boolean,
26
+ audioUrlToPlay: "" as string
26
27
  };
27
28
  },
28
29
  computed: {
@@ -44,8 +45,15 @@ export const playerLogic = defineComponent({
44
45
  },
45
46
 
46
47
  watch: {
47
- audioUrl(): void{
48
+ async audioUrl(): Promise<void>{
48
49
  this.playerError = false;
50
+ if(this.media || !this.podcast || !this.podcast.availability.visibility ||this.listenError){
51
+ this.audioUrlToPlay = this.audioUrl;
52
+ }
53
+ if(!this.podcast){return;}
54
+ const response = await octopusApi.fetchPodcastDownloadUrl("podcast/download/register/"+this.podcast.podcastId+".mp3"+ this.audioUrl);
55
+ this.setDownloadId(response.downloadId.toString());
56
+ this.audioUrlToPlay = response.location;
49
57
  },
50
58
  podcast: {
51
59
  deep: true,
@@ -88,6 +96,14 @@ export const playerLogic = defineComponent({
88
96
  },
89
97
 
90
98
  methods: {
99
+ getDomain(): string{
100
+ let domain = "";
101
+ const domainArray: RegExpExecArray | null = /\.(.+)/.exec(window.location.host);
102
+ if(domainArray && null !== domainArray){
103
+ domain = domainArray[1];
104
+ }
105
+ return domain;
106
+ },
91
107
  getAudioUrl(): string{
92
108
  if (this.media) return this.media.audioUrl? this.media.audioUrl:"";
93
109
  if (!this.podcast) return '';
@@ -96,7 +112,6 @@ export const playerLogic = defineComponent({
96
112
  if (this.listenError) return this.podcast.audioStorageUrl;
97
113
  const parameters = [];
98
114
  parameters.push('origin=octopus');
99
- parameters.push('cookieName=player_' + this.podcast.podcastId);
100
115
  parameters.push('listenerId='+this.getListenerId());
101
116
  if (
102
117
  this.$store.state.authentication &&
@@ -109,7 +124,7 @@ export const playerLogic = defineComponent({
109
124
  if("SECURED" === this.podcast.organisation.privacy && this.$store.state.authentication.isAuthenticated && this.$store.state.oAuthParam.accessToken){
110
125
  parameters.push('access_token='+this.$store.state.oAuthParam.accessToken);
111
126
  }
112
- return this.podcast.audioUrl + '?' + parameters.join('&');
127
+ return this.podcast.podcastId + '.mp3?' + parameters.join('&');
113
128
  },
114
129
  reInitPlayer():void{
115
130
  this.setDownloadId(null);
@@ -123,12 +138,7 @@ export const playerLogic = defineComponent({
123
138
  let listenerId = this.getCookie("octopus_listenerId");
124
139
  if(!listenerId){
125
140
  listenerId = new Date().valueOf().toString() + Math.random();
126
- let domain = "";
127
- const domainArray: RegExpExecArray | null = /\.(.+)/.exec(window.location.host);
128
- if(domainArray && null !== domainArray){
129
- domain = domainArray[1];
130
- }
131
- this.setCookie("octopus_listenerId", listenerId, ';domain='+domain);
141
+ this.setCookie("octopus_listenerId", listenerId, ';domain='+this.getDomain());
132
142
  }
133
143
  return listenerId;
134
144
  },
@@ -153,9 +163,9 @@ export const playerLogic = defineComponent({
153
163
  );
154
164
  },
155
165
  onError(): void {
156
- if (this.podcast && !this.listenError) {
166
+ if (this.podcast && ""!==this.audioUrlToPlay && !this.listenError) {
157
167
  this.listenError = true;
158
- } else if (this.podcast || this.media) {
168
+ } else if ((this.podcast && ""!==this.audioUrlToPlay ) || this.media) {
159
169
  this.playerError = true;
160
170
  }
161
171
  },
@@ -163,7 +173,7 @@ export const playerLogic = defineComponent({
163
173
  const mediaTarget = (event.currentTarget as HTMLMediaElement);
164
174
  if (this.podcast || this.live) {
165
175
  if (!this.downloadId) {
166
- this.loadDownloadId();
176
+ return;
167
177
  }
168
178
  if (
169
179
  this.live &&
@@ -214,21 +224,5 @@ export const playerLogic = defineComponent({
214
224
  }
215
225
  this.forceHide = true;
216
226
  },
217
- loadDownloadId(): void {
218
- if (!this.podcast) return;
219
- const matching_cookies = document.cookie
220
- .split(';')
221
- .map(item => {
222
- const _return = item.trim().split('=');
223
- return _return.map(item => item.trim());
224
- })
225
- .filter(item => {
226
- if(!this.podcast){return '';}
227
- return 'player_' + this.podcast.podcastId === item[0];
228
- });
229
- if (1 === matching_cookies.length) {
230
- this.setDownloadId(matching_cookies[0][1]);
231
- }
232
- },
233
227
  },
234
228
  })
package/src/locale/de.ts CHANGED
@@ -299,4 +299,5 @@ export default{
299
299
  'Podcast tags': "Podcast-Tags",
300
300
  "Enlarge":"Vergrößern",
301
301
  "Reduce":"Reduzieren",
302
+ "Use organization color":"Verwenden Sie die Organisationsfarbe",
302
303
  }
package/src/locale/en.ts CHANGED
@@ -300,4 +300,5 @@ export default{
300
300
  "You do not have the right to access this page":"You do not have the right to access this page",
301
301
  "Enlarge":"Enlarge",
302
302
  "Reduce":"Reduce",
303
+ "Use organization color":"Use organization color",
303
304
  };
package/src/locale/es.ts CHANGED
@@ -299,4 +299,5 @@ export default{
299
299
  'Podcast tags': 'Etiquetas de pódcast',
300
300
  "Enlarge":"Agrandar",
301
301
  "Reduce":"Reducir",
302
+ "Use organization color":"Usar el color de la organización",
302
303
  }
package/src/locale/fr.ts CHANGED
@@ -300,4 +300,5 @@ export default{
300
300
  "You do not have the right to access this page":"Vous n’avez pas le droit d’accéder à cette page",
301
301
  "Enlarge":"Agrandir",
302
302
  "Reduce":"Réduire",
303
+ "Use organization color":"Utiliser la couleur de l'organisation",
303
304
  };
package/src/locale/it.ts CHANGED
@@ -297,4 +297,5 @@ export default{
297
297
  'More episodes of this category : ': "Altri episodi su questo tema : {name}",
298
298
  "Enlarge":"Ingrandire",
299
299
  "Reduce":"Ridurre",
300
+ "Use organization color":"Usa il colore dell'organizzazione",
300
301
  };
package/src/locale/sl.ts CHANGED
@@ -299,4 +299,5 @@ export default{
299
299
  'Podcast tags': 'Oznake podkastov',
300
300
  "Enlarge":"Povečaj",
301
301
  "Reduce":"Zmanjšaj",
302
+ "Use organization color":"Uporabite barvo organizacije",
302
303
  }