NativePeerConnectionFactory class

Per-call peer connection factory.

Wraps a native NativePeerConnectionFactory (Android / iOS / macOS) so each call owns an isolated AudioDeviceModule.

All methods route to the underlying factory by sending its factoryId over the method channel.

Properties

factoryId String
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createLocalMediaStream(String label) Future<MediaStream>
Creates an empty local media stream backed by this factory.
createPeerConnection(Map<String, dynamic> configuration, [Map<String, dynamic> constraints = const {}]) Future<RTCPeerConnection>
Builds a peer connection that lives inside this factory.
dispose() Future<void>
Disposes the underlying native factory.
getDisplayMedia(Map<String, dynamic> mediaConstraints) Future<MediaStream>
Captures the screen against this factory.
getRtpReceiverCapabilities(String kind) Future<RTCRtpCapabilities>
getRtpSenderCapabilities(String kind) Future<RTCRtpCapabilities>
getUserMedia(Map<String, dynamic> mediaConstraints) Future<MediaStream>
Captures user media against this factory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestCapturePermission() Future<bool>
Requests Android screen-capture permission. The granted projection data lives on this factory's GetUserMediaImpl, so the subsequent getDisplayMedia call must be issued through this same instance.
resumeAudio() Future<void>
Resumes a previously suspendAudio'd factory.
startLocalRecording() Future<void>
stopLocalRecording() Future<void>
suspendAudio() Future<void>
Suspends this factory's audio capture + playback. Use when another factory needs exclusive access to mic/speaker resources (multicall scenario). Native impl
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({Map<String, dynamic>? options}) Future<NativePeerConnectionFactory>
Builds a fresh per-call factory. Initializes the WebRTC plugin if it hasn't been initialized yet.