Skip to content

Commit

Permalink
No BT on iOS (#96)
Browse files Browse the repository at this point in the history
* Use .playback instead of .playAndRecord for subscriber

* Widen the saved item a bit on iPad, so it looks nicer.
  • Loading branch information
CasperMok authored Mar 14, 2023
1 parent 672356a commit 6d9e8cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ extension RTSDataStore: SubscriptionManagerDelegate {
audioTrack = track
setAudio(true)
// Configure the AVAudioSession with our settings.
Utils.configureAudioSession()
Utils.configureAudioSession(isSubscriber: true)
}

public func onStatsReport(report: MCStatsReport) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ class Utils {
* - When the Subscriber's audioTrack is rendered, for e.g. at MillicastManager.subRenderAudio(track: MCAudioTrack?).
* - When the AVAudioSession route changes, for e.g. at MillicastSA.routeChangeHandler(notification: Notification).
*/
public static func configureAudioSession() {
public static func configureAudioSession(isSubscriber: Bool = false) {
let logTag = "[Configure][Audio][Session] "
let session = AVAudioSession.sharedInstance()
print(logTag + "Now: " + Utils.audioSessionStr(session: session))
print(logTag + "Available inputs count: \(session.availableInputs?.count ?? 0)")
do {
#if os(iOS)
try session.setCategory(AVAudioSession.Category.playAndRecord, mode: .videoChat, options: [.mixWithOthers])
// For subscriber, we only need playback. Not recording is required.
try session.setCategory(isSubscriber ? .playback : .playAndRecord,
mode: .videoChat,
options: [.mixWithOthers])
#else
try session.setCategory(AVAudioSession.Category.playback, options: [.mixWithOthers])
try session.setCategory(.playback, options: [.mixWithOthers])
#endif
try session.setActive(true)
} catch {
Expand Down
2 changes: 1 addition & 1 deletion RTSViewer/iOS/RecentStreams/RecentStreamsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct RecentStreamsScreen: View {
}
}
}
.frame(maxWidth: 400)
.frame(maxWidth: 600)

Text(
text: "recent-streams.option-separator.label",
Expand Down
2 changes: 1 addition & 1 deletion RTSViewer/iOS/RecentStreams/SavedStreamsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct SavedStreamsScreen: View {
})
}
}
.frame(maxWidth: 400)
.frame(maxWidth: 600)
}
}
.layoutPriority(1)
Expand Down

0 comments on commit 6d9e8cb

Please sign in to comment.