ScreenCaptureParameters
Screen sharing configurations.
public class ScreenCaptureParameters { public static class VideoCaptureParameters { public int bitrate = 0; public int framerate = 15; public int width = 1280; public int height = 720; public int contentHint = Constants.SCREEN_CAPTURE_CONTENT_HINT_MOTION; @CalledByNative("VideoCaptureParameters") public int getBitrate() { return bitrate; } @CalledByNative("VideoCaptureParameters") public int getFramerate() { return framerate; } @CalledByNative("VideoCaptureParameters") public int getWidth() { return width; } @CalledByNative("VideoCaptureParameters") public int getHeight() { return height; } @CalledByNative("VideoCaptureParameters") public int getContentHint() { return contentHint; } @Override public String toString() { return "VideoCaptureParameters{" + "bitrate=" + bitrate + ", framerate=" + framerate + ", width=" + width + ", height=" + height + ", contentHint=" + contentHint + '}'; } } public static class AudioCaptureParameters { public int sampleRate = 16000; public int channels = 2; public int captureSignalVolume = 100; public boolean allowCaptureCurrentApp = true; @CalledByNative("AudioCaptureParameters") public int getSampleRate() { return sampleRate; } @CalledByNative("AudioCaptureParameters") public int getChannels() { return channels; } @CalledByNative("AudioCaptureParameters") public int getCaptureSignalVolume() { return captureSignalVolume; } @Override public String toString() { return "AudioCaptureParameters{" + "sampleRate=" + sampleRate + ", channels=" + channels + ", captureSignalVolume=" + captureSignalVolume + ", allowCaptureCurrentApp=" + allowCaptureCurrentApp + '}'; } } public boolean captureAudio = false; public VideoCaptureParameters videoCaptureParameters = new VideoCaptureParameters(); public boolean captureVideo = true; public AudioCaptureParameters audioCaptureParameters = new AudioCaptureParameters(); @CalledByNative public boolean isCaptureAudio() { return captureAudio; } @CalledByNative public VideoCaptureParameters getVideoCaptureParameters() { return videoCaptureParameters; } @CalledByNative public boolean isCaptureVideo() { return captureVideo; } @CalledByNative public AudioCaptureParameters getAudioCaptureParameters() { return audioCaptureParameters; } @Override public String toString() { return "ScreenCaptureParameters{" + "captureAudio=" + captureAudio + ", videoCaptureParameters=" + videoCaptureParameters + ", captureVideo=" + captureVideo + ", audioCaptureParameters=" + audioCaptureParameters + '}'; } }
Attributes
- captureAudio
- Determines whether to capture system audio during screen sharing:
true
: Capture system audio.false
: (Default) Do not capture system audio.
Note:- Due to system limitations, capturing system audio is only applicable to Android API level 29 and later (that is, Android 10 and later).
- To improve the success rate of capturing system audio during screen sharing, ensure that you have called the setAudioScenario method and set the audio scenario to
AUDIO_SCENARIO_GAME_STREAMING
.
- captureVideo
- Whether to capture the screen when screen sharing:
true
: (Default) Capture the screen.false
: Do not capture the screen.
Note: Due to system limitations, the capture screen is only applicable to Android API level 21 and above, that is, Android 5 and above.
Classes
- VideoCaptureParameters
- The video configuration for the shared screen stream. See VideoCaptureParameters.
- AudioCaptureParameters
- The audio configuration for the shared screen stream. See AudioCaptureParameters.