Skip to content

Commit

Permalink
Merge pull request #58 from 100mslive/0.4.6Release
Browse files Browse the repository at this point in the history
0.4.6 Release
  • Loading branch information
gzerad authored Oct 21, 2022
2 parents c64e075 + cd93ea5 commit 3467d68
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 49 deletions.
4 changes: 2 additions & 2 deletions Example/HMSSDKExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions Example/HMSSDKExample/Login/PreviewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
15 changes: 7 additions & 8 deletions Example/HMSSDKExample/Meeting/HMSSDKInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 0 additions & 2 deletions Example/HMSSDKExample/Meeting/MeetingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}

Expand Down
16 changes: 4 additions & 12 deletions Example/HMSSDKExample/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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",
Expand Down
28 changes: 28 additions & 0 deletions Example/HMSSDKExample/SupportingFiles/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
6 changes: 3 additions & 3 deletions HMSSDK.podspec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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' => '[email protected]', 'Yogesh Singh' => '[email protected]', 'Pawan Dixit' => '[email protected]'}
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'
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 3467d68

Please sign in to comment.