@clockworkdog/cogs-client 2.2.0 → 2.3.0

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.
@@ -54,10 +54,6 @@ class CogsConnection {
54
54
  */
55
55
  this.audioOutputs = undefined;
56
56
  this._selectedAudioOutput = '';
57
- /**
58
- * URL parameters use for the websocket connection and asset URLs
59
- */
60
- this.urlParams = null;
61
57
  this.currentState = { ...initialClientState };
62
58
  const { useReconnectingWebsocket, path, pathParams, supportsHttp2Assets } = websocketParametersFromUrl(document.location.href);
63
59
  // Store the URL parameters for use in asset URLs
@@ -115,6 +111,17 @@ class CogsConnection {
115
111
  case 'cogs_environment':
116
112
  this.serverSupportsHttp2Assets = message.http2AssetsServer;
117
113
  break;
114
+ case 'media_config_update':
115
+ for (const optionName of ['preferOptimizedAudio', 'preferOptimizedVideo', 'preferOptimizedImages']) {
116
+ const optionEnabled = message[optionName];
117
+ if (optionEnabled) {
118
+ this.urlParams.set(optionName, 'true');
119
+ }
120
+ else {
121
+ this.urlParams.delete(optionName);
122
+ }
123
+ }
124
+ break;
118
125
  }
119
126
  this.dispatchEvent(new CogsMessageEvent(message));
120
127
  }