Skip to content

Commit

Permalink
Updated the Skylink dependency to 2.2. That requires an update of the…
Browse files Browse the repository at this point in the history
… `didChangeVideoSize` prototype.
  • Loading branch information
Jacques-Olivier Haché committed Jun 28, 2021
1 parent daada29 commit f8c67f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SampleAppSwift5/Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Temasys/SKYLINK-iOS" "2.1.0"
github "Temasys/SKYLINK-iOS" "2.2.0"
2 changes: 1 addition & 1 deletion SampleAppSwift5/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target 'SampleApp_Swift' do
use_frameworks!


pod 'SKYLINK'
pod 'SKYLINK', '~> 2.2'
# If facing issues with installation, please use:
# pod 'SKYLINK', :git => 'https://github.com/Temasys/SKYLINK-iOS.git'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class MultiVideoCallViewController: SKConnectableVC, SKYLINKConnectionLifeCycleD
self.activityIndicator.stopAnimating()
reloadParticipants()
}
func connection(_ connection: SKYLINKConnection, didChangeVideoSize videoSize: CGSize, videoView: UIView!, peerId: String) {
func connection(_ connection: SKYLINKConnection, didChangeVideoSize videoSize: CGSize, videoView: UIView!, peerId: String, mediaId: String) {
if videoSize.height > 0 && videoSize.width > 0 {
let correspondingContainerView = containerViewForVideoView(videoView: videoView)
if correspondingContainerView != localVideoContainerView {
Expand All @@ -248,9 +248,13 @@ class MultiVideoCallViewController: SKConnectableVC, SKYLINKConnectionLifeCycleD
peersInfos[peerIds[i]] = ["videoView" : videoView, "videoSize" : videoSize, "isAudioMuted" : isAudioMuted, "isVideoMuted" : isVideoMuted]
}
}
videoView.frame = (videoAspectSegmentControl.selectedSegmentIndex == 0 || correspondingContainerView.isEqual(localVideoContainerView))
? aspectFillRectForSize(insideSize: videoSize, containedInRect: correspondingContainerView.frame)
: AVMakeRect(aspectRatio: videoSize, insideRect: correspondingContainerView.bounds)

if (videoAspectSegmentControl.selectedSegmentIndex == 0 || correspondingContainerView.isEqual(localVideoContainerView)) {
// TODO: do we need to update frame here?
videoView!.frame = aspectFillRectForSize(insideSize: videoSize, containedInRect: correspondingContainerView.bounds)
} else {
videoView.frame = AVMakeRect(aspectRatio: videoSize, insideRect: correspondingContainerView.bounds)
}
}
}
func connection(_ connection: SKYLINKConnection, didReceiveRemoteMedia remoteMedia: SKYLINKMedia, remotePeerId: String!) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class VideoCallViewController: SKConnectableVC, SKYLINKConnectionLifeCycleDelega
}
}

func connection(_ connection: SKYLINKConnection, didChangeVideoSize videoSize: CGSize, videoView: UIView!, peerId: String) {
func connection(_ connection: SKYLINKConnection, didChangeVideoSize videoSize: CGSize, videoView: UIView!, peerId: String, mediaId: String) {
if videoSize.height > 0 && videoSize.width > 0 {
_ = [localVideoContainerView, remotePeerVideoContainerView, remotePeerVideoContainerView2].compactMap { $0 }.filter { videoView.isDescendant(of: $0) }.map { videoView.aspectFitRectForSize(insideSize: videoSize, inContainer: $0) }
}
Expand Down

0 comments on commit f8c67f9

Please sign in to comment.