createRoomOnMediaSfu

Sends a request to create a new room on MediaSFU.

This function validates the provided credentials and dynamically determines the endpoint based on the localLink. It performs an HTTP POST request with the given payload and returns the response or an error.

Parameters:

  • payload (CreateMediaSFURoomOptions): The payload containing room creation details.

  • apiUserName (String): The API username used for authentication.

  • apiKey (String): The API key for authentication (must be exactly 64 characters).

  • localLink (String, optional): A local link for community edition servers.

Returns:

  • A CreateJoinRoomResult containing:

  • success (Boolean): Indicates whether the request was successful.

  • data (CreateJoinRoomResponse | CreateJoinRoomError): The response data or error details.

Example Usage:

val payload = CreateMediaSFURoomOptions(
action = "create",
duration = 60,
capacity = 10,
userName = "hostUser",
roomName = "my-room",
adminPasscode = "admin123",
islevel = "0",
eventType = "conference"
)

val options = CreateMediaSFUOptions(
payload = payload,
apiUserName = "username",
apiKey = "your-64-character-api-key",
localLink = ""
)

val result = createRoomOnMediaSfu(options)

Platform Notes:

  • Android: Uses Android HTTP client

  • iOS: Uses iOS HTTP client

  • Common: Platform-agnostic interface

Return

CreateJoinRoomResult containing success status and response data

Parameters

options

Configuration options for creating a room on MediaSFU