Class StreamPeerConnectionFactory

  • All Implemented Interfaces:

    
    public final class StreamPeerConnectionFactory
    
                        

    Builds a factory that provides PeerConnections when requested.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final EglBase eglBase
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final EglBase getEglBase() Represents the EGL rendering context.
      final StreamPeerConnection makePeerConnection(CoroutineScope coroutineScope, PeerConnection.RTCConfiguration configuration, StreamPeerType type, MediaConstraints mediaConstraints, Function1<MediaStream, Unit> onStreamAdded, Function2<StreamPeerConnection, StreamPeerType, Unit> onNegotiationNeeded, Function2<IceCandidate, StreamPeerType, Unit> onIceCandidateRequest, Integer maxPublishingBitrate) Builds a StreamPeerConnection that wraps the WebRTC PeerConnection and exposes several helpful handlers.
      final VideoSource makeVideoSource(Boolean isScreencast) Builds a VideoSource from the factory that can be used for regular video share (camera) or screen sharing.
      final VideoTrack makeVideoTrack(VideoSource source, String trackId) Builds a VideoTrack from the factory that can be used for regular video share (camera) or screen sharing.
      final AudioSource makeAudioSource(MediaConstraints constraints) Builds an AudioSource from the factory that can be used for audio sharing.
      final AudioTrack makeAudioTrack(AudioSource source, String trackId) Builds an AudioTrack from the factory that can be used for regular video share (camera) or screen sharing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StreamPeerConnectionFactory

        StreamPeerConnectionFactory(Context context)
        Parameters:
        context - Used to build the underlying native components for the factory.
    • Method Detail

      • getEglBase

         final EglBase getEglBase()

        Represents the EGL rendering context.

      • makePeerConnection

         final StreamPeerConnection makePeerConnection(CoroutineScope coroutineScope, PeerConnection.RTCConfiguration configuration, StreamPeerType type, MediaConstraints mediaConstraints, Function1<MediaStream, Unit> onStreamAdded, Function2<StreamPeerConnection, StreamPeerType, Unit> onNegotiationNeeded, Function2<IceCandidate, StreamPeerType, Unit> onIceCandidateRequest, Integer maxPublishingBitrate)

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

        Parameters:
        coroutineScope - Scope used for asynchronous operations.
        configuration - The PeerConnection.RTCConfiguration used to set up the connection.
        type - The type of connection, either a subscriber of a publisher.
        mediaConstraints - Constraints used for audio and video tracks in the connection.
        onStreamAdded - Handler when a new MediaStream gets added.
        onNegotiationNeeded - Handler when there's a new negotiation.
        onIceCandidateRequest - Handler whenever we receive IceCandidates.
      • makeVideoSource

         final VideoSource makeVideoSource(Boolean isScreencast)

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

        Parameters:
        isScreencast - If we're screen sharing using this source.
      • makeVideoTrack

         final VideoTrack makeVideoTrack(VideoSource source, String trackId)

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

        Parameters:
        source - The VideoSource used for the track.
        trackId - The unique ID for this track.
      • makeAudioSource

         final AudioSource makeAudioSource(MediaConstraints constraints)

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

        Parameters:
        constraints - The constraints used to change the way the audio behaves.
      • makeAudioTrack

         final AudioTrack makeAudioTrack(AudioSource source, String trackId)

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

        Parameters:
        source - The AudioSource used for the track.
        trackId - The unique ID for this track.