setSpatialDirection method

Future<void> setSpatialDirection(
  1. SpatialDirection direction

Sets the direction the local participant is facing in space. This method is available only for participants who joined the conference using the ConferenceService.join method with the ConferenceJoinOptions.spatialAudio parameter enabled. Otherwise, SDK triggers an error. To set a spatial direction for listeners, use the Set Spatial Listeners Audio REST API.

If the local participant hears audio from the position (0,0,0) facing down the Z-axis and locates a remote participant in the position (1,0,1), the local participant hears the remote participant from front-right. If the local participant chooses to change the direction and rotate +90 degrees about the Y-axis, then instead of hearing the speaker from the front-right position, the participant hears the speaker from the front-left position. The following video presents this example:

For more information, see the SpatialDirection model.


Future<void> setSpatialDirection(SpatialDirection direction) async {
  await _methodChannel.invokeMethod<void>(
      "setSpatialDirection", direction.toJson());
  return Future.value();