JavaScript Sender App

JavaScript API can be used for web sites running on mobile or desktop web browsers. It is compatible with any modern browsers that support web sockets.JavaScript API supports ONLY Chrome , FireFox , Opera.

Include the library in your SmartTV applications HTML page

API Usage

Discovery

In order for a client to start or join a MultiScreen experience, the client application must be able to discover a compatible SmartTV service. The API manages searching for compatible services and only requires a few lines of code. Below is a chunk of code from the Hello World mobile web application

Important

JS Libary version 2.3.3 is changed search API. It works on only Chrome, Firefox, Opera except IE, Safari

Connect

Once a compatible SmartTV is discovered, you can launch and connect to your SmartTV application from you mobile client. Application management is centralized to a single class (Application) that handles starting, stopping, installing, and connecting to your application. Here is a quick example.

Communicate

Once your client has started and established a connection with the SmartTV application, You can use the applications channel to send and receive messages between the devices. The Application class extends Channel, so in the example below we will continue with application instance we created earlier. Applications also provide notifications when someone connects, disconnects, and publishes a message.