@icvdeveloper/common-module 0.0.122 → 0.0.123
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/dist/module.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { ref, toRefs, computed, onMounted } from "vue";
|
|
2
|
+
import { ref, toRefs, computed, onMounted, onUnmounted } from "vue";
|
|
3
3
|
import { storeToRefs } from "pinia";
|
|
4
4
|
import { DateTime } from "luxon";
|
|
5
5
|
import { useTemplateConfigsStore } from "../../store";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { ref, toRefs, computed, watch, onMounted, nextTick } from "vue";
|
|
3
3
|
import { get } from "lodash-es";
|
|
4
|
-
import { DateTime } from "luxon";
|
|
5
4
|
import { Presentation, Stream, PlayerObj } from "../../models/conference";
|
|
6
5
|
import { WebcastPlayerClassObj } from "../../@types/components";
|
|
7
6
|
import { useScripts } from "../../composables/useScripts";
|
|
@@ -35,12 +34,6 @@ let icvPlayerObj: PlayerObj = {
|
|
|
35
34
|
playerDiv: "mediaPlayer",
|
|
36
35
|
loadCustomStream: () => {},
|
|
37
36
|
};
|
|
38
|
-
const timeInterval = ref<NodeJS.Timer | null>(null);
|
|
39
|
-
|
|
40
|
-
// emits
|
|
41
|
-
const emit = defineEmits<{
|
|
42
|
-
(event: "time", value: Number): void;
|
|
43
|
-
}>();
|
|
44
37
|
|
|
45
38
|
// computed
|
|
46
39
|
const isHtml = computed(() => {
|
|
@@ -78,26 +71,7 @@ const playStream = () => {
|
|
|
78
71
|
}
|
|
79
72
|
};
|
|
80
73
|
|
|
81
|
-
const checkStreamTime = () => {
|
|
82
|
-
const defaultStreamUt = DateTime.now().toUnixInteger() - 40;
|
|
83
|
-
const maxStreamDelay = defaultStreamUt - 20;
|
|
84
|
-
let streamUt = get(icvPlayerObj, "stream_ut", defaultStreamUt);
|
|
85
|
-
|
|
86
|
-
if (streamUt > maxStreamDelay) {
|
|
87
|
-
streamUt = defaultStreamUt;
|
|
88
|
-
}
|
|
89
|
-
emit("time", streamUt);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const cleanup = () => {
|
|
93
|
-
if (icvPlayerObj) {
|
|
94
|
-
icvPlayerObj = <PlayerObj>{};
|
|
95
|
-
}
|
|
96
|
-
clearInterval(timeInterval.value);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
74
|
// watchers
|
|
100
|
-
|
|
101
75
|
watch(
|
|
102
76
|
presentation,
|
|
103
77
|
(_oldPresentation: Presentation, _newPresentation: Presentation) => {
|
|
@@ -125,15 +99,9 @@ onMounted(() => {
|
|
|
125
99
|
_script.onload = () => {
|
|
126
100
|
if (get(window, "ICVDMStreamPlayer", false)) {
|
|
127
101
|
setupMediaPlayer();
|
|
128
|
-
timeInterval.value = setInterval(() => {
|
|
129
|
-
checkStreamTime();
|
|
130
|
-
}, 1000);
|
|
131
102
|
}
|
|
132
103
|
};
|
|
133
104
|
});
|
|
134
|
-
onUnmounted(() => {
|
|
135
|
-
cleanup();
|
|
136
|
-
});
|
|
137
105
|
</script>
|
|
138
106
|
|
|
139
107
|
<template>
|