All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.web.webrtc.RTCPeerConnection Maven / Gradle / Ivy

package js.web.webrtc;

import js.lang.Promise;
import js.lang.StringPromise;
import js.lang.VoidPromise;
import js.util.collections.Array;
import js.web.dom.*;
import js.web.mediastreams.MediaStream;
import js.web.mediastreams.MediaStreamTrack;
import js.web.webcrypto.Algorithm;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSByRef;
import org.teavm.jso.JSProperty;

import javax.annotation.Nullable;

/**
 * A WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
 */
public interface RTCPeerConnection extends EventTarget {
    @JSBody(script = "return RTCPeerConnection.prototype")
    static RTCPeerConnection prototype() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return new RTCPeerConnection()")
    static RTCPeerConnection create() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(params = "configuration", script = "return new RTCPeerConnection(configuration)")
    static RTCPeerConnection create(RTCConfiguration configuration) {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(params = "keygenAlgorithm", script = "return RTCPeerConnection.generateCertificate(configuration)")
    static Promise generateCertificate(String keygenAlgorithm) {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(params = "keygenAlgorithm", script = "return RTCPeerConnection.generateCertificate(configuration)")
    static Promise generateCertificate(Algorithm keygenAlgorithm) {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return RTCPeerConnection.getDefaultIceServers()")
    static Array getDefaultIceServers() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSProperty
    boolean isCanTrickleIceCandidates();

    @JSProperty
    RTCPeerConnectionState getConnectionState();

    @JSProperty
    @Nullable
    RTCSessionDescription getCurrentLocalDescription();

    @JSProperty
    @Nullable
    RTCSessionDescription getCurrentRemoteDescription();

    @JSProperty
    RTCIceConnectionState getIceConnectionState();

    @JSProperty
    RTCIceGatheringState getIceGatheringState();

    @JSProperty
    @Nullable
    String getIdpErrorInfo();

    @JSProperty
    @Nullable
    String getIdpLoginUrl();

    @JSProperty
    @Nullable
    RTCSessionDescription getLocalDescription();

    @JSProperty
    @Nullable
    EventListener getOnconnectionstatechange();

    @JSProperty
    void setOnconnectionstatechange(EventListener onconnectionstatechange);

    default void addConnectionStateChangeEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("connectionstatechange", listener, options);
    }

    default void addConnectionStateChangeEventListener(EventListener listener, boolean options) {
        addEventListener("connectionstatechange", listener, options);
    }

    default void addConnectionStateChangeEventListener(EventListener listener) {
        addEventListener("connectionstatechange", listener);
    }

    default void removeConnectionStateChangeEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("connectionstatechange", listener, options);
    }

    default void removeConnectionStateChangeEventListener(EventListener listener, boolean options) {
        removeEventListener("connectionstatechange", listener, options);
    }

    default void removeConnectionStateChangeEventListener(EventListener listener) {
        removeEventListener("connectionstatechange", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOndatachannel();

    @JSProperty
    void setOndatachannel(EventListener ondatachannel);

    default void addDataChannelEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("datachannel", listener, options);
    }

    default void addDataChannelEventListener(EventListener listener, boolean options) {
        addEventListener("datachannel", listener, options);
    }

    default void addDataChannelEventListener(EventListener listener) {
        addEventListener("datachannel", listener);
    }

    default void removeDataChannelEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("datachannel", listener, options);
    }

    default void removeDataChannelEventListener(EventListener listener, boolean options) {
        removeEventListener("datachannel", listener, options);
    }

    default void removeDataChannelEventListener(EventListener listener) {
        removeEventListener("datachannel", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnicecandidate();

    @JSProperty
    void setOnicecandidate(EventListener onicecandidate);

    default void addIceCandidateEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("icecandidate", listener, options);
    }

    default void addIceCandidateEventListener(EventListener listener, boolean options) {
        addEventListener("icecandidate", listener, options);
    }

    default void addIceCandidateEventListener(EventListener listener) {
        addEventListener("icecandidate", listener);
    }

    default void removeIceCandidateEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("icecandidate", listener, options);
    }

    default void removeIceCandidateEventListener(EventListener listener, boolean options) {
        removeEventListener("icecandidate", listener, options);
    }

    default void removeIceCandidateEventListener(EventListener listener) {
        removeEventListener("icecandidate", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnicecandidateerror();

    @JSProperty
    void setOnicecandidateerror(EventListener onicecandidateerror);

    default void addIceCandidateErrorEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("icecandidateerror", listener, options);
    }

    default void addIceCandidateErrorEventListener(EventListener listener, boolean options) {
        addEventListener("icecandidateerror", listener, options);
    }

    default void addIceCandidateErrorEventListener(EventListener listener) {
        addEventListener("icecandidateerror", listener);
    }

    default void removeIceCandidateErrorEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("icecandidateerror", listener, options);
    }

    default void removeIceCandidateErrorEventListener(EventListener listener, boolean options) {
        removeEventListener("icecandidateerror", listener, options);
    }

    default void removeIceCandidateErrorEventListener(EventListener listener) {
        removeEventListener("icecandidateerror", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOniceconnectionstatechange();

    @JSProperty
    void setOniceconnectionstatechange(EventListener oniceconnectionstatechange);

    default void addIceConnectionStateChangeEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("iceconnectionstatechange", listener, options);
    }

    default void addIceConnectionStateChangeEventListener(EventListener listener, boolean options) {
        addEventListener("iceconnectionstatechange", listener, options);
    }

    default void addIceConnectionStateChangeEventListener(EventListener listener) {
        addEventListener("iceconnectionstatechange", listener);
    }

    default void removeIceConnectionStateChangeEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("iceconnectionstatechange", listener, options);
    }

    default void removeIceConnectionStateChangeEventListener(EventListener listener, boolean options) {
        removeEventListener("iceconnectionstatechange", listener, options);
    }

    default void removeIceConnectionStateChangeEventListener(EventListener listener) {
        removeEventListener("iceconnectionstatechange", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnicegatheringstatechange();

    @JSProperty
    void setOnicegatheringstatechange(EventListener onicegatheringstatechange);

    default void addIceGatheringStateChangeEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("icegatheringstatechange", listener, options);
    }

    default void addIceGatheringStateChangeEventListener(EventListener listener, boolean options) {
        addEventListener("icegatheringstatechange", listener, options);
    }

    default void addIceGatheringStateChangeEventListener(EventListener listener) {
        addEventListener("icegatheringstatechange", listener);
    }

    default void removeIceGatheringStateChangeEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("icegatheringstatechange", listener, options);
    }

    default void removeIceGatheringStateChangeEventListener(EventListener listener, boolean options) {
        removeEventListener("icegatheringstatechange", listener, options);
    }

    default void removeIceGatheringStateChangeEventListener(EventListener listener) {
        removeEventListener("icegatheringstatechange", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnnegotiationneeded();

    @JSProperty
    void setOnnegotiationneeded(EventListener onnegotiationneeded);

    default void addNegotiationNeededEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("negotiationneeded", listener, options);
    }

    default void addNegotiationNeededEventListener(EventListener listener, boolean options) {
        addEventListener("negotiationneeded", listener, options);
    }

    default void addNegotiationNeededEventListener(EventListener listener) {
        addEventListener("negotiationneeded", listener);
    }

    default void removeNegotiationNeededEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("negotiationneeded", listener, options);
    }

    default void removeNegotiationNeededEventListener(EventListener listener, boolean options) {
        removeEventListener("negotiationneeded", listener, options);
    }

    default void removeNegotiationNeededEventListener(EventListener listener) {
        removeEventListener("negotiationneeded", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnsignalingstatechange();

    @JSProperty
    void setOnsignalingstatechange(EventListener onsignalingstatechange);

    default void addSignalingStateChangeEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("signalingstatechange", listener, options);
    }

    default void addSignalingStateChangeEventListener(EventListener listener, boolean options) {
        addEventListener("signalingstatechange", listener, options);
    }

    default void addSignalingStateChangeEventListener(EventListener listener) {
        addEventListener("signalingstatechange", listener);
    }

    default void removeSignalingStateChangeEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("signalingstatechange", listener, options);
    }

    default void removeSignalingStateChangeEventListener(EventListener listener, boolean options) {
        removeEventListener("signalingstatechange", listener, options);
    }

    default void removeSignalingStateChangeEventListener(EventListener listener) {
        removeEventListener("signalingstatechange", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnstatsended();

    @JSProperty
    void setOnstatsended(EventListener onstatsended);

    default void addStatSendedEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("statsended", listener, options);
    }

    default void addStatSendedEventListener(EventListener listener, boolean options) {
        addEventListener("statsended", listener, options);
    }

    default void addStatSendedEventListener(EventListener listener) {
        addEventListener("statsended", listener);
    }

    default void removeStatSendedEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("statsended", listener, options);
    }

    default void removeStatSendedEventListener(EventListener listener, boolean options) {
        removeEventListener("statsended", listener, options);
    }

    default void removeStatSendedEventListener(EventListener listener) {
        removeEventListener("statsended", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOntrack();

    @JSProperty
    void setOntrack(EventListener ontrack);

    default void addTrackEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("track", listener, options);
    }

    default void addTrackEventListener(EventListener listener, boolean options) {
        addEventListener("track", listener, options);
    }

    default void addTrackEventListener(EventListener listener) {
        addEventListener("track", listener);
    }

    default void removeTrackEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("track", listener, options);
    }

    default void removeTrackEventListener(EventListener listener, boolean options) {
        removeEventListener("track", listener, options);
    }

    default void removeTrackEventListener(EventListener listener) {
        removeEventListener("track", listener);
    }

    @JSProperty
    Promise getPeerIdentity();

    @JSProperty
    @Nullable
    RTCSessionDescription getPendingLocalDescription();

    @JSProperty
    @Nullable
    RTCSessionDescription getPendingRemoteDescription();

    @JSProperty
    @Nullable
    RTCSessionDescription getRemoteDescription();

    @JSProperty
    @Nullable
    RTCSctpTransport getSctp();

    @JSProperty
    RTCSignalingState getSignalingState();

    VoidPromise addIceCandidate(RTCIceCandidateInit candidate);

    VoidPromise addIceCandidate(RTCIceCandidate candidate);

    RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);

