mediasoup-client-flutter icon indicating copy to clipboard operation
mediasoup-client-flutter copied to clipboard

no sound when phone screen off or application is on background

Open fullflash opened this issue 1 year ago • 4 comments

there are plugins to achive this with playing audio files like https://pub.dev/packages/just_audio_background but how to make it work with mediasoup consuming audio ?

fullflash avatar Oct 17 '22 04:10 fullflash

Hello. You need permission to work in background.

Blancduman avatar Jan 02 '23 21:01 Blancduman

Hi @Blancduman ,

I have problem about audio in background at IOS. I have enabled VOIP at setting when build IOS but sometimes, I can't listen anyone even app consume success. Do you have any idea for this?

duyjack avatar Jul 18 '23 09:07 duyjack

Hello. You need permission to work in background.

we have configured project to support ios background modes for android you need permission to run foreground service but how to achieve running mediasoup when app is in background screen has been turned off and event when app is terminated.

<key>UIBackgroundModes</key>
	<array>
		<string>audio</string>
		<string>fetch</string>
		<string>remote-notification</string>
		<string>voip</string>
	</array>

fullflash avatar Oct 20 '23 09:10 fullflash

in our to properly support push to talk you need to integrate IOS Native Push To Talk framework. https://developer.apple.com/documentation/pushtotalk/creating_a_push_to_talk_app

we manage to play in the background, wake app from suspended state and even from terminated state. The only issue is that this framework handles Audio Session and there is option to disable audio session handling for flutter_webrtc plugin.

image

fullflash avatar Nov 03 '23 14:11 fullflash