Module webrtc.java

Interface PeerConnectionObserver


  • public interface PeerConnectionObserver
    RTCPeerConnection callback interface.
    Author:
    Alex Andres
    • Method Detail

      • onSignalingChange

        default void onSignalingChange​(RTCSignalingState state)
        The signaling state has changed. This state change is the result of either setLocalDescription or setRemoteDescription being invoked.
        Parameters:
        state - The new signaling state.
      • onConnectionChange

        default void onConnectionChange​(RTCPeerConnectionState state)
        The RTCPeerConnection connectionState has changed.
        Parameters:
        state - The new connection state.
      • onIceConnectionChange

        default void onIceConnectionChange​(RTCIceConnectionState state)
        The RTCPeerConnection's ICE connection state has changed.
        Parameters:
        state - The new ICE connection state.
      • onStandardizedIceConnectionChange

        default void onStandardizedIceConnectionChange​(RTCIceConnectionState state)
        Called any time the standards-compliant RTCIceConnectionState changes.
        Parameters:
        state - The new ICE connection state.
      • onIceConnectionReceivingChange

        default void onIceConnectionReceivingChange​(boolean receiving)
        The ICE connection is receiving status changes.
        Parameters:
        receiving - True if receiving status changes, false otherwise.
      • onIceGatheringChange

        default void onIceGatheringChange​(RTCIceGatheringState state)
        The RTCPeerConnection's ICE gathering state has changed.
        Parameters:
        state - The new ICE gathering state.
      • onIceCandidate

        void onIceCandidate​(RTCIceCandidate candidate)
        A new RTCIceCandidate is made available to the application.
        Parameters:
        candidate - The new ICE candidate.
      • onIceCandidateError

        default void onIceCandidateError​(RTCPeerConnectionIceErrorEvent event)
        A failure occurred when gathering ICE candidates.
        Parameters:
        event - The ICE gathering error event.
      • onIceCandidatesRemoved

        default void onIceCandidatesRemoved​(RTCIceCandidate[] candidates)
        ICE candidates have been removed.
        Parameters:
        candidates - The removed ICE candidates.
      • onAddStream

        default void onAddStream​(MediaStream stream)
        Media is received on a new stream from the remote peer.
        Parameters:
        stream - The new media stream.
      • onRemoveStream

        default void onRemoveStream​(MediaStream stream)
        The remote peer has closed a stream.
        Parameters:
        stream - The closed media stream.
      • onDataChannel

        default void onDataChannel​(RTCDataChannel dataChannel)
        The remote peer has opened a RTCDataChannel.
        Parameters:
        dataChannel - The opened data channel.
      • onRenegotiationNeeded

        default void onRenegotiationNeeded()
        Triggered to inform the application that session negotiation needs to be done (i.e. a createOffer call followed by setLocalDescription).
      • onAddTrack

        default void onAddTrack​(RTCRtpReceiver receiver,
                                MediaStream[] mediaStreams)
        New incoming media has been negotiated for a specific RTCRtpReceiver, and that receiver's track has been added to any associated remote MediaStreams.

        Note: This is called with both Plan B and Unified Plan semantics. Unified Plan users should prefer OnTrack, OnAddTrack is only called as backwards compatibility (and is called in the exact same situations as OnTrack).

        Parameters:
        receiver - The created RTP receiver.
        mediaStreams - Associated remote MediaStreams of the negotiated media track.
      • onRemoveTrack

        default void onRemoveTrack​(RTCRtpReceiver receiver)
        Called when signaling indicates that media will no longer be received on a track.

        With Plan B semantics, the given receiver will have been removed from the PeerConnection and the track muted.

        With Unified Plan semantics, the receiver will remain but the transceiver will have changed direction to either "SendOnly" or "Inactive".

        Parameters:
        receiver - The RTP receiver of the removed track.
      • onTrack

        default void onTrack​(RTCRtpTransceiver transceiver)
        Called when signaling indicates a transceiver will be receiving media from the remote peer, as a result of SetRemoteDescription.

        Note: This will only be called if Unified Plan semantics are specified.

        Parameters:
        transceiver - The RTP transceiver of the created track.