public class

ApplicationController

extends DataStream
java.lang.Object
   ↳ org.ocast.core.DataStream
     ↳ org.ocast.core.ApplicationController

Class Overview

Provides means to control the web application. The ApplicationController also gives you access to the MediaController which provides your application with basic cast control functions. A reference to the ApplicationController can be obtained using the DeviceManager class via the getApplicationController method.

Summary

Public Constructors
ApplicationController(DialService dialService, Driver driver)
Public Methods
void join(Runnable onSuccess, Consumer<Throwable> onFailure)
Joins the web application on the device.
void manageStream(DataStream stream)
Used to get control over a user's specific stream
void onMessage(JSONObject message)
Subclass must implement this method to manage incoming messages
void start(Runnable onSuccess, Consumer<Throwable> onFailure)
Starts the web application on the device.
void stop(Runnable onSuccess, Consumer<Throwable> onFailure)
Stops the web application on the device
[Expand]
Inherited Methods
From class org.ocast.core.DataStream
From class java.lang.Object

Public Constructors

public ApplicationController (DialService dialService, Driver driver)

Public Methods

public void join (Runnable onSuccess, Consumer<Throwable> onFailure)

Joins the web application on the device. Fails if another web application is already running on the device.

Parameters
onSuccess to be called in case of success.
onFailure to be called in case of error

public void manageStream (DataStream stream)

Used to get control over a user's specific stream

Parameters
stream custom stream to be managed

public void onMessage (JSONObject message)

Subclass must implement this method to manage incoming messages

Parameters
message the incoming message

public void start (Runnable onSuccess, Consumer<Throwable> onFailure)

Starts the web application on the device. Will restart the web application if it is already running on the device.

Parameters
onSuccess to be called in case of success.
onFailure to be called in case of error

public void stop (Runnable onSuccess, Consumer<Throwable> onFailure)

Stops the web application on the device

Parameters
onSuccess to be called in case of success.
onFailure to be called in case of error