Comparison with TOI/JS 1.0

This 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.0

The 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.

TOI/JS 2.0 introduces a new <videoplane> HTML element to position the video. The <videoplane> element is a Motorola proprietary variant of the <video> element which is defined in HTML 5 but more suitable for usage in an STB. The SVG Portal Application uses the <video> element defined in SVG Tiny 1.2 to show video.

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/JS 1.0 (accessed through toiEnv) TOI/JS 2.0 (accessed through toi)
applicationService (ToiApplicationService.idl) applicationService (ToiApplicationService.idl)
schedulerService (ToiSchedulerService.idl) schedulerService (ToiSchedulerService.idl)
softwareService (ToiSoftwareService.idl)
system (ToiSystem.idl) platformService (ToiPlatformService.idl).
audioOutputService (ToiAudioOutputService.idl).
videoOutputService (ToiVideoOutputService.idl)
uriLoader (ToiUriLoader.idl) applicationService (ToiApplicationService.idl)
input (ToiInput.idl) Handling Input
browserWindow (ToiBrowserWindow.idl)
dvbTuners (ToiDvbTunerCollection.idl)
mediaRepository (ToiMediaRepository.idl) assetManagerService (ToiAssetManagerService.idl)
ToiInformationObject createInformationObject (ToiInformationObject.idl) informationService (ToiInformationService.idl)
ToiMediaPlayer createMediaPlayer (ToiMediaPlayer.idl) mediaService (ToiMediaService.idl)
ToiMediaRecorder createMediaRecorder (ToiMediaRecorder.idl) mediaService (ToiMediaService.idl)
dlnaService (ToiDlnaService.idl)
audioOutputService (ToiAudioOutputService.idl)
videoOutputService (ToiVideoOutputService.idl)
storageService (ToiStorageService.idl)
frontPanelService (ToiFrontPanelService.idl)
dvbEitService (ToiDvbEitService.idl)

TOI Interface Comparison

Information Service

Difference 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 Service

The 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 Service

Not yet supported.

UriLoader Service

The UriLoader service (void loadUri (in string uri, in string mimeType)) is integrated into the ApplicationService ( void loadUri (in string uri, in string mimeType) ).

Input Service

The 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.

BrowserWindow

The 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 Service

System Service has been removed in TOI/JS 2.0. The functions supplied by it are integrated into other TOI/JS 2.0 services.

TOI/JS 1.0 TOI/JS 2.0 Comment
void reboot() void rebootNow() reboot is handled by rebootNow in PlatformService
void setStandbyMode(in boolean mode) void setStandby(in boolean mode) setStandbyMode is handled by setStandby in PlatformService
boolean isMuted() getMuteState(in TToiAudioConnectionId connectionId) isMuted is handled by getMuteState in AudioOutputService
void mute(in boolean state) setMuteState(in TToiAudioConnectionId connectionId, in boolean state) mute is handled by setMuteState in AudioOutputService
unsigned long getVolume() unsigned long getVolume(in TToiAudioConnectionId connectionId) getVolume is integrated into the AudioOutputService
void setVolume(in unsigned long level) void setVolume(in TToiAudioConnectionId connectionId, in unsigned long level) setVolume is integrated into the AudioOutputService
void restartPortal() void kill (in long applicationId) restartPortal is done by stopping the portal application in ApplicationService
unsigned long getAspectRatio() ToiVideoOutputConfigurationAdaptiveFormatInfo getAdaptiveFullscreenMode(...) getAspectRatio is handled by getAdaptiveFullscreenMode in VideoOutputService
void setAspectRatio(in unsigned long aspectRatio) void setAdaptiveFullscreenMode(...) setAspectRatio is handled by setAdaptiveFullscreenMode in VideoOutputService

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 Service

The 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 Service

There 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 Service

There 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 Service

Not yet supported.

TOI/JS 2.0 New Services

Information Object Mapping from TOI/JS 1.0 to TOI/JS 2.0

In 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

TOI/JS 1.0 TOI/JS 2.0 Comment
motorola-vip<model number> motorola-vip<model number>
kreatel-ip-stb-rev-<revision number> kreatel-ip-stb-rev-<revision number>
tornado-hw-rev-1 Removed
<software name (generic)> <software name (generic)>
<splash name (generic)> <splash name (generic)>

Platform objects

