Migrating H.Browser to Tizen

This topic describes the differences between the H.Browser APIs and the Tizen Samsung Product APIs introduced in Tizen 6.5, and how to convert your H.Browser application to a Tizen Web application.


Related Info


Since Tizen 6.5, H.Browser for hospitality display solutions is no longer supported. The H.Browser features have been replaced by new Tizen Samsung Product APIs, which are extensions of the Tizen Web Device API:

These APIs enable you to implement most H.Browser features, except those not supported in Tizen 6.5.

Some H.Browser features, such as retrieving network and multimedia information, can be implemented using the existing Tizen Web Device and Samsung Product APIs. For more information, see the Tizen Web API references.

API Differences

The following table lists the H.Browser API interfaces and their corresponding Tizen Web API interfaces.

H.Browser API Tizen API Since
B2BAVPlay API AVPlayExtension API

Tizen 6.5
B2BBroadcast API Broadcast API

Tizen 6.5
B2BControl API AvInfo API

Tizen 2.3
Network API

Tizen 2.3
ProductInfo API

Tizen 2.3
RemotePower API

Tizen 6.5
SystemControl API

Tizen 6.5
Time API

Tizen 2.3
Table 1. H.Browser APIs and corresponding Tizen Web APIs

B2BAVPlay API and AVPlayExtension API

Since Tizen 6.5, the Tizen Samsung AVPlayExtension API replaces the H.Browser B2BAVPlay API.

The supported functionality and methods are the same, with the following exceptions:

  • Samsung Hospitality display devices do not support HTTP streaming with MPEG-TS since Tizen 6.5. Consequently, the following H.Browser methods related to HTTP streaming have no equivalent in the AVPlayExtension API:

    • pause(), seekTo(), jumpForward(), jumpBackward(), getDuration()
    • setTimeoutForBuffering(), setMaxBufferingSize(), setBufferingParam(), setSpeed()

    For more information, see Additional Multimedia Specifications.

  • The following H.Browser API methods have no equivalent in the AVPlayExtension API, because they are available directly through the AVPlay API:

    • setSoundAnalysisListener(), unsetSoundAnalysisListener()
    • setSilentSubtitle(), setExternalSubtitlePath(), setSubtitlePosition()
    • suspend(), restore()
  • To support hospitality partner requirements, the following AVPlayExtension API methods have extended functionality compared to their equivalent AVPlay API methods:

    • open(), close(), prepare(), prepareAsync(), play(), stop()
    • setDisplayRect(), setListener(), setDrm(), setDisplayMethod(), setSelectTrack()
    • getCurrentStreamInfo(), getTotalTrackInfo(), getState()
    • setStreamingProperty(), getStreamingProperty()

B2BBroadcast API and Broadcast API

The following table lists the H.Browser B2BBroadcast API methods and their equivalent methods in the Tizen Samsung Product Broadcast API.

H.Browser API Tizen API
Not supported webapis.broadcast.enableDataService()

webapis.broadcast.disableDataService()

b2bapis.b2bbroadcast.getTotalAudioInfo()

webapis.broadcast.getTotalAudioInfo()

b2bapis.b2bbroadcast.getCurrentAudioInfo()

webapis.broadcast.getCurrentAudioInfo()

b2bapis.b2bbroadcast.setCurrentAudio()

webapis.broadcast.setCurrentAudio()

b2bapis.b2bbroadcast.getTotalSubtitleInfo()

webapis.broadcast.getTotalSubtitleInfo()

b2bapis.b2bbroadcast.getCurrentSubtitle()

webapis.broadcast.getCurrentSubtitle()

b2bapis.b2bbroadcast.setCurrentSubtitleIndex()

webapis.broadcast.setCurrentSubtitleIndex()

b2bapis.b2bbroadcast.setHotelDrmForensicData()

webapis.broadcast.getHotelDrmForensicData()

b2bapis.b2bbroadcast.tuneDirect()

webapis.broadcast.tuneDirect()

b2bapis.b2bbroadcast.clearRating()

webapis.broadcast.clearRating()

Table 2. B2BBroadcast API methods and corresponding Broadcast API methods

B2BControl API and Samsung Product APIs

With the exception of methods related to network settings, software enabled access point (SoftAP) and features not supported since Tizen 6.5, most H.Browser B2BControl API methods have corresponding methods within the various Tizen Samsung Product APIs.

Category H.Browser API Tizen API
Network b2bapis.b2bcontrol.getMACAddress()

webapis.network.getMac()

b2bapis.b2bcontrol.getIPConfigType()

webapis.network.getIpMode()

b2bapis.b2bcontrol.setIPConfigType()

Not supported
b2bapis.b2bcontrol.getIPAddress()

webapis.network.getIp()

b2bapis.b2bcontrol.setIPAddress()

