@christianriedl/media 1.0.106 → 1.0.107
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 +1 -1
- package/src/views/VideoPage.vue +19 -13
- package/src/views/VideosPage.vue +2 -3
package/package.json
CHANGED
package/src/views/VideoPage.vue
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { inject, ref, onMounted, onUnmounted } from 'vue';
|
|
2
|
+
import { inject, ref, onMounted, onUnmounted, watch } from 'vue';
|
|
3
3
|
import { useRoute, useRouter } from 'vue-router';
|
|
4
|
+
import { appStateSymbol } from '@christianriedl/utils';
|
|
4
5
|
import { MediaService, getMediaSymbol } from '@christianriedl/media';
|
|
5
6
|
|
|
7
|
+
const appState = inject(appStateSymbol)!;
|
|
6
8
|
const getMediaService = inject(getMediaSymbol)!;
|
|
7
9
|
const mediaService = getMediaService()!;
|
|
8
10
|
const route = useRoute();
|
|
9
11
|
const router = useRouter();
|
|
10
12
|
|
|
11
13
|
const url = ref('');
|
|
12
|
-
const height = ref(0);
|
|
13
14
|
const width = ref(0);
|
|
14
|
-
|
|
15
|
+
const height = ref(0);
|
|
16
|
+
const ready = ref(false);
|
|
17
|
+
|
|
18
|
+
watch(appState.bodyHeight, () => {
|
|
19
|
+
if (appState.pageWidth.value && appState.bodyHeight.value) {
|
|
20
|
+
width.value = appState.pageWidth.value;
|
|
21
|
+
height.value = appState.bodyHeight.value - 8; // video height not exactly, requires 8 px more
|
|
22
|
+
if (url.value)
|
|
23
|
+
ready.value = true;
|
|
24
|
+
}
|
|
25
|
+
}, { immediate: true });
|
|
26
|
+
|
|
15
27
|
let channelName = "";
|
|
16
28
|
let media = "";
|
|
17
29
|
|
|
@@ -24,7 +36,8 @@
|
|
|
24
36
|
channelName = route.query.channelName.toString();
|
|
25
37
|
if (route.query.media)
|
|
26
38
|
media = route.query.media.toString();
|
|
27
|
-
|
|
39
|
+
if (height.value)
|
|
40
|
+
ready.value = true;
|
|
28
41
|
});
|
|
29
42
|
onUnmounted(() => {
|
|
30
43
|
window.document.removeEventListener('keydown', onKey);
|
|
@@ -32,11 +45,6 @@
|
|
|
32
45
|
mediaService.stopSatIpStream(channelName, media);
|
|
33
46
|
});
|
|
34
47
|
|
|
35
|
-
function onResize() {
|
|
36
|
-
height.value = window.innerHeight;
|
|
37
|
-
width.value = window.innerWidth;
|
|
38
|
-
landscape = width.value > height.value;
|
|
39
|
-
}
|
|
40
48
|
function onKey(ev: KeyboardEvent) {
|
|
41
49
|
switch (ev.code) {
|
|
42
50
|
case "Escape":
|
|
@@ -47,8 +55,6 @@
|
|
|
47
55
|
</script>
|
|
48
56
|
|
|
49
57
|
<template>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
</video>
|
|
53
|
-
</div>
|
|
58
|
+
<video v-if="ready" controls autoplay :src="url" :width="width" :height="height">
|
|
59
|
+
</video>
|
|
54
60
|
</template>
|
package/src/views/VideosPage.vue
CHANGED
|
@@ -121,8 +121,7 @@
|
|
|
121
121
|
const video = item as IVideoFile;
|
|
122
122
|
const as = mediaService.splitAudioStreams(video.AudioStreams);
|
|
123
123
|
audioStreams.splice(0, audioStreams.length, ...as);
|
|
124
|
-
|
|
125
|
-
paramsText.value = params.text;
|
|
124
|
+
paramsText.value = `${video.Width}x${video.Height}`;
|
|
126
125
|
return;
|
|
127
126
|
}
|
|
128
127
|
const folder = item as IMediaFolder;
|
|
@@ -144,7 +143,7 @@
|
|
|
144
143
|
}
|
|
145
144
|
else {
|
|
146
145
|
params = null;
|
|
147
|
-
paramsText.value =
|
|
146
|
+
paramsText.value = `${video.Width}x${video.Height}`;
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
function listBack() {
|