Class WebRtcProtocolHandler

java.lang.Object
com.openfin.desktop.channel.AbstractProtocolHandler
com.openfin.desktop.channel.webrtc.WebRtcProtocolHandler
All Implemented Interfaces:
DataChannelListener, EventListener, dev.onvoid.webrtc.PeerConnectionObserver

public class WebRtcProtocolHandler
extends AbstractProtocolHandler
implements dev.onvoid.webrtc.PeerConnectionObserver, EventListener, DataChannelListener
  • Field Details

    • peerConnection

      protected dev.onvoid.webrtc.RTCPeerConnection peerConnection
  • Constructor Details

  • Method Details

    • getProtocolOptions

      public ProtocolOptions getProtocolOptions()
      Overrides:
      getProtocolOptions in class AbstractProtocolHandler
    • initializeClient

      public void initializeClient() throws java.lang.Exception
      Overrides:
      initializeClient in class AbstractProtocolHandler
      Throws:
      java.lang.Exception
    • getSupportedOfferProtocol

      protected org.json.JSONObject getSupportedOfferProtocol()
      Overrides:
      getSupportedOfferProtocol in class AbstractProtocolHandler
    • acceptAnswer

      protected void acceptAnswer​(org.json.JSONObject answer, java.util.concurrent.CompletableFuture<java.lang.Boolean> future) throws java.lang.Exception
      Accept answer from a channel provider
      Overrides:
      acceptAnswer in class AbstractProtocolHandler
      Parameters:
      answer - answer object
      future - future for returning true if accepted
      Throws:
      java.lang.Exception - Exception
    • acceptOffer

      protected void acceptOffer​(org.json.JSONObject payload) throws java.lang.Exception
      Overrides:
      acceptOffer in class AbstractProtocolHandler
      Throws:
      java.lang.Exception
    • getSupportedAnswerProtocol

      protected org.json.JSONObject getSupportedAnswerProtocol()
      Overrides:
      getSupportedAnswerProtocol in class AbstractProtocolHandler
    • createAnswer

      protected dev.onvoid.webrtc.RTCSessionDescription createAnswer() throws java.lang.Exception
      Throws:
      java.lang.Exception
    • sendChannelMessage

      public void sendChannelMessage​(java.lang.String action, org.json.JSONObject destionationIdentity, org.json.JSONObject providerIdentity, org.json.JSONObject actionPayload, AckListener ackListener)
      Overrides:
      sendChannelMessage in class AbstractProtocolHandler
    • sendChannelMessageAsync

      public java.util.concurrent.CompletableFuture<Ack> sendChannelMessageAsync​(java.lang.String action, org.json.JSONObject destionationIdentity, org.json.JSONObject providerIdentity, java.lang.Object actionPayload)
      Overrides:
      sendChannelMessageAsync in class AbstractProtocolHandler
    • onSignalingChange

      public void onSignalingChange​(dev.onvoid.webrtc.RTCSignalingState state)
      Specified by:
      onSignalingChange in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onConnectionChange

      public void onConnectionChange​(dev.onvoid.webrtc.RTCPeerConnectionState state)
      Specified by:
      onConnectionChange in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onIceConnectionChange

      public void onIceConnectionChange​(dev.onvoid.webrtc.RTCIceConnectionState state)
      Specified by:
      onIceConnectionChange in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onStandardizedIceConnectionChange

      public void onStandardizedIceConnectionChange​(dev.onvoid.webrtc.RTCIceConnectionState state)
      Specified by:
      onStandardizedIceConnectionChange in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onIceConnectionReceivingChange

      public void onIceConnectionReceivingChange​(boolean receiving)
      Specified by:
      onIceConnectionReceivingChange in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onIceGatheringChange

      public void onIceGatheringChange​(dev.onvoid.webrtc.RTCIceGatheringState state)
      Specified by:
      onIceGatheringChange in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onIceCandidate

      public void onIceCandidate​(dev.onvoid.webrtc.RTCIceCandidate rtcIceCandidate)
      Specified by:
      onIceCandidate in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onIceCandidateError

      public void onIceCandidateError​(dev.onvoid.webrtc.RTCPeerConnectionIceErrorEvent event)
      Specified by:
      onIceCandidateError in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onIceCandidatesRemoved

      public void onIceCandidatesRemoved​(dev.onvoid.webrtc.RTCIceCandidate[] candidates)
      Specified by:
      onIceCandidatesRemoved in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onAddStream

      public void onAddStream​(dev.onvoid.webrtc.media.MediaStream stream)
      Specified by:
      onAddStream in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onRemoveStream

      public void onRemoveStream​(dev.onvoid.webrtc.media.MediaStream stream)
      Specified by:
      onRemoveStream in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onDataChannel

      public void onDataChannel​(dev.onvoid.webrtc.RTCDataChannel dataChannel)
      Specified by:
      onDataChannel in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onRenegotiationNeeded

      public void onRenegotiationNeeded()
      Specified by:
      onRenegotiationNeeded in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onAddTrack

      public void onAddTrack​(dev.onvoid.webrtc.RTCRtpReceiver receiver, dev.onvoid.webrtc.media.MediaStream[] mediaStreams)
      Specified by:
      onAddTrack in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onRemoveTrack

      public void onRemoveTrack​(dev.onvoid.webrtc.RTCRtpReceiver receiver)
      Specified by:
      onRemoveTrack in interface dev.onvoid.webrtc.PeerConnectionObserver
    • onTrack

      public void onTrack​(dev.onvoid.webrtc.RTCRtpTransceiver transceiver)
      Specified by:
      onTrack in interface dev.onvoid.webrtc.PeerConnectionObserver
    • eventReceived

      public void eventReceived​(ActionEvent actionEvent)
      Description copied from interface: EventListener
      Invoked when registered event occurs
      Specified by:
      eventReceived in interface EventListener
      Parameters:
      actionEvent - Event object
      See Also:
      ActionEvent
    • onStateChange

      public void onStateChange​(DataChannel source, DataChannelListener.State state)
      Specified by:
      onStateChange in interface DataChannelListener
    • onMessage

      public void onMessage​(DataChannel source, java.lang.String message)
      Specified by:
      onMessage in interface DataChannelListener
    • cleanup

      protected void cleanup()
      Overrides:
      cleanup in class AbstractProtocolHandler