Yahoo! Connected TV's device communication model enables new and exciting TV-viewing experiences driven by the sophisticated controls available on today's mobile phones, tablets, and laptops. A new generation of TV App capabilities is now available to consumers, including gesture-based, multi-display, and multi-user features for intensive gaming, multimedia, and social applications.
The Yahoo! Connected TV (YCTV) Device Communication platform provides two-way message-passing between Internet-enabled devices (such as AndroidOs & iOS mobile phones, tablets, and laptops) and consumer electronic devices (such as TVs, DVD/Blu-ray players, and DVRs) running the Yahoo! Connected TV platform. These messages are communicated through a new protocol created by Yahoo! using SSL-wrapped sockets over local TCP/IP. Message payloads can contain either JSON-encoded strings or predefined commands. Keyboard, navigation, media control, and app-specific messages are communicated using a publish/subscribe model and direct method calls.
The Device Communication model supports two types of application programming interfaces (APIs):
KONtx.remotedevice. The KONtx.remotedevice interface is only available when it is enabled on the Connected TV platform.
Check that the Boolean system.features.devicecommunication is true in the config-oem.xml file. Event callbacks are use to relay messages from the device to the app via the Engine.
The following conventions are followed for this interface
remoteDevice.
remoteDevice object will only be available if the feature is enabled on the platform. You can check this by looking at
system.features.devicecommunication in the config-oem.xml file.
In addtion to this JavaScript KONtx.remoteDevice interface for apps, you will also find device communication documentation here:
The KONtx.remotedevice singleton provides the interface for apps to communicate with remote devices, including mobile phones, tablets, and laptops.
The KONtx.remotedevice interface provides callbacks to handle events to and from the remote device.
|
Callback |
Type |
Description |
Device Protocol |
|---|---|---|---|
|
|
|
Callback function triggered when a remote device
|
|
|
|
|
Callback function triggered when the remote |
|
|
|
|
Callback function triggered when a remote device |
|
|
|
|
Callback function triggered when a remote device |
|
|
|
|
Callback function triggered when the remote |
|
|
|
|
Callback function triggered when a remote device |
|
|
|
|
Callback function triggered when a remote device |
|
|
|
|
Callback function triggered when the remote device
|
|
|
|
|
Callback function triggered when the remote device
|
|
|
|
|
Callback function triggered when a message is |
|
|
|
|
Callback function triggered when a remote device |
|
|
|
|
Callback function triggered when a remote device |
|
The KONtx.remotedevice interface provides callbacks to handle events to and from the remote device. The following example shows how to register
and unregister callback handlers for remote device callback events.
|
Property |
Type |
Description |
|---|---|---|
|
|
|
If |
Array<String> findKeyboardSubscribers()Finds all subscribers to keyboard state changes.
Array<String> findMediaControlSubscribers()Finds all subscribers to media control state changes.
Array<String> findSubscribers(String type, String subject)Finds all subscribers for a giventypeandsubject.
Array<String> findWidgetSubscribers()Finds all subscribers for the current app.
RemoteDeviceInfo getInstance(String instanceId)Gets metadata about a particularinstanceIdidentifying a remote device.
Array<RemoteDeviceInfo> getInstances(Array<String> instanceIds)Gets metadata about the remote device(s) identified by an array ofString instanceIds.
Boolean publishKeyboardMessage(Object data, [Array<String> instanceIds])Publishes a keyboard message. TheObject dataparameter is the keyboard state payload sent to remote device(s).
Boolean publishMediaControlMessage(Object data, [Array<String> instanceIds])Publishes a media control message. TheObject dataparameter is the transport control state payload sent to remote device(s).
Boolean publishMediaLaunchMessage(Object data, [Array<String> instanceIds])Publishes a message to devices identifying media to be launched. TheObject dataparameter is the media metadata payload sent to remote device(s).
Boolean publishMediaLaunchUrlMessage(String title, String url, [Array<String> instanceIds])Publishes a message to devices identifying media to be launched by URL.
Boolean publishMessage(Object payload)Publishes a given message. The parameterObject payloadcontains the message string as well as message metadata.
Boolean publishWidgetMessage(String data, [Array<String> instanceIds])Publishes a app message. Publishes the given JSON-encoded string messagedatato identified listeners.
Boolean returnRemoteCall(RemoteDeviceEvent event)Respond to an incoming call from a remote device by replying to the device with the originalRemoteDeviceEvent eventobject received, with return data populated in theevent.resultproperty.
Boolean sendRemoteCall(RemoteDeviceEvent event)Initiate a remote call by sending aRemoteDeviceEvent eventto a remote device.