    RTCRtpSender addTrack(MediaStreamTrack track, Array streams);

    RTCRtpTransceiver addTransceiver(MediaStreamTrack trackOrKind, RTCRtpTransceiverInit init);

    RTCRtpTransceiver addTransceiver(String trackOrKind, RTCRtpTransceiverInit init);

    RTCRtpTransceiver addTransceiver(MediaStreamTrack trackOrKind);

    RTCRtpTransceiver addTransceiver(String trackOrKind);

    void close();

    Promise createAnswer(RTCOfferOptions options);

    Promise createAnswer();

    RTCDataChannel createDataChannel(String label, RTCDataChannelInit dataChannelDict);

    RTCDataChannel createDataChannel(String label);

    Promise createOffer(RTCOfferOptions options);

    Promise createOffer();

    RTCConfiguration getConfiguration();

    void setConfiguration(RTCConfiguration configuration);

    StringPromise getIdentityAssertion();

    Array getReceivers();

    Array getSenders();

    Promise getStats(@Nullable MediaStreamTrack selector);

    Array getTransceivers();

    void removeTrack(RTCRtpSender sender);

    void setIdentityProvider(String provider, RTCIdentityProviderOptions options);

    void setIdentityProvider(String provider);

    VoidPromise setLocalDescription(RTCSessionDescriptionInit description);

    VoidPromise setRemoteDescription(RTCSessionDescriptionInit description);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy