@@ -157,11 +157,12 @@ class MembraneWebRTC: MembraneRTCDelegate {
157
157
initLocalEndpoint ( )
158
158
}
159
159
160
- func getVideoParametersFromOptions( connectionOptions: CameraConfig ) -> VideoParameters {
160
+ func getVideoParametersFromOptions( connectionOptions: CameraConfig ) throws -> VideoParameters {
161
161
let videoQuality = connectionOptions. quality
162
162
let flipVideo = connectionOptions. flipVideo
163
163
let videoBandwidthLimit = getMaxBandwidthFromOptions (
164
164
maxBandwidth: connectionOptions. maxBandwidth)
165
+ let simulcastConfig = try getSimulcastConfigFromOptions ( simulcastConfig: connectionOptions. simulcastConfig) ?? SimulcastConfig ( )
165
166
166
167
let preset : VideoParameters = {
167
168
switch videoQuality {
@@ -192,7 +193,7 @@ class MembraneWebRTC: MembraneRTCDelegate {
192
193
let videoParameters = VideoParameters (
193
194
dimensions: flipVideo ? preset. dimensions. flip ( ) : preset. dimensions,
194
195
maxBandwidth: videoBandwidthLimit,
195
- simulcastConfig: self . videoSimulcastConfig
196
+ simulcastConfig: simulcastConfig
196
197
)
197
198
return videoParameters
198
199
}
@@ -284,9 +285,10 @@ class MembraneWebRTC: MembraneRTCDelegate {
284
285
try addTrackToLocalEndpoint ( cameraTrack, config. videoTrackMetadata. toMetadata ( ) , simulcastConfig)
285
286
try setCameraTrackState ( cameraTrack: cameraTrack, isEnabled: config. cameraEnabled)
286
287
}
288
+
287
289
private func createCameraTrack( config: CameraConfig ) throws -> LocalVideoTrack ? {
288
290
try ensureConnected ( )
289
- let videoParameters = getVideoParametersFromOptions ( connectionOptions: config)
291
+ let videoParameters = try getVideoParametersFromOptions ( connectionOptions: config)
290
292
guard
291
293
let simulcastConfig = try getSimulcastConfigFromOptions (
292
294
simulcastConfig: config. simulcastConfig)
0 commit comments