TOI/JS 1.0 TOI/JS 2.0 Comment
infocast2.conf CFG_INFOCAST
config.tvout Replaced by VideoOutput Service
config.tvcolorsystem Replaced by VideoOutput Service
cfg.video.color_system Replaced by VideoOutput Service
cfg.video.tv_scart_mode Replaced by VideoOutput Service
cfg.video.hdmi_mode Replaced by VideoOutput Service
cfg.video.hdmi_color_space Replaced by VideoOutput Service
cfg.video.hdmi_ignore_edid Replaced by VideoOutput Service
cfg.video.hdmi_auto_activate Replaced by VideoOutput Service
cfg.video.component_mode Replaced by VideoOutput Service
config.initialvolume Replaced by AudioOutput Service
config.audiocontrol Replaced by AudioOutput Service
config.screenarea.width Removed
config.screenarea.height Removed
config.safearea.width Removed
config.safearea.height Removed
config.visiblearea.x Removed
config.visiblearea.y Removed
config.visiblearea.width Removed
config.visiblearea.height Removed
config.keyboardlayout Removed
config.standbyled Replaced by FrontPanel Service
cfg.standby.mode Removed
cfg.media.useprogramcache Removed
sysconf.utctime VAR_UTCTIME
cfg.iipdistribution CFG_IIPDISTRIBUTION
var.ip._dhcp.240 VAR_IP_DHCP_240
var.ip._dhcp.241 VAR_IP_DHCP_241
var.ip._dhcp.242 VAR_IP_DHCP_242
var.ip._dhcp.243 VAR_IP_DHCP_243
notification.reboot CMD_REBOOT
cfg.media.streamer CFG_MEDIA_STREAMER
CFG_MEDIA_AUDIO_AUTOSELECTION
CFG_MEDIA_AUDIO_LANGUAGEPRIORITY
CFG_MEDIA_AUDIO_FORMATPRIORITY
CFG_MEDIA_SUBTITLING_TYPEPRIORITY
CFG_MEDIA_SUBTITLING_MODEPRIORITY
CFG_MEDIA_SUBTITLING_AUTOSELECTION
CFG_MEDIA_SUBTITLING_LANGUAGEPRIORITY
cfg.tvoutput.videooutputconfiguration
CFG_STANDBY_BOOTPOLICY

Application objects

TOI/JS 1.0 TOI/JS 2.0 Comment
cfg.locale.ui CFG_LOCALE_UI
config.defaultfontsize Removed
config.minfontsize Removed
config.onscreenkeyboard Removed
config.onscreenkeyboarddelay Removed
config.onscreenkeyboardmode Removed
config.onscreenkeyboardtoggle Removed
config.proxylist CFG_PORTAL_PROXYLIST
config.portalurls CFG_PORTAL_WHITELISTURLS
config.portalshowwebcontent Removed
config.portalarea.width Removed
config.portalarea.height Removed
config.homepageurl Removed
config.bookmarks.<vid> Removed
config.tvaspectratio Replaced by VideoOutput Service
config.4_3arcmethod Replaced by VideoOutput Service
cfg.media.video.16_9method Replaced by VideoOutput Service
config.1staudiolanguage Handled by cfg.media.audio.* in platform objects
config.2ndaudiolanguage Handled by cfg.media.audio.* in platform objects
config.soundmode Handled by cfg.media.audio.* in platform objects
config.subtitling Handled by cfg.media.subtitling.* in platform objects
config.1stsublanguage Handled by cfg.media.subtitling.* in platform objects
config.2ndsublanguage Handled by cfg.media.subtitling.* in platform objects
config.subhoh Handled by cfg.media.subtitling.* in platform objects
config.channeltable CFG_MEDIA_CHANNELTABLE
config.vodmarks.<id> Removed
notification.reboot CMD_REBOOT
CFG_PORTAL_FRAMEBUFFER_WIDTH
CFG_PORTAL_FRAMEBUFFER_HEIGHT
CFG_WEBKIT_USERAGENT

System objects

TOI/JS 1.0 TOI/JS 2.0 Comment
config.ipsetting CFG_IP_ETH0_MODE
config.ipaddress CFG_IP_ETH0_ADDR(static mode)
VAR_IP_ETH0_ADDR(dhcp mode)
config.ipnetmask CFG_IP_ETH0_MASK(static mode)
VAR_IP_ETH0_MASK(dhcp mode)
config.ipgateway CFG_IP_GATEWAY(static mode)
VAR_IP_GATEWAY(dhcp mode)
config.dns1 CFG_IP_DNS1(static mode)
VAR_IP_DNS1(dhcp mode)
config.dns2 CFG_IP_DNS2(static mode)
VAR_IP_DNS2(dhcp mode)
config.metachannel VAR_IP_METACHANNEL
config.macaddress CONST_IP_ETH0_MAC
config.serialnumber CONST_HW_SERIALNUMBER
config.firmwareversion CONST_FW_VERSION
config.manufacturer CONST_HW_MANUFACTURER
config.productname CONST_HW_PRODUCTNAME
config.productdisplayname Removed
config.macrovisionsupport CONST_CAPABILITIES_MACROVISION
config.build.* CONST_SW_BRANCH
CONST_SW_DATE
CONST_SW_HOST
CONST_SW_TIME
CONST_SW_USER
CONST_SW_VERSION
config.architecture.* CFG_ARCHITECTURE_TARGET
CFG_ARCHITECTURE_BOOTIMAGECOMPATIBILITY
CFG_ARCHITECTURE_DBLCOMPATIBILITY
var.io.state VAR_IO_STATE
var.rcu.low_battery VAR_RCU_LOWBATTERY