Skip to content

Commit

Permalink
fix:#2110 deactivate the old session when playing again (#2111)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvn-haiphung-dn authored Sep 22, 2023
1 parent fff7940 commit 4ba79d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/RNTrackPlayer/RNTrackPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ public class RNTrackPlayer: RCTEventEmitter, AudioSessionControllerDelegate {
try? AVAudioSession.sharedInstance().setCategory(sessionCategory, mode: sessionCategoryMode, options: sessionCategoryOptions)
}
if (setActive) {
try? AVAudioSession.sharedInstance().setActive(true)
try? audioSessionController.deactivateSession()
try? audioSessionController.activateSession()
}
}

Expand Down

0 comments on commit 4ba79d0

Please sign in to comment.