Class MediaConnection

java.lang.Object
com.flashphoner.fpwcsapi.webrtc.MediaConnection

public class MediaConnection extends Object
Wrapper around WebRTC peer-connection
  • Field Details

  • Constructor Details

    • MediaConnection

      public MediaConnection(String id, org.webrtc.VideoSink remoteVideoSink, WebRTCMediaProvider webRTCMediaProvider, LooperExecutor executor, String videoCodec, org.webrtc.PeerConnection.RTCConfiguration mediaOptions)
      New MediaConnection
      Parameters:
      id - unique identifier
      remoteVideoSink - videoSink
      webRTCMediaProvider - WebRTCMediaProvider
      executor - thread executor
      videoCodec - preferred video codec
      mediaOptions - media connection configuration
  • Method Details

    • getRemoteDescription

      public org.webrtc.SessionDescription getRemoteDescription()
    • createOffer

      public void createOffer(MediaConnectionOptions options)
      Create offer based on media options
      Parameters:
      options -
    • createAnswer

      public void createAnswer()
      Create answer based on media options
    • setOptions

      public void setOptions(MediaConnectionOptions options)
      Set media options
      Parameters:
      options -
    • switchRenderer

      public void switchRenderer(org.webrtc.VideoSink newVideoRender)
      Switch the stream to a new renderer
      Parameters:
      newVideoRender -
    • setRemoteDescription

      public void setRemoteDescription(org.webrtc.SessionDescription sdp)
      Set remote SDP
      Parameters:
      sdp -
    • muteAudio

      public void muteAudio()
      Disable audio track
    • unmuteAudio

      public void unmuteAudio()
      Enable audio track
    • isAudioMuted

      public boolean isAudioMuted()
      Returns:
      true if audio track is disabled
    • muteVideo

      public void muteVideo()
      Disable video track
    • unmuteVideo

      public void unmuteVideo()
      Enable video track
    • setVideoBandwidth

      public void setVideoBandwidth(Integer minBitrate, Integer maxBitrate)
      Set stream bandwidth
      Parameters:
      minBitrate -
      maxBitrate -
    • isKbs

      public boolean isKbs(Integer value)
    • isVideoMuted

      public boolean isVideoMuted()
      Returns:
      true if video track is disabled
    • getId

      public String getId()
    • setMediaConnectionListener

      public void setMediaConnectionListener(MediaConnectionListener mediaConnectionListener)
      Set listener
      Parameters:
      mediaConnectionListener -
    • addH264PackectizationMode

      public static String addH264PackectizationMode(String sdpDescription)
    • getStats

      public void getStats(org.webrtc.RTCStatsCollectorCallback rtcStatsReport)