From cd93ea5976b70e4f0ad8a4b5d2b4c8e5bba8d4c8 Mon Sep 17 00:00:00 2001 From: gzerad Date: Fri, 21 Oct 2022 14:48:20 +0300 Subject: [PATCH] 0.4.6 Release --- .../HMSSDKExample.xcodeproj/project.pbxproj | 4 +- .../Login/PreviewViewController.swift | 2 + .../Meeting/HMSSDKInteractor.swift | 15 ++++--- .../Meeting/MeetingViewController.swift | 2 - .../Settings/SettingsViewController.swift | 16 ++------ .../SupportingFiles/Utilities.swift | 28 +++++++++++++ HMSSDK.podspec | 6 +-- Package.swift | 4 +- README.md | 39 +++++++++---------- 9 files changed, 67 insertions(+), 49 deletions(-) diff --git a/Example/HMSSDKExample.xcodeproj/project.pbxproj b/Example/HMSSDKExample.xcodeproj/project.pbxproj index 14595ee..e1bbb00 100644 --- a/Example/HMSSDKExample.xcodeproj/project.pbxproj +++ b/Example/HMSSDKExample.xcodeproj/project.pbxproj @@ -966,7 +966,7 @@ CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 305; DEVELOPMENT_TEAM = 5N85PP82A9; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; INFOPLIST_FILE = HMSSDKExample/SupportingFiles/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -1001,7 +1001,7 @@ CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 305; DEVELOPMENT_TEAM = 5N85PP82A9; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; INFOPLIST_FILE = HMSSDKExample/SupportingFiles/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; diff --git a/Example/HMSSDKExample/Login/PreviewViewController.swift b/Example/HMSSDKExample/Login/PreviewViewController.swift index 1a45ab5..13a8cbc 100644 --- a/Example/HMSSDKExample/Login/PreviewViewController.swift +++ b/Example/HMSSDKExample/Login/PreviewViewController.swift @@ -36,11 +36,13 @@ class PreviewViewController: UIViewController { if let videoTrack = track as? HMSLocalVideoTrack { self.videoTrack = videoTrack previewView.setVideoTrack(videoTrack) + publishVideoButton.isSelected = videoTrack.isMute() publishVideoButton.isHidden = false } if let audioTrack = track as? HMSLocalAudioTrack { self.audioTrack = audioTrack + publishAudioButton.isSelected = audioTrack.isMute() publishAudioButton.isHidden = false } } diff --git a/Example/HMSSDKExample/Meeting/HMSSDKInteractor.swift b/Example/HMSSDKExample/Meeting/HMSSDKInteractor.swift index fce1181..4aad7c1 100644 --- a/Example/HMSSDKExample/Meeting/HMSSDKInteractor.swift +++ b/Example/HMSSDKExample/Meeting/HMSSDKInteractor.swift @@ -66,15 +66,14 @@ final class HMSSDKInteractor: HMSUpdateListener { hmsSDK = HMSSDK.build { sdk in sdk.appGroup = "group.live.100ms.videoapp" - let videoSettings = HMSVideoTrackSettings(codec: .VP8, - resolution: .init(width: 320, height: 180), - maxBitrate: 512, - maxFrameRate: 25, - cameraFacing: .front, - trackDescription: "Just a normal video track", videoPlugins: self.videoPlugins) + sdk.trackSettings = HMSTrackSettings.build { videoSettingsBuilder, audioSettingsBuilder in + videoSettingsBuilder.initialMuteState = UserDefaults.standard.publishVideo ? .unmute : .mute + videoSettingsBuilder.videoPlugins = self.videoPlugins + + audioSettingsBuilder.initialMuteState = UserDefaults.standard.publishAudio ? .unmute : .mute + audioSettingsBuilder.audioSource = self.audioSource(for: sdk) + } - let audioSettings = HMSAudioTrackSettings(maxBitrate: 32, trackDescription: "Just a normal audio track", audioSource: self.audioSource(for: sdk)) - sdk.trackSettings = HMSTrackSettings(videoSettings: videoSettings, audioSettings: audioSettings) sdk.logger = self } } diff --git a/Example/HMSSDKExample/Meeting/MeetingViewController.swift b/Example/HMSSDKExample/Meeting/MeetingViewController.swift index ec036bf..130a72c 100644 --- a/Example/HMSSDKExample/Meeting/MeetingViewController.swift +++ b/Example/HMSSDKExample/Meeting/MeetingViewController.swift @@ -890,7 +890,6 @@ final class MeetingViewController: UIViewController, UIDocumentPickerDelegate { return } videoTrack.setMute(!sender.isSelected) - UserDefaults.standard.set(sender.isSelected, forKey: Constants.publishVideo) sender.isSelected = !sender.isSelected NotificationCenter.default.post(name: Constants.updateVideoCellButton, object: nil, @@ -899,7 +898,6 @@ final class MeetingViewController: UIViewController, UIDocumentPickerDelegate { @IBAction private func micTapped(_ sender: UIButton) { viewModel?.switchAudio(isOn: sender.isSelected) - UserDefaults.standard.set(sender.isSelected, forKey: Constants.publishAudio) sender.isSelected = !sender.isSelected } diff --git a/Example/HMSSDKExample/Settings/SettingsViewController.swift b/Example/HMSSDKExample/Settings/SettingsViewController.swift index c7c81cd..811d32c 100644 --- a/Example/HMSSDKExample/Settings/SettingsViewController.swift +++ b/Example/HMSSDKExample/Settings/SettingsViewController.swift @@ -27,21 +27,13 @@ class SettingsViewController: UIViewController { @IBOutlet weak var publishVideoSwitch: UISwitch! { didSet { - if let isOn = UserDefaults.standard.object(forKey: Constants.publishVideo) as? Bool { - publishVideoSwitch.setOn(isOn, animated: false) - } else { - publishVideoSwitch.isOn = true - } + publishVideoSwitch.isOn = UserDefaults.standard.publishVideo } } @IBOutlet weak var publishAudioSwitch: UISwitch! { didSet { - if let isOn = UserDefaults.standard.object(forKey: Constants.publishAudio) as? Bool { - publishAudioSwitch.setOn(isOn, animated: false) - } else { - publishAudioSwitch.isOn = true - } + publishAudioSwitch.isOn = UserDefaults.standard.publishAudio } } @@ -160,8 +152,8 @@ class SettingsViewController: UIViewController { func save() { let userDefaults = UserDefaults.standard - userDefaults.set(publishVideoSwitch.isOn, forKey: Constants.publishVideo) - userDefaults.set(publishAudioSwitch.isOn, forKey: Constants.publishAudio) + userDefaults.publishVideo = publishVideoSwitch.isOn + userDefaults.publishAudio = publishAudioSwitch.isOn userDefaults.set(!maximumRowsField.text!.isEmpty ? maximumRowsField.text : "2", forKey: Constants.maximumRows) userDefaults.set(!audioPollDelayField.text!.isEmpty ? audioPollDelayField.text : "2", diff --git a/Example/HMSSDKExample/SupportingFiles/Utilities.swift b/Example/HMSSDKExample/SupportingFiles/Utilities.swift index ce0e7d7..bbe1533 100644 --- a/Example/HMSSDKExample/SupportingFiles/Utilities.swift +++ b/Example/HMSSDKExample/SupportingFiles/Utilities.swift @@ -160,3 +160,31 @@ extension UIView { subview.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true } } + +extension UserDefaults { + var publishAudio: Bool { + get { + if let value = object(forKey: Constants.publishAudio) as? Bool { + return value + } + + return true + } + set { + set(newValue, forKey: Constants.publishAudio) + } + } + + var publishVideo: Bool { + get { + if let value = object(forKey: Constants.publishVideo) as? Bool { + return value + } + + return true + } + set { + set(newValue, forKey: Constants.publishVideo) + } + } +} diff --git a/HMSSDK.podspec b/HMSSDK.podspec index 789993a..b5cf26e 100644 --- a/HMSSDK.podspec +++ b/HMSSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HMSSDK' - s.version = '0.4.5' + s.version = '0.4.6' s.summary = 'HMS Videoconferencing iOS SDK' s.description = <<-DESC @@ -10,8 +10,8 @@ TODO: Add long description of the pod here. s.homepage = 'https://github.com/100mslive/100ms-ios-sdk/' s.license = { :type => 'MIT'} s.author = { 'Dmitry Fedoseyev' => 'dmitry@100ms.live', 'Yogesh Singh' => 'yogesh@100ms.live', 'Pawan Dixit' => 'pawan@100ms.live'} - s.source = { :http => 'https://github.com/100mslive/100ms-ios-sdk/releases/download/0.4.5/HMSSDK.xcframework.zip', - :sha256 => '36080316ac8299b81ecc067efe4cbe2481e683a037e106daaad45c6ad19773fd' + s.source = { :http => 'https://github.com/100mslive/100ms-ios-sdk/releases/download/0.4.6/HMSSDK.xcframework.zip', + :sha256 => 'd72f3f800fc117e51fb8afd51323e8ed3e28c782f4d7cb4a357e601c9139eacf' } s.ios.deployment_target = '12.0' s.vendored_frameworks = 'HMSSDK.xcframework' diff --git a/Package.swift b/Package.swift index 406a53a..4a9292b 100644 --- a/Package.swift +++ b/Package.swift @@ -14,8 +14,8 @@ let package = Package( targets: [ .binaryTarget( name: "HMSSDK", - url: "https://github.com/100mslive/100ms-ios-sdk/releases/download/0.4.5/HMSSDK.xcframework.zip", - checksum: "36080316ac8299b81ecc067efe4cbe2481e683a037e106daaad45c6ad19773fd" + url: "https://github.com/100mslive/100ms-ios-sdk/releases/download/0.4.6/HMSSDK.xcframework.zip", + checksum: "d72f3f800fc117e51fb8afd51323e8ed3e28c782f4d7cb4a357e601c9139eacf" ), .binaryTarget( name: "WebRTC", diff --git a/README.md b/README.md index 08e9772..020a6e0 100644 --- a/README.md +++ b/README.md @@ -230,30 +230,29 @@ Once Join succeeds, all the callbacks keep coming on every change in the room an ```swift // Basic Usage hms = HMSSDK.build() // ensure to keep an instance of HMSSDK alive in the class as an instance property -let config = HMSConfig(userID: "userID", roomID: "roomID", authToken: "authToken") +let config = HMSConfig(userName: "user name", authToken: "auth token") hms?.join(config: config, delegate: self) // Advanced Usage -hms = HMSSDK.build { (hms) in - hms.logLevel = .verbose - hms.analyticsLevel = .verbose - let videoSettings = HMSVideoTrackSettings(maxBitrate: 512, - maxFrameRate: 25, - cameraFacing: .front, - trackDescription: "Just a normal video track") - let audioSettings = HMSAudioTrackSettings(maxBitrate: 32, trackDescription: "Just a normal audio track") - hms.trackSettings = HMSTrackSettings(videoSettings: videoSettings, audioSettings: audioSettings) - hms.logger = self - } - -let config = HMSConfig(userName: "userName", - userID: "userID", - roomID: "roomID", - authToken: "authToken", - shouldSkipPIIEvents: true, - metaData: "someMetaData", - endpoint: "wss://myWebSocketEndpoint/ws") +hms = HMSSDK.build { (sdk) in + sdk.appGroup = "group.live.100ms.videoapp" + + sdk.trackSettings = HMSTrackSettings.build { videoSettingsBuilder, audioSettingsBuilder in + videoSettingsBuilder.initialMuteState = .mute + videoSettingsBuilder.videoPlugins = self.videoPlugins + + audioSettingsBuilder.initialMuteState = .mute + audioSettingsBuilder.audioSource = self.audioSource(for: sdk) + } + + sdk.logger = self +} + +let config = HMSConfig(userName: "user name", + authToken: "auth token", + metaData: "some metadata", + captureNetworkQualityInPreview: true) hms?.join(config: config, delegate: self)