Audio issue in iPhone 6s and 12mini

Facing strange issue in two devices, iPhone 6s and 12 mini. Not getting audio from the media when ringer is off, while playing media. Is this device specific issue, any settings issue, OS issue or ultimately app issue. But this works fine with you tube and other media apps.

It sounds like you're using the default audio session category. If you're playing media, you should probably use category .playback, which is not influenced by the ringer switch. Here are a couple of links to documentation:

https://developer.apple.com/documentation/avfaudio/avaudiosession/

https://developer.apple.com/documentation/avfaudio/avaudiosession/1771734-setcategory

https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html

Audio issue in iPhone 6s and 12mini
 
 
Q