Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class BroadcastScreenShareCapturer: RTCVideoCapturer {

/**
Creates a broadcast screen capturer.

- Parameters:
- source: `RTCVideoSource` that will receive incoming video buffers
- appGroup: App Group that will be used for starting an `IPCServer` on
Expand Down
16 changes: 8 additions & 8 deletions packages/ios-client/Sources/ios-client/ClientBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ public class ClientBase: NSObject, RTCPeerConnectionDelegate {

/**
Sends an SDP offer to the WHIP/WHEP server.

- Parameter sdpOffer: The offer to send to the server.

- Throws: `AttributeNotFoundError.ResponseNotFound` if there is no response to the offer or
`AttributeNotFoundError.LocationNotFound` if the response does not contain the location parameter or
`SessionNetworkError.ConnectionError` if the connection could not be established or the response code is incorrect,
for example due to server being down, wrong server URL or token.

- Returns: A SDP response.
*/
func send(sdpOffer: String) async throws -> String {
Expand Down Expand Up @@ -170,9 +170,9 @@ public class ClientBase: NSObject, RTCPeerConnectionDelegate {

/**
Sends an ICE candidate to WHIP/WHEP server in order to provide a streaming device.

- Parameter candidate: Represents a single ICE candidate.

- Throws: `AttributeNotFoundError.PatchEndpointNotFound` if the patch endpoint has not been properly set up,
`AttributeNotFoundError.UFragNotFound` if the SDP of the candidate does not contain the ufrag,
`SessionNetworkError.CandidateSendingError` if the candidate could not be sent and
Expand Down Expand Up @@ -331,11 +331,11 @@ public class ClientBase: NSObject, RTCPeerConnectionDelegate {

/**
Gets matched codecs from the preferred codec list that are available in the peer connection factory.

- Parameter preferredCodecs: List of preferred codec names
- Parameter mediaType: The media type (audio or video)
- Parameter useReceiver: Whether to use receiver capabilities instead of sender capabilities

- Returns: Array of matched codec capabilities
*/
func getMatchedCodecs(preferredCodecs: [String], mediaType: String, useReceiver: Bool = false)
Expand All @@ -360,7 +360,7 @@ public class ClientBase: NSObject, RTCPeerConnectionDelegate {

/**
Sets codec preferences for a transceiver if matched codecs are available.

- Parameter transceiver: The RTP transceiver to set preferences for
- Parameter preferredCodecs: List of preferred codec names
- Parameter mediaType: The media type (audio or video)
Expand Down
16 changes: 8 additions & 8 deletions packages/ios-client/Sources/ios-client/WhepClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public class WhepClient: ClientBase {

/**
Initializes a `WhepClient` object.

- Parameter serverUrl: A URL of the WHEP server.
- Parameter configurationOptions: Additional configuration options, such as a STUN server URL or authorization token.

- Returns: A `WhepClient` object.
*/
public init(configOptions: WhepConfigurationOptions) throws {
Expand Down Expand Up @@ -54,7 +54,7 @@ public class WhepClient: ClientBase {

/**
Connects the client to the WHEP server using WebRTC Peer Connection.

- Throws: `SessionNetworkError.ConfigurationError` if the `stunServerUrl` parameter
of the initial configuration is incorrect, which leads to `peerConnection` being nil or in any other case where there has been an error in creating the `peerConnection`
*/
Expand Down Expand Up @@ -116,7 +116,7 @@ public class WhepClient: ClientBase {

/**
Closes the established Peer Connection.

- Throws: `SessionNetworkError.ConfigurationError` if the `stunServerUrl` parameter
of the initial configuration is incorrect, which leads to `peerConnection` being nil or in any other case where there has been an error in creating the `peerConnection`
*/
Expand Down Expand Up @@ -165,7 +165,7 @@ public class WhepClient: ClientBase {

/**
Gets the names of supported receiver video codecs.

- Returns: Array of supported video codec names
*/
public static func getSupportedReceiverVideoCodecsNames() -> [String] {
Expand All @@ -177,7 +177,7 @@ public class WhepClient: ClientBase {

/**
Gets the names of supported receiver audio codecs.

- Returns: Array of supported audio codec names
*/
public static func getSupportedReceiverAudioCodecsNames() -> [String] {
Expand All @@ -189,7 +189,7 @@ public class WhepClient: ClientBase {

/**
Sets preferred video codecs for receiving.

- Parameter preferredCodecs: Array of preferred video codec names, or nil to skip setting
*/
public func setPreferredVideoCodecs(preferredCodecs: [String]?) {
Expand All @@ -215,7 +215,7 @@ public class WhepClient: ClientBase {

/**
Sets preferred audio codecs for receiving.

- Parameter preferredCodecs: Array of preferred audio codec names, or nil to skip setting
*/
public func setPreferredAudioCodecs(preferredCodecs: [String]?) {
Expand Down
18 changes: 9 additions & 9 deletions packages/ios-client/Sources/ios-client/WhipClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class WhipClient: ClientBase {
/**
Initializes a `WhipClient` object.
- Parameter configurationOptions: Additional configuration options, such as a STUN server URL or authorization token.

- Returns: A `WhipClient` object.
*/
public init(
Expand Down Expand Up @@ -117,7 +117,7 @@ public class WhipClient: ClientBase {

/**
Connects the client to the WHIP server using WebRTC Peer Connection.

- Throws: `SessionNetworkError.ConfigurationError` if the `stunServerUrl` parameter
of the initial configuration is incorrect, which leads to `peerConnection` being nil or in any other case where there has been an error in creating the `peerConnection`
*/
Expand Down Expand Up @@ -145,7 +145,7 @@ public class WhipClient: ClientBase {

/**
Closes the established Peer Connection.

- Throws: `SessionNetworkError.ConfigurationError` if the `stunServerUrl` parameter
of the initial configuration is incorrect, which leads to `peerConnection` being nil or in any other case where there has been an error in creating the `peerConnection`
*/
Expand Down Expand Up @@ -314,7 +314,7 @@ public class WhipClient: ClientBase {

/**
Gets the names of supported sender video codecs.

- Returns: Array of supported video codec names
*/
public static func getSupportedSenderVideoCodecsNames() -> [String] {
Expand All @@ -326,7 +326,7 @@ public class WhipClient: ClientBase {

/**
Gets the names of supported sender audio codecs.

- Returns: Array of supported audio codec names
*/
public static func getSupportedSenderAudioCodecsNames() -> [String] {
Expand All @@ -338,7 +338,7 @@ public class WhipClient: ClientBase {

/**
Sets preferred video codecs for sending.

- Parameter preferredCodecs: Array of preferred video codec names, or nil to skip setting
*/
public func setPreferredVideoCodecs(preferredCodecs: [String]?) {
Expand All @@ -363,7 +363,7 @@ public class WhipClient: ClientBase {

/**
Sets preferred audio codecs for sending.

- Parameter preferredCodecs: Array of preferred audio codec names, or nil to skip setting
*/
public func setPreferredAudioCodecs(preferredCodecs: [String]?) {
Expand All @@ -390,13 +390,13 @@ public class WhipClient: ClientBase {

/**
Starts screen sharing mode.

This method:
- Stops camera capture
- Creates a new video source for screen sharing
- Starts IPC server listening for frames from the broadcast extension
- Shows the system broadcast picker for the user to select the extension

This should be called during initialization, not during an active stream.
*/
public func startScreenShare() throws {
Expand Down
Loading