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 applications to Tizen Web applications.

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 Tizen Samsung Product APIs. For more information, see the 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
Timer API

Tizen 6.5

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 functionalities 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
- 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

Except for some features not supported since Tizen 6.5, most H.Browser B2BControl API methods have corresponding methods within the various Tizen Samsung Product APIs.

  • Network Management
    You can change the network configurations of the devices remotely. See Network API for more information.

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

    webapis.network.getMac()

    b2bapis.b2bcontrol.getIPConfigType()

    webapis.network.getIpMode()

    b2bapis.b2bcontrol.setIPConfigType()

    webapis.network.setIpMode()

    b2bapis.b2bcontrol.getIPAddress()

    webapis.network.getIp()

    b2bapis.b2bcontrol.setIPAddress()

    webapis.network.setIp()

    b2bapis.b2bcontrol.getSubNetMask()

    webapis.network.getSubnetMask()

    b2bapis.b2bcontrol.setSubnetMask()

    webapis.network.setSubnetMask()

    b2bapis.b2bcontrol.getGatewayAddress()

    webapis.network.getGateway()

    b2bapis.b2bcontrol.setGatewayAddress()

    webapis.network.setGateway()

    b2bapis.b2bcontrol.getDNSServer()

    webapis.network.getDns()

    b2bapis.b2bcontrol.setDNSServer()

    webapis.network.setDns()

    b2bapis.b2bcontrol.getProxyserverInfo()

    webapis.network.getProxyserverInfo()

    b2bapis.b2bcontrol.setProxyserverInfo()

    webapis.network.getProxyserverInfo()

    Table 3. Network Management - B2BControl API methods and corresponding Tizen Web API methods

  • Remote Management
    You can set the device configurations remotely. See AvInfo API, Network API and SystemControl API for more information.

    H.Browser API
    Tizen API
    b2bapis.b2bcontrol.getSerialNumber()

    webapis.systemcontrol.getSerialNumber()

    b2bapis.b2bcontrol.getSpeakerType()

    webapis.avinfo.getSpeakerSelection()

    b2bapis.b2bcontrol.setSpeakerType()

    webapis.avinfo.setSpeakerSelection()

    b2bapis.b2bcontrol.getCurrentTemperature()

    webapis.tvinfo.getTvInfoValue("BOARD_TEMPERATURE")

    b2bapis.b2bcontrol.setForwardMessageListener()

    Not supported
    b2bapis.b2bcontrol.getHotelID()

    webapis.network.getTVName()

    b2bapis.b2bcontrol.setHotelID()

    webapis.network.setTVName()

    b2bapis.b2bcontrol.collectLogs()

    Not supported
    b2bapis.b2bcontrol.getLanguage()

    b2bapis.b2bcontrol.setLanguage()

    b2bapis.b2bcontrol.deleteAppPrivateInfo()

    See note

    Table 4. Remote Management - B2BControl API methods and corresponding Tizen Web API methods

  • Time Management
    You can set the device time configuration like the OSD time, the NTP time and timezone remotely. See Timer API for more information.

    H.Browser API
    Tizen API
    b2bapis.b2bcontrol.getCurrentTime()

    webapis.timer.getCurrentTime()

    b2bapis.b2bcontrol.setCurrentTime()

    webapis.timer.setCurrentTime()

    b2bapis.b2bcontrol.getNTPUse()

    webapis.timer.getNTP()

    b2bapis.b2bcontrol.getNTPServerAddress()

    b2bapis.b2bcontrol.getCurrentTimeZone()

    b2bapis.b2bcontrol.setNTPUse()

    webapis.timer.setNTP()

    b2bapis.b2bcontrol.setNTPServerAddress()

    b2bapis.b2bcontrol.setCurrentTimeZone()

    Table 5. Time Management - B2BControl API methods and corresponding Tizen Web API methods

  • Application Management
    You can set the local application installation information. See SystemControl API for more information.

    H.Browser API
    Tizen API
    b2bapis.b2bcontrol.getURLLauncherAddress()

    webapis.systemcontrol.getCustomAppInfo()

    b2bapis.b2bcontrol.setURLLauncherAddress()

    webapis.systemcontrol.setCustomAppInfo()

    Table 6. Application Management - B2BControl API methods and corresponding Tizen Web API methods

  • Firmware Management
    You can update the device firmware remotely. See SystemControl API for more information.

    H.Browser API
    Tizen API
    b2bapis.b2bcontrol.getFirmwareVersion()

    webapis.productinfo.getFirmware()

    b2bapis.b2bcontrol.updateFirmware()

    webapis.systemcontrol.updateFirmware()

    b2bapis.b2bcontrol.setUpdateFirmwareProgressChangeListener()

    webapis.systemcontrol.setUpdateFirmwareListener()

    b2bapis.b2bcontrol.unsetUpdateFirmwareProgressChangeListener()

    webapis.systemcontrol.unsetUpdateFirmwareListener()

    Table 7. Firmware Management - B2BControl API methods and corresponding Tizen Web API methods

  • Power Control
    You can control the device power remotely.See RemotePower API and SystemControl API for more information.

    H.Browser API
    Tizen API
    b2bapis.b2bcontrol.rebootDevice()

    webapis.systemcontrol.rebootDevice()

    b2bapis.b2bcontrol.setPowerOff()

    webapis.remotepower.powerOff()

    b2bapis.b2bpower.setPowerOn()

    webapis.remotepower.powerOn()

    b2bapis.b2bpower.getPowerstate()

    webapis.remotepower.getPowerState()

    - webapis.remotepower.getVirtualStandbyMode()

    b2bapis.b2bpower.setPowerStateChangeListener()

    Not supported
    b2bapis.b2bpower.unsetPowerStateChangeListener()

    Table 8. Power Management - B2BControl API methods and corresponding Tizen Web 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);
    }