@livedigital/client 2.3.0 → 2.4.0-beta.1

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
@@ -2,7 +2,7 @@
2
2
  "name": "@livedigital/client",
3
3
  "author": "vlprojects",
4
4
  "license": "MIT",
5
- "version": "2.3.0",
5
+ "version": "2.4.0-beta.1",
6
6
  "private": false,
7
7
  "bugs": {
8
8
  "url": "https://github.com/vlprojects/livedigital-sdk/issues"
@@ -90,17 +90,30 @@ class PeerConsumer {
90
90
 
91
91
  setSpatialLayersParams(): void {
92
92
  const { encodings } = this.appData.producerData;
93
+ if (!encodings) {
94
+ return;
95
+ }
96
+
93
97
  this.availableSpatialLayers = encodings.map((encoding) => this.parseSpatialLayerParams(encoding));
94
98
  }
95
99
 
96
100
  setCurrentSpatialLayerParams(): void {
97
101
  const { encodings } = this.appData.producerData;
102
+ if (!encodings) {
103
+ return;
104
+ }
105
+
98
106
  this.currentSpatialLayerParams = this.parseSpatialLayerParams(encodings[this.currentSpatialLayer]);
99
107
  this.logger.debug('setCurrentSpatialLayerParams()', { currentSpatialLayerParams: this.currentSpatialLayerParams });
100
108
  }
101
109
 
102
110
  parseSpatialLayerParams(encoding: RtpEncodingParameters): SpatialLayerParams {
103
- const { trackTransformParams: { width, height } } = this.appData.producerData;
111
+ const { trackTransformParams } = this.appData.producerData;
112
+ if (!trackTransformParams) {
113
+ return encoding;
114
+ }
115
+
116
+ const { width, height } = trackTransformParams;
104
117
  const coefficient = encoding.scaleResolutionDownBy || 1;
105
118
  if (width && height) {
106
119
  return {