mapbox-navigation-ios icon indicating copy to clipboard operation
mapbox-navigation-ios copied to clipboard

[Bug]: Re-routing sound playback stops music playback in other applications.

Open MaximAlien opened this issue 4 years ago • 0 comments

Mapbox Navigation SDK version

v2.1.0-rc.2

Steps to reproduce

  1. Start music playback in application of choice (e.g. Shazam, Apple Music).
  2. Try to request route, which is likely to be not optimal and re-route will occur.
  3. 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

MaximAlien avatar Dec 08 '21 21:12 MaximAlien