mapbox-navigation-ios
mapbox-navigation-ios copied to clipboard
[Bug]: Re-routing sound playback stops music playback in other applications.
Mapbox Navigation SDK version
v2.1.0-rc.2
Steps to reproduce
- Start music playback in application of choice (e.g. Shazam, Apple Music).
- Try to request route, which is likely to be not optimal and re-route will occur.
- Observe behavior.
To be able to easily reproduce this issue it makes sense to implement NavigationViewControllerDelegate.navigationViewController(_:shouldRerouteFrom:)) and modify code internally in update(to:) to always re-route:
let willReroute = delegate?.router(self, shouldRerouteFrom: location) ?? false
To continuously playback voice instruction, it's possible to modify RouteController.updateSpokenInstructionProgress(status:willReroute:) to always use the same voice instruction. For example:
func updateSpokenInstructionProgress(status: NavigationStatus, willReRoute: Bool) {
announcePassage(of: routeProgress.currentLegProgress.currentStepProgress.step.instructionsSpokenAlongStep![0], routeProgress: routeProgress)
}
Expected behavior
It is expected that volume of music playback in different application goes down when voice instruction and re-route sounds are played and returns back to normal when Navigation SDK voice instruction/re-route sound finishes.
Actual behavior
Music playback in another application completely stops.
Is this a one-time issue or a repeatable issue?
repeatable