@saooti/octopus-sdk 37.0.28 → 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,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
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 {
|
|
@@ -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
|
|
|
@@ -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();
|