Blancduman / mediasoup-client-flutter

Flutter version of the mediasoup-client library.
MIT License
106 stars 52 forks source link

no sound when phone screen off or application is on background #65

Open fullflash opened 1 year ago

fullflash commented 1 year ago

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 ?

Blancduman commented 1 year ago

Hello. You need permission to work in background.

duyjack commented 1 year ago

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?

fullflash commented 10 months ago

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 commented 10 months ago

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