| ARRIS Enterprises, Inc. Confidential Information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Migration Guide (TOI2→TOI3)Some effort is required to migrate an existing portal from TOI2 to TOI3. This guide helps you through the major points. While migrating your portal, please keep an eye on the STB log for warnings related to deprecated functionality. InitializationTOI3 does not use an NPAPI plugin as in TOI2/JS. Instead, TOI3 uses web technologies for communication with the KreaTV platform. The protocol details are hidden from the application by a JavaScript wrapper API, which is very similar to the TOI2/JS "toi" object. See the bootstrapping page for more details. FundamentalsUsing web technologies means that each individual function call to TOI3 involves an XmlHttpRequest to the KreaTV platform, so has more overhead than before, but that data structures returned from the platform are now JSON objects. These objects are processed much faster by the browser's JavaScript engine. To optimize on this fact, the APIs in TOI3 make it easier to request more data in one single call, and also provides needed data in notifications from the platform. For example, the Information Service When subscribing to changes on Information Service configuration objects, the In a similar way, when subscribed to changes in media player parameters, the Net ServiceToiNetService has been redesigned in TOI3. The biggest change is the introduction of networks, you can read more about it here. While configuration in TOI2 was performed directly on a particular network device/interface, now configuration is performed indirectly by ToiNetService based on the network's settings. The term interface is used in TOI3 to represent the network interface, not an IP address as it was in TOI2. When getting the STB's IP address, the <sdk_root>/examples/example-html-portal/modules/settings.js
The MAC address is handled in a similar way. ToiNetService allows you to get the IP address, MAC address and other details of the non-active interfaces too. ToiNetService also reduces and simplifies the number of events, and now also includes Wi-Fi related events. Wi-Fi ConnectionIn TOI3 connecting to a Wi-Fi access point requires providing the required information to the service as follows:
Please refer to the ToiNetService API documentation for more information.Media PlayerThe media player works much as before, but for efficiency purposes the The state machine for the Media Player has been simplified, please see the Media Service documentation. Asynchronous operationsAsynchronous operations are handled in a way that is more familiar to JavaScript programmers than before. The new AsyncCallback mechanism allows you to pass an object containing callback functions which will be executed once the asynchronous operation completes. As an example: <sdk_root>/examples/example-html-portal/modules/settings.js
This is used when scanning for Wi-Fi networks and when applying video configuration changes (shown above). Video Output ServiceThe VideoOutput service has had a major overhaul. The new interface shares the philosophy of the old one (session based with incremental configuration steps), but tries to approach output configuration in a modern and more consistent way. Focus has been to improve the ergonomics of the JavaScript interface.
The most noticeable change is that you do all output configuration using one method called
you do
or equivalently
in sequence.
Valid settingsThe information about valid settings in the old Display overridesThe feature of adding exceptions or overrides for HDMI displays with a broken EDID (using
More information about the service and the interface can be found in here: Video Output Service Platform ServiceFunctions related to components have been removed. StaticsThe TOI2/JS concept of statics has been removed, and instead you can now write JSON objects directly. For example, when connecting to a Wi-Fi network and calling <sdk_root>/examples/example-html-portal/modules/wifi/setup.js
ExceptionsException handling is now more aligned with standard JavaScript paradigms. See here for more details on exceptions. Detailed comparisonThe following table lists the changes between TOI2/JS and TOI3 where possible. An exhaustive changelog is also provided.
Unavailable servicesThe following services are not yet available:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||