StreamPeerConnectionFactory

class StreamPeerConnectionFactory(context: Context, audioUsage: Int = defaultAudioUsage, audioProcessing: ManagedAudioProcessingFactory? = null)

Builds a factory that provides PeerConnections when requested.

Constructors

Link copied to clipboard
constructor(context: Context, audioUsage: Int = defaultAudioUsage, audioProcessing: ManagedAudioProcessingFactory? = null)

Properties

Link copied to clipboard
val eglBase: EglBase

Represents the EGL rendering context.

Functions

Link copied to clipboard

True if the audio processing is enabled, false otherwise.

Link copied to clipboard
fun makeAudioSource(constraints: MediaConstraints = MediaConstraints()): AudioSource

Builds an AudioSource from the factory that can be used for audio sharing.

Link copied to clipboard
fun makeAudioTrack(source: AudioSource, trackId: String): AudioTrack

Builds an AudioTrack from the factory that can be used for regular video share (camera) or screen sharing.

Link copied to clipboard
fun makePeerConnection(coroutineScope: CoroutineScope, configuration: PeerConnection.RTCConfiguration, type: StreamPeerType, mediaConstraints: MediaConstraints, onStreamAdded: (MediaStream) -> Unit? = null, onNegotiationNeeded: (StreamPeerConnection, StreamPeerType) -> Unit? = null, onIceCandidateRequest: (IceCandidate, StreamPeerType) -> Unit? = null, maxPublishingBitrate: Int): StreamPeerConnection

Builds a StreamPeerConnection that wraps the WebRTC PeerConnection and exposes several helpful handlers.

Link copied to clipboard
fun makeVideoTrack(source: VideoSource, trackId: String): VideoTrack

Builds a VideoTrack from the factory that can be used for regular video share (camera) or screen sharing.

Link copied to clipboard

Sets the audio processing on or off.

Link copied to clipboard
fun setAudioRecordDataCallback(callback: (audioFormat: Int, channelCount: Int, sampleRate: Int, sampleData: ByteBuffer) -> Unit)

Set to get callbacks when audio input from microphone is received. This can be example used to detect whether a person is speaking while muted.

Link copied to clipboard
fun setAudioSampleCallback(callback: (JavaAudioDeviceModule.AudioSamples) -> Unit)

Set to get callbacks when audio input from microphone is received. This can be example used to detect whether a person is speaking while muted.

Link copied to clipboard

Toggles the audio processing on and off.