PeerConnection.Observer

tee3.webrtc

## 接口 PeerConnection.Observer

- 封闭类:
    PeerConnection

      public static interface PeerConnection.Observer

  Java version of PeerConnectionObserver.

- - ### 方法概要

    所有方法 实例方法 抽象方法 默认方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `onAddStream(MediaStream stream)` Triggered when media is received on a new stream from remote peer.
    `void` | `onAddTrack(RtpReceiver receiver, MediaStream[] mediaStreams)` Triggered when a new track is signaled by the remote peer, as a result of setRemoteDescription.
    `void` | `onDataChannel(DataChannel dataChannel)` Triggered when a remote peer opens a DataChannel.
    `void` | `onIceCandidate(IceCandidate candidate)` Triggered when a new ICE candidate has been found.
    `void` | `onIceCandidatesRemoved(IceCandidate[] candidates)` Triggered when some ICE candidates have been removed.
    `void` | `onIceConnectionChange(PeerConnection.IceConnectionState newState)` Triggered when the IceConnectionState changes.
    `void` | `onIceConnectionReceivingChange(boolean receiving)` Triggered when the ICE connection receiving status changes.
    `void` | `onIceGatheringChange(PeerConnection.IceGatheringState newState)` Triggered when the IceGatheringState changes.
    `void` | `onRemoveStream(MediaStream stream)` Triggered when a remote peer close a stream.
    `void` | `onRenegotiationNeeded()` Triggered when renegotiation is necessary.
    `void` | `onSignalingChange(PeerConnection.SignalingState newState)` Triggered when the SignalingState changes.
    `default void` | `onTrack(RtpTransceiver transceiver)` Triggered when the signaling from SetRemoteDescription indicates that a transceiver will be receiving media from a remote endpoint.

- - ### 方法详细资料

    - #### onSignalingChange

          void onSignalingChange(PeerConnection.SignalingState newState)

      Triggered when the SignalingState changes.

    - #### onIceConnectionChange

          void onIceConnectionChange(PeerConnection.IceConnectionState newState)

      Triggered when the IceConnectionState changes.

    - #### onIceConnectionReceivingChange

          void onIceConnectionReceivingChange(boolean receiving)

      Triggered when the ICE connection receiving status changes.

    - #### onIceGatheringChange

          void onIceGatheringChange(PeerConnection.IceGatheringState newState)

      Triggered when the IceGatheringState changes.

    - #### onIceCandidate

          void onIceCandidate(IceCandidate candidate)

      Triggered when a new ICE candidate has been found.

    - #### onIceCandidatesRemoved

          void onIceCandidatesRemoved(IceCandidate[] candidates)

      Triggered when some ICE candidates have been removed.

    - #### onAddStream

          void onAddStream(MediaStream stream)

      Triggered when media is received on a new stream from remote peer.

    - #### onRemoveStream

          void onRemoveStream(MediaStream stream)

      Triggered when a remote peer close a stream.

    - #### onDataChannel

          void onDataChannel(DataChannel dataChannel)

      Triggered when a remote peer opens a DataChannel.

    - #### onRenegotiationNeeded

          void onRenegotiationNeeded()

      Triggered when renegotiation is necessary.

    - #### onAddTrack

          void onAddTrack(RtpReceiver receiver,
                          MediaStream[] mediaStreams)

      Triggered when a new track is signaled by the remote peer, as a result of setRemoteDescription.

    - #### onTrack

          default void onTrack(RtpTransceiver transceiver)

      Triggered when the signaling from SetRemoteDescription indicates that a transceiver will be receiving media from a remote endpoint. This is only called if UNIFIED_PLAN semantics are specified. The transceiver will be disposed automatically.