@christianriedl/media 1.0.162 → 1.0.164
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/iMedia.d.ts +1 -0
- package/package.json +1 -1
- package/src/views/OnlineTVsPage.vue +46 -13
package/dist/iMedia.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
const listHeight = ref(0);
|
|
24
24
|
const listhead = ref<ComponentPublicInstance | null>(null);
|
|
25
25
|
const audioStreams: IValueText[] = reactive([]);
|
|
26
|
-
const audioStream = ref(
|
|
26
|
+
const audioStream = ref<number | null>(null);
|
|
27
|
+
const numActiveStreams = ref("");
|
|
27
28
|
const qualities = MediaHelper.getVideoQualities();
|
|
28
29
|
const quality = ref(0);
|
|
29
30
|
let params: ITranscodeParams;
|
|
@@ -36,6 +37,9 @@
|
|
|
36
37
|
if (mediaAppConfig.useMediaBin) {
|
|
37
38
|
const rc = await mediaService.initialize(EMediaType.Online);
|
|
38
39
|
}
|
|
40
|
+
if (mediaAppConfig.useSatIp) {
|
|
41
|
+
await getActiveStreams();
|
|
42
|
+
}
|
|
39
43
|
const root = await mediaService.getOnlineTVs();
|
|
40
44
|
for (var i = 0; i < root.files.length; i++) {
|
|
41
45
|
const video = root.files[i];
|
|
@@ -61,10 +65,12 @@
|
|
|
61
65
|
let url;
|
|
62
66
|
if (mediaAppConfig.useSatIp) {
|
|
63
67
|
url = `${(mediaService as MediaService).rest.serviceUrl}apistream/satipstream?channelName=${selected.value.name}&url=${encodeURIComponent(selected.value.url)}`;
|
|
64
|
-
if (audioStream.value)
|
|
68
|
+
if (audioStream.value != null)
|
|
65
69
|
url += `&audioStream=${audioStream.value}`;
|
|
66
70
|
if (params)
|
|
67
71
|
url += `&width=${params.width}&height=${params.height}&videoBitRate=${params.videoBitRate}&audioBitRate=${params.audioBitRate}`;
|
|
72
|
+
else if (audioStream.value != null && audioStreams[audioStream.value].text.toLowerCase().startsWith('ac'))
|
|
73
|
+
url += '&audioBitRate=0';
|
|
68
74
|
}
|
|
69
75
|
else {
|
|
70
76
|
url = await epgCache.epg.requestChannelStream(selected.value.name, 'mp4', undefined, params.videoBitRate, params.scaleFactor);
|
|
@@ -92,28 +98,50 @@
|
|
|
92
98
|
selected.value = item;
|
|
93
99
|
computeListHeight();
|
|
94
100
|
if (mediaAppConfig.useSatIp) {
|
|
95
|
-
audioStreams.splice(0, audioStreams.
|
|
96
|
-
audioStream.value =
|
|
97
|
-
|
|
98
|
-
if (mediaInfo) {
|
|
99
|
-
const as = MediaHelper.getAudioStreams(mediaInfo);
|
|
100
|
-
audioStreams.splice(0, audioStreams.length, ...as);
|
|
101
|
-
}
|
|
101
|
+
audioStreams.splice(0, audioStreams.length);
|
|
102
|
+
audioStream.value = null;
|
|
103
|
+
await getActiveStreams();
|
|
102
104
|
}
|
|
103
105
|
const video = item as IVideoFile;
|
|
104
|
-
|
|
105
|
-
paramsText.value = params.text;
|
|
106
|
+
paramsText.value = `${video.width}x${video.height}`;
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
function onQualityChange() {
|
|
110
111
|
const video = selected.value as IVideoFile;
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
if (quality.value > 0) {
|
|
113
|
+
params = MediaHelper.getTranscodeParams(mediaAppConfig.useSatIp, video.width, video.height, window.innerWidth, quality.value);
|
|
114
|
+
paramsText.value = params.text;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
params = null;
|
|
118
|
+
paramsText.value = `${video.width}x${video.height}`;
|
|
119
|
+
}
|
|
113
120
|
}
|
|
114
121
|
function listBack() {
|
|
115
122
|
router.back();
|
|
116
123
|
}
|
|
124
|
+
async function getActiveStreams() {
|
|
125
|
+
let channel = "";
|
|
126
|
+
let url = "";
|
|
127
|
+
if (selected.value.itemType == EItemType.VideoBroadcast && audioStreams.length == 0) {
|
|
128
|
+
channel = selected.value.name;
|
|
129
|
+
url = selected.value.url;
|
|
130
|
+
}
|
|
131
|
+
const mediaInfo = await mediaService.getSatIpProbe(channel, url);
|
|
132
|
+
if (mediaInfo) {
|
|
133
|
+
numActiveStreams.value = `${mediaInfo.numActiveStreams} active streams`;
|
|
134
|
+
if (mediaInfo.audioStreams) {
|
|
135
|
+
const as = MediaHelper.getAudioStreams(mediaInfo);
|
|
136
|
+
audioStreams.splice(0, audioStreams.length, ...as);
|
|
137
|
+
audioStream.value = 0;
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (numActiveStreams.value > 0) {
|
|
142
|
+
window.setTimeout(async () => await getActiveStreams(), 1000);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
117
145
|
</script>
|
|
118
146
|
|
|
119
147
|
<template>
|
|
@@ -129,6 +157,11 @@
|
|
|
129
157
|
<v-list-item-subtitle>{{paramsText}}</v-list-item-subtitle>
|
|
130
158
|
</v-list-item-content>
|
|
131
159
|
</v-list-item>
|
|
160
|
+
<v-list-item v-if="mediaAppConfig.useSatIp" lines="one">
|
|
161
|
+
<v-list-item-content>
|
|
162
|
+
<v-list-item-title>{{numActiveStreams}}</v-list-item-title>
|
|
163
|
+
</v-list-item-content>
|
|
164
|
+
</v-list-item>
|
|
132
165
|
<v-card-actions>
|
|
133
166
|
<v-btn @click="listBack">
|
|
134
167
|
<v-icon icon="$back" />
|