@saooti/octopus-sdk 37.0.27 → 37.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "37.0.27",
3
+ "version": "37.0.29",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -4,6 +4,7 @@
4
4
  :time-picker="isTimePicker"
5
5
  :input-class-name="templateClass"
6
6
  :clearable="false"
7
+ :text-input="true"
7
8
  :readonly="readonly"
8
9
  :teleport="useTeleport"
9
10
  :locale="formatLocale"
@@ -17,6 +18,7 @@
17
18
  :inline="columnNumber > 1"
18
19
  :enable-time-picker="!isTimePicker ? displayTimePicker : undefined"
19
20
  :aria-labels="ariaLabels"
21
+ :max-time="maxTime"
20
22
  @update:model-value="$emit('updateDate', $event)"
21
23
  >
22
24
  </VueDatePicker>
@@ -47,6 +49,7 @@ export default defineComponent({
47
49
  useTeleport: { default: false, type: Boolean },
48
50
  templateClass: { default: undefined, type: String },
49
51
  readonly: { default: false, type: Boolean },
52
+ maxTime:{default: null, type: Object as () => { hours?: number | string; minutes?: number | string; seconds?: number | string }}
50
53
  },
51
54
 
52
55
  emits: ["updateDate", "update:date"],
@@ -1,25 +1,34 @@
1
1
  <template>
2
- <div :id="idModal" class="octopus-modal">
3
- <div class="octopus-modal-backdrop" />
4
- <div class="octopus-modal-dialog">
2
+ <div :id="idModal" class="octopus-modal" :class="onlyHeader? 'octopus-only-header-modal':''">
3
+ <div class="octopus-modal-backdrop"/>
4
+ <div class="octopus-modal-dialog" >
5
5
  <div class="octopus-modal-content">
6
6
  <div class="octopus-modal-header">
7
7
  <h5 cclass="octopus-modal-title">
8
8
  {{ titleModal }}
9
9
  </h5>
10
- <button
11
- v-if="closable"
12
- :ref="closable ? 'focusElement' : ''"
13
- type="button"
14
- class="btn-transparent text-light saooti-remove"
15
- title="Close"
16
- @click="$emit('close')"
17
- />
10
+ <div class="d-flex align-items-center">
11
+ <button
12
+ v-if="canBeReduced"
13
+ class="btn-transparent text-light"
14
+ :class="onlyHeader? 'saooti-down':'saooti-up'"
15
+ :title="onlyHeader? $t('Enlarge'):$t('Reduce')"
16
+ @click="onlyHeader = !onlyHeader"
17
+ />
18
+ <button
19
+ v-if="closable"
20
+ :ref="closable ? 'focusElement' : ''"
21
+ type="button"
22
+ class="btn-transparent text-light saooti-remove"
23
+ :title="$t('Close')"
24
+ @click="$emit('close')"
25
+ />
26
+ </div>
18
27
  </div>
19
- <div class="octopus-modal-body">
28
+ <div v-show="!onlyHeader" class="octopus-modal-body">
20
29
  <slot name="body" />
21
30
  </div>
22
- <div class="octopus-modal-footer">
31
+ <div v-show="!onlyHeader" class="octopus-modal-footer">
23
32
  <slot name="footer" />
24
33
  </div>
25
34
  </div>
@@ -35,8 +44,14 @@ export default defineComponent({
35
44
  idModal: { default: undefined, type: String },
36
45
  titleModal: { default: undefined, type: String },
37
46
  closable: { default: true, type: Boolean },
47
+ canBeReduced: { default: false, type: Boolean },
38
48
  },
39
49
  emits: ["close"],
50
+ data() {
51
+ return {
52
+ onlyHeader: false as boolean,
53
+ };
54
+ },
40
55
  mounted() {
41
56
  (this.$refs.focusElement as HTMLElement)?.focus();
42
57
  },
@@ -67,6 +82,9 @@ export default defineComponent({
67
82
  height: 100vh;
68
83
  background-color: black;
69
84
  }
85
+ .octopus-modal.octopus-only-header-modal .octopus-modal-backdrop {
86
+ opacity: 0.1;
87
+ }
70
88
 
71
89
  .octopus-modal-dialog {
72
90
  position: relative;
@@ -103,8 +121,8 @@ export default defineComponent({
103
121
  padding: 1rem;
104
122
  }
105
123
 
106
- .octopus-modal-dialog,
107
- .octopus-modal-content {
124
+ .octopus-modal:not(.octopus-only-header-modal) .octopus-modal-dialog,
125
+ .octopus-modal:not(.octopus-only-header-modal) .octopus-modal-content {
108
126
  min-height: 300px;
109
127
  }
110
128
  .octopus-modal-content {
@@ -274,14 +274,16 @@ export default defineComponent({
274
274
  ${this.emissionName}${this.description}`,
275
275
  ];
276
276
  html.push(
277
- `</table>
278
- <div style="font-family: Arial, sans-serif;font-size: 12px;line-height: 20px;background: #f3f3f3;vertical-align: middle;padding: 15px 10px;display: flex; align-items:center; flex-wrap:wrap">
279
- <a href="${this.shareUrl}">
280
- <img width="44" height="44" style="display: inline-block;vertical-align: middle" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA/wD/AP+gvaeTAAAAxElEQVRIie3WMWpCURBG4Q8FSRrtbC2SPhvICmzchVuwtXQLbsE2pVUIkjqQHVgqNmIj6EvxGHhFQAIvcxt/OPVhhrlzh3sKZ4MvTLLFVYNPvJYQB294LiGucMYSw2xxcMQcj9niYIsputni4BvjEuJgjZcS4goXrDDKFgcnLDDIFgd7zNDLFgfvTUHnL23ISJuV7iS3Ooarn1VxkeeUvkDSV2b6J3FQT+pDW8Jb4vRD4Kqe1Kf/Ev4mTj32PhQ6b+9pPT+XHgysHrPM6QAAAABJRU5ErkJggg=="/>
281
- </a>
282
- <a style="color: #000;text-decoration: none; margin-right:8px" href="${this.shareUrl}">${this.shareText}</a>
277
+ `</table>
278
+ <table width='100%' style="width:100%;background:#f3f3f3;font-family: Arial, sans-serif;font-size: 12px;line-height: 20px;">
279
+ <tr style="font-family: Arial, sans-serif;font-size: 12px;line-height: 20px;background: #f3f3f3;vertical-align: middle;padding: 15px 10px;display: flex; align-items:center; flex-wrap:wrap">
280
+ <td><a href="${this.shareUrl}">
281
+ <svg fill="#000000" height="30px" width="30px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17.804 17.804" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> <g id="c98_play"> <path d="M2.067,0.043C2.21-0.028,2.372-0.008,2.493,0.085l13.312,8.503c0.094,0.078,0.154,0.191,0.154,0.313 c0,0.12-0.061,0.237-0.154,0.314L2.492,17.717c-0.07,0.057-0.162,0.087-0.25,0.087l-0.176-0.04 c-0.136-0.065-0.222-0.207-0.222-0.361V0.402C1.844,0.25,1.93,0.107,2.067,0.043z"></path> </g> <g id="Capa_1_78_"> </g> </g> </g></svg>
282
+ </a></td>
283
+ <td style="margin-left:10px"><a style="color: #000;text-decoration: none; margin-right:8px" href="${this.shareUrl}">${this.shareText}</a></td>
283
284
  ${this.articleHtml}
284
- </div>${this.participantsName}`,
285
+ </tr>
286
+ </table>${this.participantsName}`
285
287
  );
286
288
  return html.join("");
287
289
  },
@@ -10,6 +10,10 @@
10
10
  </div>
11
11
  </template>
12
12
  <script lang="ts">
13
+ /* import { usePlayerStore } from "@/stores/PlayerStore";
14
+ import { mapState } from "pinia";
15
+ */
16
+ import { playerLive } from "../../mixins/player/playerLive";
13
17
  import videojs, { VideoJsPlayer } from "video.js";
14
18
  import qualitySelector from "videojs-hls-quality-selector";
15
19
  import qualityLevels from "videojs-contrib-quality-levels";
@@ -26,7 +30,7 @@ export default defineComponent({
26
30
  props: {
27
31
  hlsUrl: { default: "", type: String },
28
32
  },
29
-
33
+ mixins: [playerLive],
30
34
  emits: ["changeValid"],
31
35
  data() {
32
36
  return {
@@ -35,9 +39,15 @@ export default defineComponent({
35
39
  player: undefined as VideoJsPlayer | undefined,
36
40
  playing: false as boolean,
37
41
  stalledTimout: undefined as ReturnType<typeof setTimeout> | undefined,
42
+ //playerLive mixins
43
+ downloadId: null as string | null,
44
+ listenTime: 0 as number,
45
+ notListenTime: 0 as number,
46
+ lastSend: 0 as number,
38
47
  };
39
48
  },
40
49
  computed: {
50
+ /* ...mapState(usePlayerStore, ["playerLive"]), */
41
51
  videoElement(): HTMLVideoElement {
42
52
  return this.$refs.videoelement as HTMLVideoElement;
43
53
  },
@@ -68,10 +78,10 @@ export default defineComponent({
68
78
  },
69
79
  },
70
80
  mounted() {
71
- this.playLive();
72
81
  this.useVideoSrc =
73
82
  "" !== this.videoElement.canPlayType("application/vnd.apple.mpegurl") &&
74
83
  !navigator.userAgent.includes("Android");
84
+ this.playLive();
75
85
  },
76
86
 
77
87
  beforeUnmount() {
@@ -90,6 +100,7 @@ export default defineComponent({
90
100
  async playLive(): Promise<void> {
91
101
  clearTimeout(this.stalledTimout);
92
102
  this.definedStalledTimeout();
103
+ await this.initLiveDownloadId();
93
104
  if (this.useVideoSrc) {
94
105
  this.playLiveIos();
95
106
  return;
@@ -105,6 +116,7 @@ export default defineComponent({
105
116
  this.player.on("timeupdate", () => {
106
117
  clearTimeout(this.stalledTimout);
107
118
  this.definedStalledTimeout();
119
+ this.onTimeUpdate();
108
120
  });
109
121
  this.player.on("error", (error) => {
110
122
  this.stopLive();
@@ -136,6 +148,7 @@ export default defineComponent({
136
148
  this.videoElement.ontimeupdate = async () => {
137
149
  clearTimeout(this.stalledTimout);
138
150
  this.definedStalledTimeout();
151
+ this.onTimeUpdate();
139
152
  };
140
153
  this.videoElement.src = this.hlsUrl;
141
154
  },
@@ -166,7 +179,23 @@ export default defineComponent({
166
179
  this.videoClean();
167
180
  this.playing = false;
168
181
  },
169
- },
182
+ // onSeek
183
+
184
+ onTimeUpdate(): void {
185
+ if (!this.downloadId) { return;}
186
+ let currentTime = this.player?.currentTime() ?? this.videoElement.currentTime;
187
+ if (
188
+ this.playerLive &&
189
+ 0 === this.listenTime &&
190
+ 0 !==currentTime
191
+ ) {
192
+ this.notListenTime = currentTime;
193
+ this.listenTime = 1;
194
+ } else {
195
+ this.listenTime = currentTime - this.notListenTime;
196
+ }
197
+ },
198
+ },
170
199
  });
171
200
  </script>
172
201
 
@@ -7,10 +7,11 @@ export default {
7
7
  }
8
8
  if (state.octopusApi.imageUrl && url.includes("http")) {
9
9
  const size = height ? "height=" + height : "width=" + width;
10
+ const encode = btoa(url).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
10
11
  return (
11
12
  state.octopusApi.imageUrl +
12
13
  "image/" +
13
- btoa(url) +
14
+ encode +
14
15
  "?" +
15
16
  size +
16
17
  "&useWebp=true"
@@ -40,6 +40,7 @@ export const playerLogic = defineComponent({
40
40
  "playerVolume",
41
41
  "playerStatus",
42
42
  "playerSeekTime",
43
+ "playerVideo"
43
44
  ]),
44
45
 
45
46
  audioUrl(): string {
@@ -82,6 +83,9 @@ export const playerLogic = defineComponent({
82
83
  playerLive: {
83
84
  deep: true,
84
85
  handler() {
86
+ if(this.playerVideo){
87
+ return;
88
+ }
85
89
  this.$nextTick(async () => {
86
90
  this.hlsReady = false;
87
91
  this.reInitPlayer();