Use AVAudioSession.sharedInstance in Hyperloop JS file

140 Views Asked by At

How can I use AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient, with: .mixWithOthers) in a JS file? I want to play sounds on top of music without causing the music from any source to stop. I am able to do it for Apple music, but the music doesn't restart for Pandora, Spotify ect.

var AVAudioSession = require('AVFoundation/AVAudioSession');              
AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient,with: .mixWithOthers)
0

There are 0 best solutions below