Closed marcqtan closed 1 year ago
any update on this? I think i should use foreground service? I've researched and found the values for appState. https://android.googlesource.com/platform/system/media/+/master/audio/include/system/audio_policy.h
typedef enum {
APP_STATE_IDLE = 0, /* client is idle: cannot capture */
APP_STATE_FOREGROUND, /* client has a foreground service: can capture */
APP_STATE_TOP, /* client has a visible UI: can capture and select use case */
} app_state_t;
We are taking a look at this @marcqtan
@marcqtan, apologies for the belated reply.
This isn't a bug. When an application is minimized, there's privacy concerns if it continues to capture audio.
cc'ing @kapilmishr, @Daniel085, since this is a product question.
I'm using opentok to publish and subscribe to audio and video, but there's an issue with publishing audio after putting the application in the background (minimize), it stops working.
The audio stops working at exactly 1 minute after minimizing the device.
Note: I can still hear other audio publishers.
The audio works again as soon as I put the app in the foreground.
Logs:
minimized the app and after 1 minute:
As you can see the state is set to 0? I'm not sure what that means. But that's the reason why the audio cannot be heard anymore. It seems like the microphone of the device is being muted?
And as soon as I put the app again in the foreground, I'm receiving this logs: As you can see it is setting it to state: 2 again. The audio works now at this point.
Device: Samsung Galaxy A31 - Android 10 Opentok version: 2.18.1, also tried 2.15.3 and still got the same issue.