Closed bhavinb98 closed 6 months ago
As I know captureAudio
can only capture the system audio, Is your test case is same?
Yes.
One of my use-case - share a video from phone on screen share.
The audio cannot be heard by other people and its also not available in the recording from Agora.
Does the audio from the system (include system APPs) or other third-party APPs?
The YouTube app is one of the primary sources, other sources could be inbuilt media players, or 3rd party media players like VLC. Playing a video on a web browser is also used sometimes.
The YouTube app is one of the primary sources, other sources could be inbuilt media players, or 3rd party media players like VLC. Playing a video on a web browser is also used sometimes.
Does this issue occur on both Android/iOS? Can you share the configuration of the devices?
There are some limitations in some devices. https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_screencaptureparameters2.html#class_screencaptureparameters2__parameters
Tested on Android API 33 emulator, as well as Motorola phones running Android 12.
Will test on iOS and update
I have upgraded to Android 14, API 34. Flutter version 3.19.3 Using agora plugin version 6.3.0. I have noticed the same issue. No captured audio.
I have added these permissions in my AndroidManifest.xml
<uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
<uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
@littleGnAl I might've found the issue.
I have to manually call the engine.muteLocalAudioStream(false);
after starting screen share. This behaviour wasn't there in 6.2.2.
But it should automatically publish because of the channel media options I am setting here -
await _engine.updateChannelMediaOptionsEx(
options: ChannelMediaOptions(
publishMicrophoneTrack: true,
publishCameraTrack: !isScreenBeingShared,
publishScreenTrack: isScreenBeingShared,
publishSecondaryScreenTrack: isScreenBeingShared,
publishScreenCaptureAudio: isScreenBeingShared, // This part here is true when screen share starts
publishScreenCaptureVideo: isScreenBeingShared,
clientRoleType: ClientRoleType.clientRoleBroadcaster,
),
Another question I have is, are the screen capture audio track and the microphone audio track same?
I think it may be a bug on 6.2.2, if the audio has been muted, there's nothing to publish.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.
It works fine on 6.2.2. After updating the plugin, the device audio is not being shared anymore. Flutter version - 3.13.9
Screen Share Start Method -
Screen Share Stop Method -
Update Media Options Method -