| Motorola Mobility Confidential Restricted. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comparison with TOI/JS 1.0This page is intended to briefly describe the main difference between TOI/JS 1.0 and TOI J/S 2.0. Overview of difference between TOI/JS 1.0 and TOI/JS 2.0The toi object is used to access KreaTV platform services in TOI/JS 2.0 instead of toiEnv in TOI/JS 1.0. TOI/JS 2.0 also supplies 3 more ways to access KreaTV platform service:
In general, the changes from TOI/JS 1.0 to TOI/JS 2.0 are quite big. Almost all the parameters and return values in interfaces have been changed, even when the interface names and functionalities are similar. The InformationService is added in TOI/JS 2.0, which was not exposed as a service in TOI/JS 1.0. This changes how information objects are accessed, but instead provides full access to the InformationService The table below shows the changes how to access different services. Details are described in later sections.
TOI Interface ComparisonInformation ServiceDifference on how to access information object between TOI/JS 1.0 and TOI/JS 2.0: In TOI/JS 1.0, the following sample shows how information objects were created, set and retrieved. Objects were directly created by using the createInformationObject method via toiEnv.
function load() {
var io = toiEnv.createInformationObject("my.test.object");
io.setValue("test", io.STORAGE_VOLATILE);
var value = io.getValue();
}
Note: TOI/JS 2.0 has supported string constants, and all public objects have their uniform names. Then TOI developers can use constants for information object names. For example, "my.test.object" object is defined as MY_TEST_OBJECT now, which is instead of previous hardcoded strings. The following sample shows how to create, set and retrieve information objects. Objects were created by using the setObject method with a previously undefined name via informationService in TOI/JS 2.0.
function load() {
is = toi.informationService;
is.setObject(is.MY_TEST_OBJECT,"test", is.STORAGE_VOLATILE);
var value = is.getObject(is.MY_TEST_OBJECT);
}
Difference on how to subscribe to value changes on information objects between TOI/JS 1.0 and TOI/JS 2.0: In TOI/JS 1.0, the following sample shows how subscribtions were done.
function TestToiInformationObjectEventHandler() {
var io = toiEnv.createInformationObject("my.test.object");
io.addEventListener(io.ON_OBJECT_CHANGED, onEvent);
}
In TOI/JS 2.0, the following sample shows how to subscribe to value change events. The subscription is done via the Information Service.
function TestToiInformationObjectEventHandler() {
is = toi.informationService;
is.addEventListener(is.ON_OBJECTS_CHANGED, onEvent);
is.subscribeObject(onEvent, is.MY_TEST_OBJECT, true);
}
Functionality Difference in Information Service between TOI/JS 1.0 and TOI/JS 2.0: In TOI/JS 2.0, support for transactions have been added. Transactions are introduced because sometimes it is important to get or set a collection of objects in one atomic operation. In the Information Service this is solved with functions that gets or sets several objects at once (getObjects() and setObjects() ). Media ServiceThe Media Service is only used to create media player or media recorder instances. In TOI/JS 2.0, media player instances are created via toi.mediaService.createPlayerInstance or toi.mediaService.createPipPlayerInstance instead of toiEnv.createMediaPlayer in TOI/JS 1.0. Media recorder instances are created via toi.mediaService.createRecorderInstance instead of toiEnv.createMediaRecorder in TOI/JS 1.0. The basic functionality of media player and media recorder have not changed in TOI/JS 2.0. But there are new functions and parameters and return values have changed. One notable change of the media player is that ToiMediaPlayer does not contain "readonly attribute ToiVideoWindow window" any more. ToiWindow and ToiVideoWindow are removed in TOI/JS 2.0. Software ServiceNot yet supported. UriLoader ServiceThe UriLoader service (void loadUri (in string uri, in string mimeType)) is integrated into the ApplicationService ( void loadUri (in string uri, in string mimeType) ). Input ServiceThe Input Service has been removed in TOI/JS 2.0. Input handling is supported through standardized JavaScript DOM level 3 event model using the KeyboardEvent interface. BrowserWindowThe BrowserWindow has been deleted in TOI/JS 2.0. BrowserWindow is used to mix graphics and video in TOI/JS 1.0. The mixing of graphics and video is handled by portal specific features such as CSS and video elements. System ServiceSystem Service has been removed in TOI/JS 2.0. The functions supplied by it are integrated into other TOI/JS 2.0 services.
The AudioOutput Service and VideoOutput Service are introduced to replace some information objects of TOI/JS 1.0. The detail mapping tables are listed in later section MediaRepository ServiceThe MediaRepository Service has been removed in TOI/JS 2.0 and been replaced with the AssetManager Service. Notable interface changes are: long getStartTime (in DOMString assetId) long getEndTime (in DOMString assetId) No similar interfaces are supplied in TOI/JS 2.0. The start time can be retrieved from the date property by using the constant PROPERTY_INFO_DATE. The end time can be calculated out by the value of PROPERTY_INFO_DATE and PROPERTY_SYSTEM_DURATION properties. Application ServiceThere is no major difference in Application Service between TOI/JS 1.0 and TOI/JS 2.0, only some new methods have been added. Scheduler ServiceThere is no major difference in Schedule service between TOI/JS 1.0 and TOI/JS 2.0, only some new methods have been added and the events use other attributes. DvbTuner ServiceNot yet supported. TOI/JS 2.0 New Services
Information Object Mapping from TOI/JS 1.0 to TOI/JS 2.0In TOI/JS 2.0, many information objects defined in TOI/JS 1.0 have been removed, renamed or replaced by services. The tables below show the mapping of TOI/JS 1.0 and TOI/JS 2.0. Firmware objects
Platform objects
Application objects
System objects
|