Skip to content

Commit

Permalink
Merge pull request #1296 from shogo4405/feature/rename-loopback-to-mo…
Browse files Browse the repository at this point in the history
…nitoring

Rename loopback to isMonitoringEnabled
  • Loading branch information
shogo4405 authored Sep 20, 2023
2 parents 552430f + 8d9e3aa commit 5e43171
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Examples/iOS/LiveViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class LiveViewController: UIViewController {
rtmpStream.videoOrientation = orientation
}

rtmpStream.loopback = DeviceUtil.isHeadphoneConnected()
rtmpStream.isMonitoringEnabled = DeviceUtil.isHeadphoneConnected()

rtmpStream.audioSettings = AudioCodecSettings(
bitRate: 64 * 1000
Expand Down Expand Up @@ -331,9 +331,9 @@ final class LiveViewController: UIViewController {
}
audioDevicePicker.reloadAllComponents()
if DeviceUtil.isHeadphoneDisconnected(notification) {
rtmpStream.loopback = false
rtmpStream.isMonitoringEnabled = false
} else {
rtmpStream.loopback = DeviceUtil.isHeadphoneConnected()
rtmpStream.isMonitoringEnabled = DeviceUtil.isHeadphoneConnected()
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Media/IOAudioUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ final class IOAudioUnit: NSObject, IOUnit {
}
var muted = false
weak var mixer: IOMixer?
var loopback = false {
var isMonitoringEnabled = false {
didSet {
if loopback {
if isMonitoringEnabled {
monitor.startRunning()
} else {
monitor.stopRunning()
Expand Down
8 changes: 4 additions & 4 deletions Sources/Net/NetStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ open class NetStream: NSObject {
/// Specifies the delegate of the NetStream.
public weak var delegate: (any NetStreamDelegate)?

/// Specifies the loopback audio or not.
public var loopback: Bool {
/// Specifies the audio monitoring enabled or not.
public var isMonitoringEnabled: Bool {
get {
mixer.audioIO.loopback
mixer.audioIO.isMonitoringEnabled
}
set {
mixer.audioIO.loopback = newValue
mixer.audioIO.isMonitoringEnabled = newValue
}
}

Expand Down

0 comments on commit 5e43171

Please sign in to comment.