Not supported
b2bapis.b2bcontrol.getSubNetMask()

webapis.network.getSubnet()

b2bapis.b2bcontrol.setSubnetMask()

Not supported
b2bapis.b2bcontrol.getGatewayAddress()

webapis.network.getGateway()

b2bapis.b2bcontrol.setGatewayAddress()

Not supported
b2bapis.b2bcontrol.getDNSServer()

webapis.network.getDns()

b2bapis.b2bcontrol.setDNSServer()

Not supported
b2bapis.b2bcontrol.getProxyserverInfo()

b2bapis.b2bcontrol.setProxyserverInfo()

Remote
Management

b2bapis.b2bcontrol.getSerialNumber()

webapis.systemcontrol.getSerialNumber()

b2bapis.b2bcontrol.getSpeakerType()

webapis.avinfo.getSpeakerSelection()

b2bapis.b2bcontrol.setSpeakerType()

webapis.avinfo.setSpeakerSelection()

b2bapis.b2bcontrol.getCurrentTemperature()

b2bapis.b2bcontrol.setForwardMessageListener()

b2bapis.b2bcontrol.getHotelID()

webapis.network.getTVName()

b2bapis.b2bcontrol.setHotelID()

Not supported
b2bapis.b2bcontrol.collectLogs()

b2bapis.b2bcontrol.getLanguage()

b2bapis.b2bcontrol.setLanguage()

b2bapis.b2bcontrol.deleteAppPrivateInfo()

See note

Time
Management

b2bapis.b2bcontrol.getCurrentTime()

tizen.time.getCurrentDateTime()

b2bapis.b2bcontrol.setCurrentTime()

Not supported
b2bapis.b2bcontrol.getCurrentTimeZone()

tizen.time.getLocalTimezone()

b2bapis.b2bcontrol.setCurrentTimeZone()

Not supported
b2bapis.b2bcontrol.getNTPUse()

b2bapis.b2bcontrol.setNTPUse()

b2bapis.b2bcontrol.getNTPServerAddress()

b2bapis.b2bcontrol.setNTPServerAddress()

Application
Management

b2bapis.b2bcontrol.getURLLauncherAddress()

b2bapis.b2bcontrol.setURLLauncherAddress()

Firmware
Update

b2bapis.b2bcontrol.updateFirmware()

b2bapis.b2bcontrol.getFirmwareVersion()

b2bapis.b2bcontrol.setUpdateFirmwareProgressChangeListener()

b2bapis.b2bcontrol.unsetUpdateFirmwareProgressChangeListener()

Power
Control

b2bapis.b2bcontrol.rebootDevice()

webapis.systemcontrol.rebootDevice()

b2bapis.b2bcontrol.setPowerOff()

webapis.remotepower.powerOff()

b2bapis.b2bpower.setPowerOn()

webapis.remotepower.powerOn()

b2bapis.b2bpower.getPowerstate()

webapis.remotepower.getPowerState()

Not supported webapis.remotepower.getVirtualStandbyMode()

b2bapis.b2bpower.setPowerStateChangeListener()

Not supported
b2bapis.b2bpower.unsetPowerStateChangeListener()

Table 3. B2BControl API methods and corresponding Tizen Samsung Product API methods


Migrating Applications

Before, the H.Browser Web APIs were packaged in a "b2bapis.js" JavaScript library independent of the Tizen Samsung Product API library. Now, the new APIs are included within the "webapis.js" library, along with the other Tizen Samsung Product APIs.

To migrate an application from H.Browser to Tizen Web:

  • In the "config.xml" file:
    • Set the value of the required_version attribute to "6.5".
    • Replace the H.Browser API privileges with those for the corresponding Tizen Samsung Product APIs. For information on the privileges and how to add them, see Configuring Web Applications.
  • In the "index.html" file:
    • Replace the H.Browser API library with the Tizen Web API library:
      • Before: <script type="text/javascript" src="$B2BAPIS/b2bapis/b2bapis.js"/>
      • After: <script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"/>
    • If you want to implement AVPlayExtension API features, you must also add <script type="text/javascript" src="$WEBAPIS/avplayextension/avplayextension.js"/>.
  • Modify the application code to implement the new APIs.

For example, the following code snippet illustrates how to implement rebooting the device:

  • Before:

    var onSuccess = function(val) {
      console.log("[rebootDevice] success : " + val);
    }
    var onError = function(error) {
      console.log("[rebootDevice] code :" + error.code + " error name: " + error.name + "  message " + error.message);
    }
    
    console.log("[rebootDevice] ");
    b2bapis.b2bcontrol.rebootDevice(onSuccess, onError);
    
  • After:

    try {
      webapis.systemcontrol.rebootDevice();
    } catch (e) {
      console.log("[rebootDevice] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
    }