Skip to content

Commit

Permalink
merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
Cartisim committed Aug 30, 2023
2 parents 768a3cf + ba34a5a commit 12c4e8b
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
"FCSDKiOS",
"WebRTC"
]),
.binaryTarget(name: "FCSDKiOS", url: "https://swift-sdk.s3.us-east-2.amazonaws.com/client_sdk/FCSDKiOS-4.2.5.xcframework.zip", checksum: "652f331c8781591933ef097f1c77bef2b5775a0c15816c5bc1d636d2477eff5b"),
.binaryTarget(name: "FCSDKiOS", url: "https://swift-sdk.s3.us-east-2.amazonaws.com/client_sdk/FCSDKiOS-4.2.5.xcframework.zip", checksum: "488adb45a9d85efc7a4199bc19e8c97c390a0202706a1319bae5b4b3a02814a4"),
.binaryTarget(name: "WebRTC", url: "https://swift-sdk.s3.us-east-2.amazonaws.com/real_time/WebRTC-m110.xcframework.zip", checksum: "2750cf1087b2441d67208ca2b0905578b4ad1797a68d2d2758d0f075500f0011")
]
)
32 changes: 32 additions & 0 deletions Sources/SwiftFCSDKiOS/SwiftFCSDKiOS.docc/Symbols/ACBClientCall.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,23 @@ Please see <doc:VideoCalls> for an explanation of how to use ACBClientCall
/// The client should always remove the `remoteBufferView()` when finished using the bufferView.
@objc final public func removeBufferView() async

/// We create a Metal renderer `UIView` intended for local video usage
/// - Parameters:
/// - scaleMode: Video content mode scale type
/// - shouldScaleWithOrientation: Determines if the video should scale when the device orientation changes
/// - Returns: AVSampleBufferDisplayLayer backed UIView
@MainActor @objc final public func remoteBufferView(scaleMode: FCSDKiOS.VideoScaleMode = .horizontal, shouldScaleWithOrientation: Bool = false) async -> UIView?

/// The call's ``UIView`` used for displaying local buffer views intended for use in picture in picture/Virtual Background enabled applications
@MainActor @objc final public func localBufferView() async -> UIView?

/// We create a Metal renderer `UIView` intended for local video usage
/// - Parameters:
/// - scaleMode: Video content mode scale type
/// - shouldScaleWithOrientation: Determines if the video should scale when the device orientation changes
/// - Returns: AVCaptureVideoPreviewLayer backed UIView
@MainActor @objc final public func localBufferView(scaleMode: FCSDKiOS.VideoScaleMode = .horizontal, shouldScaleWithOrientation: Bool = false) async -> UIView?

/// The client should always remove the `removePreviewView()` when finished using the previewView.
@objc final public func removeLocalBufferView() async

Expand Down Expand Up @@ -64,12 +78,16 @@ Please see <doc:VideoCalls> for an explanation of how to use ACBClientCall

/// Determines whether or not the SDK should enable Audio
/// - Parameter isAudioEnabled: A Boolean value to determine enabling
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func enableLocalAudio(_ isAudioEnabled: Bool)
@objc final public func enableLocalAudio(_ isAudioEnabled: Bool) async

/// Determines whether or not the SDK should enable Video. if our **WebRTCHandler** has not been intialized yet we set the availabily and then call
/// **localVideoStreamEvent()** at a later point in time. The PeerConnection connection should only be nil if the call has not yet been established.
/// - Parameter isVideoEnabled: A Boolean value to determine enabling
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func enableLocalVideo(_ isVideoEnabled: Bool)
@objc final public func enableLocalVideo(_ isVideoEnabled: Bool) async

/// Sends a DTMF message (to the server) given a number (0-9), ABCD, *, # as input.
/// - Parameters:
Expand All @@ -79,6 +97,7 @@ Please see <doc:VideoCalls> for an explanation of how to use ACBClientCall

/// This method ends the call entirely. If the call parameter is nil it will end the call associated with this current ACBClientCall object. However we may want to end a specific call which can be passed
/// in the parameter.
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func end()

/// This method ends the call entirely. If the call parameter is nil it will end the call associated with this current ACBClientCall object.
Expand All @@ -90,16 +109,21 @@ Please see <doc:VideoCalls> for an explanation of how to use ACBClientCall
extension ACBClientCall {

/// You can use this method to tell FCSDK to hold a call.
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func hold()
@objc final public func hold() async

/// If your call is on ``hold()`` you may use this method to resume the call
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func resume()
@objc final public func resume() async
}

