Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-ios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-ios
Commits
f914d982
Commit
f914d982
authored
4 years ago
by
Kateryna Kostiuk
Browse files
Options
Downloads
Patches
Plain Diff
audio: update audio route only after daemon initialized
Change-Id: Ib2e3f54c5a91a473d9b983415584ef2c33f57d60
parent
cfa0d9b6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Ring/Ring/AppDelegate.swift
+2
-0
2 additions, 0 deletions
Ring/Ring/AppDelegate.swift
Ring/Ring/Services/AudioService.swift
+13
-10
13 additions, 10 deletions
Ring/Ring/Services/AudioService.swift
with
15 additions
and
10 deletions
Ring/Ring/AppDelegate.swift
+
2
−
0
View file @
f914d982
...
...
@@ -119,6 +119,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
// will enumerate and add devices once permission has been granted
self
.
videoService
.
setupInputs
()
self
.
audioService
.
connectAudioSignal
()
// start monitoring for network changes
self
.
networkService
.
monitorNetworkType
()
...
...
This diff is collapsed.
Click to expand it.
Ring/Ring/Services/AudioService.swift
+
13
−
10
View file @
f914d982
...
...
@@ -44,16 +44,6 @@ class AudioService {
init
(
withAudioAdapter
audioAdapter
:
AudioAdapter
)
{
self
.
audioAdapter
=
audioAdapter
let
bluetoothConnected
=
bluetoothAudioConnected
()
let
headphonesConnected
=
headphoneAudioConnected
()
isHeadsetConnected
.
value
=
bluetoothConnected
||
headphonesConnected
// Listen for audio route changes
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector
(
audioRouteChangeListener
(
_
:)),
name
:
AVAudioSession
.
routeChangeNotification
,
object
:
nil
)
}
@objc
private
func
audioRouteChangeListener
(
_
notification
:
Notification
)
{
...
...
@@ -68,6 +58,19 @@ class AudioService {
overrideAudioRoute
()
}
func
connectAudioSignal
()
{
let
bluetoothConnected
=
bluetoothAudioConnected
()
let
headphonesConnected
=
headphoneAudioConnected
()
isHeadsetConnected
.
value
=
bluetoothConnected
||
headphonesConnected
// Listen for audio route changes
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector
(
audioRouteChangeListener
(
_
:)),
name
:
AVAudioSession
.
routeChangeNotification
,
object
:
nil
)
}
func
overrideAudioRoute
()
{
let
bluetoothConnected
=
bluetoothAudioConnected
()
let
headphonesConnected
=
headphoneAudioConnected
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment