Class TeaNetwork
java.lang.Object
nl.colorize.multimedialib.renderer.teavm.TeaNetwork
- All Implemented Interfaces:
Network
Sends HTTP requests by delegating them to JavaScript and sending them as
AJAX requests. This does mean that any requests sent from the application
must be allowed by the CORS (Cross Origin Resource Sharing) headers returned
by the server.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnl.colorize.util.Subscribable
<nl.colorize.util.http.URLResponse> boolean
Returns true if this renderer supports peer-to-peer connectios on the current platform.nl.colorize.util.Subscribable
<PeerConnection> Uses WebRTC to open a peer-to-peer connection.nl.colorize.util.Subscribable
<nl.colorize.util.http.URLResponse>
-
Constructor Details
-
TeaNetwork
public TeaNetwork()
-
-
Method Details
-
get
public nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse> get(String url, nl.colorize.util.http.Headers headers) -
post
public nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse> post(String url, nl.colorize.util.http.Headers headers, nl.colorize.util.http.PostData data) -
openPeerConnection
Uses WebRTC to open a peer-to-peer connection. This is implemented in JavaScript using the PeerJS library.- Specified by:
openPeerConnection
in interfaceNetwork
-
isPeerToPeerSupported
public boolean isPeerToPeerSupported()Description copied from interface:Network
Returns true if this renderer supports peer-to-peer connectios on the current platform. SeeNetwork.openPeerConnection()
.- Specified by:
isPeerToPeerSupported
in interfaceNetwork
-