@christianriedl/media 1.0.164 → 1.0.166

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": "@christianriedl/media",
3
- "version": "1.0.164",
3
+ "version": "1.0.166",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -49,6 +49,7 @@
49
49
  items.splice(0, items.length, ...root.files);
50
50
  computeListHeight();
51
51
  });
52
+ onUnmounted(() => selected.value.itemType = EItemType.None);
52
53
 
53
54
  watch(appState.bodyHeight, () => computeListHeight());
54
55
 
@@ -102,14 +103,12 @@
102
103
  audioStream.value = null;
103
104
  await getActiveStreams();
104
105
  }
105
- const video = item as IVideoFile;
106
- paramsText.value = `${video.width}x${video.height}`;
107
- return;
106
+ onQualityChange();
108
107
  }
109
108
  }
110
109
  function onQualityChange() {
111
110
  const video = selected.value as IVideoFile;
112
- if (quality.value > 0) {
111
+ if (quality.value > 0 || !mediaAppConfig.useSatIp) {
113
112
  params = MediaHelper.getTranscodeParams(mediaAppConfig.useSatIp, video.width, video.height, window.innerWidth, quality.value);
114
113
  paramsText.value = params.text;
115
114
  }
@@ -122,6 +121,9 @@
122
121
  router.back();
123
122
  }
124
123
  async function getActiveStreams() {
124
+ if (selected.value.itemType == EItemType.None) {
125
+ return; // unmounted
126
+ }
125
127
  let channel = "";
126
128
  let url = "";
127
129
  if (selected.value.itemType == EItemType.VideoBroadcast && audioStreams.length == 0) {
@@ -135,11 +137,10 @@
135
137
  const as = MediaHelper.getAudioStreams(mediaInfo);
136
138
  audioStreams.splice(0, audioStreams.length, ...as);
137
139
  audioStream.value = 0;
138
- return;
139
140
  }
140
- }
141
- if (numActiveStreams.value > 0) {
142
- window.setTimeout(async () => await getActiveStreams(), 1000);
141
+ if (mediaInfo.numActiveStreams > 0) {
142
+ window.setTimeout(async () => await getActiveStreams(), 1000);
143
+ }
143
144
  }
144
145
  }
145
146
  </script>