You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 2, 2026. It is now read-only.
Hi there, this port is great it just needs background audio when a iOs device is blocked or the screen turns off.
I saw the code at nstudio has been updated to run in this mode and seems to be an easy fix.
The six line change occurs in in ios/player.ts:
playFromUrl function change this:
let audioSession = AVAudioSession.sharedInstance();
let output = audioSession.currentRoute.outputs.lastObject.portType;
to this:
let audioSession = AVAudioSession.sharedInstance();
audioSession.setCategoryWithOptionsError(
AVAudioSessionCategoryAmbient,
AVAudioSessionCategoryOptions.DuckOthers
);
let output = audioSession.currentRoute.outputs.lastObject.portType;
and in playFromFile function change this:
let audioSession = AVAudioSession.sharedInstance();
let output = audioSession.currentRoute.outputs.lastObject.portType;
TNS_Player_Log('output', output);
to this:
let audioSession = AVAudioSession.sharedInstance();
audioSession.setCategoryWithOptionsError(
AVAudioSessionCategoryAmbient,
AVAudioSessionCategoryOptions.DuckOthers
);
let output = audioSession.currentRoute.outputs.lastObject.portType;
TNS_Player_Log('output', output);
I hope this helps someone else who has to dig around this issue.