extension ACBClientCall {
/// This is our method used to answer an incoming call. When a user calls our end point FCSDK will notify us of an incoming call, at that point we must answer the call with this method.e must answer the call with this /// - Parameters:
/// - audioDir: The Direction we want to answer with. See... `ACBMediaDirection`
/// - videoDir: The Direction we want to answer with. See... `ACBMediaDirection`
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func answer(withAudio audioDir: FCSDKiOS.ACBMediaDirection, andVideo videoDir: FCSDKiOS.ACBMediaDirection)

/// This is our method used to answer an incoming call asynchronously. When a user calls our end point FCSDK will notify us of an incoming call, at that point we must answer the call with this method.
Expand All @@ -108,4 +132,12 @@ extension ACBClientCall {
/// - videoDir: The Direction we want to answer with. See... `ACBMediaDirection`
@objc final public func answer(withAudio audioDir: FCSDKiOS.ACBMediaDirection, andVideo videoDir: FCSDKiOS.ACBMediaDirection) async
}

/// VideoScaleMode is an enumeration that allows you to decide to scale video in your container view according to its tallest point, widest point, fill the media into the container if the media does not already fill its entire container or feed raw unscaled media into your video view.
@objc public enum VideoScaleMode : Int, Sendable {
case vertical
case horizontal
case fill
case none
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ Please see <doc:VideoCalls> for an explanation of how to use ACBClientCall

/// Sets the camera to be used based off the ``ACBClientCall``'s camera.
/// - Parameter camera: Camera postion i.e (.front, .back)
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func setCamera(_ camera: AVCaptureDevice.Position)
@objc final public func setCamera(_ camera: AVCaptureDevice.Position) async

/// Used to capture recommended settings
/// - Returns: The device Info's recommended capture settings
@available(*, deprecated, message: "Please use async version, Future versions of FCSDKiOS will remove this method.")
@objc final public func recommendedCaptureSettings() -> [FCSDKiOS.ACBVideoCaptureSetting]?
@objc final public func recommendedCaptureSettings() -> [FCSDKiOS.ACBVideoCaptureSetting]? async
}

extension ACBClientPhone {
Expand Down
53 changes: 50 additions & 3 deletions Sources/SwiftFCSDKiOS/SwiftFCSDKiOS.docc/Version-4.2.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ This article describes changes in version 4.2.5 of FCSDKiOS

Version 4.2.5 has several bug fixes and performance improvements. Below is a list of bug fixes.

### We fixed an issue where setting the ACBClientCallDelegate may not have been setting
### We fixed an issue where setting the ACBClientCallDelegate may not have been setting.

### Ensursing that when a new view is fed to the SDK's remote and local views they are created properly.

### Fixed an issue where iOS 13 users may not have been connecting to the socket
### Fixed an issue where iOS 13 users may not have been connecting to the socket.

### Fixed an issue where initial `localBufferView`s may have been flickering.

### The `localBufferView` will now appear when the call state transitions to `.inCall`.

### Fixed an issue where applications may have crashed after a duration of 10 minutes.

### Introduced and Deprecated methods that should be called from an Async Context in order to protect synchronization of state.

## Below is a list of methods where synchronous versions of those methods were deprecated. We request you to use the listed async versions bellow
## Below is a list of methods where the synchronous methods were deprecated and we request you to use the listed async versions bellow

```swift
await call.enableLocalVideo(false)
Expand All @@ -35,3 +41,44 @@ _ = await acbuc.phone.recommendedCaptureSettings()
[self.uc.phone setCamera: self.currentCamera completionHandler:^{}];
[self->uc.phone recommendedCaptureSettingsWithCompletionHandler:^(NSArray<ACBVideoCaptureSetting*>* recCaptureSettings) {}];
```
## We also added some additional parameters for video scaling on our buffer views. Please note the following behaviors.
**VideoScaleMode**
*`.horizontal`*
The horizontal scale mode is designed to scale the content with it's aspect ratio to the widest point. This means if your view is too short in relationship with the aspect ratio than it will clip the height of the content. If the view is too tall then you will see back space on the top and bottom of the views content.
*`.vertical`*
The vertical scale mode is designed to scale the content with it's aspect ratio to the tallest point. This means if your view is too narrow in relationship with the aspect ratio than it will clip the width of the content. If the view is too wide then you will see back space on the left and right of the views content.
*`.fill`*
The fill scale mode is designed to scale the content to fill the view's container with it's aspect ratio. This means the view will clip both height and width of the content in order to fill the view.
*`.none`*
The none scale mode feeds the raw data into the view with out any scaling.
**`shouldScaleWithOrientation`**
This boolean property is intended for use when the scale mode is set to *.vertical* or *.horizontal*. For instance you may want to start out a call in .vertical mode for both `localBufferView` and `remoteBufferView`, however when a device rotates you may then want to scale to the opposite longest point *i.e.* `.horizontal` mode. Setting this parameter to true will give you this behavior.
**Here is what these properties look like in use**
```swift
remoteBufferView(
scaleMode: .horizontal,
shouldScaleWithOrientation: false
)
localBufferView(
scaleMode: .horizontal,
shouldScaleWithOrientation: false
)
```

These API's provide you with a truly customizable approach in your applications.

0 comments on commit 12c4e8b

Please sign in to comment.