Issue Description
Video stream encoding configurations fail to take effect when applied prior to joining a room. The specified video encoding parameters are silently ignored during the initial channel connection phase, resulting in default resolution and frame rate outputs rather than the custom settings defined in the integration code.
Platform/SDK
Operating System: iOS
Service: Agora APaaS or Flexible Classroom
Affected Feature:
FcrRoomJoinOptions.createStreamConfigs
Root Cause
The configuration failure stems from an asynchronous stream identification constraint. The videoEncoderConfig property within the stream configuration object is defined but not actively applied during the pre join stage because the target stream identifier is not yet generated by the server.
Attempting to bind encoder settings to a non existent stream ID results in the parameters being discarded by the media engine. Furthermore, legacy versions of the iOS SDK lacked a dedicated interface for pre configuring camera capture parameters independently of the encoder settings.
Step-by-Step Solution
Execute Room Join Operations First
Initiate the connection sequence by invoking the standard
RoomControl.joinmethod with the appropriateFcrRoomJoinOptionspayload. Do not attempt to force encoder settings during this step.Apply Encoder Configurations Post Join
Wait for the successful room join callback before assigning the custom parameters. Once the connection is established and the stream ID is fully resolved, invoke
setVideoEncoderConfigto apply the desired encoding settings to the active media pipeline.Utilize Dedicated Capture Parameter Interfaces
To modify hardware capture behavior prior to encoding, invoke the newly integrated
setCameraCaptureParamsAPI. This interface is now fully supported on iOS and provides direct control over the camera input resolution, aligning the iOS SDK behavior with existing Android and HarmonyOS implementations.
Best Practice
Developers must separate stream capability definitions from room entry commands. By deferring video encoder configurations until after the channel join sequence is complete, the application ensures that all parameters bind securely to a valid stream identifier, restoring full control over the published video quality.