AvInfo API

To use Samsung Product API,

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>

Should be loaded in index.html

This module defines the TV audio and video settings functionalities provided by the Tizen Samsung Product API.

Since : 2.3

Product : TV, AV, B2B

Summary of Interfaces and Methods

Interface Method
AvInfoManagerObject

AvInfoManager

DOMString getVersion();
AvInfoDigitalCompMode getDolbyDigitalCompMode();
boolean isHdrTvSupport();
void setSubAmpMode(AvInfoSubAmpMode mode);
EnergySavingType getEnergySaving();
void setEnergySaving(EnergySavingType value);
EcoSensorType getEcoSensor();
void setEcoSensor(EcoSensorType value);

AvInfoDigitalCompMode

1. Type Definitions

1.1 AvInfoSubAmpMode

SubAmp Mode values

enum AvInfoSubAmpMode {
  "NO_EXT_AUDIO",
  "EXT_AUDIO_TV",
  "EXT_AUDIO_SWITCH",
  "EXT_HEALTHCARE"
};

The following values are supported

  • NO_EXT_AUDIO : SubAmp Mode 0: No External Audio Output
  • EXT_AUDIO_TV : SubAmp Mode 1: External Audio out follows the TV Speakers.
  • EXT_AUDIO_SWITCH : SubAmp Mode 2: Audio output is controlled by an external switch connected to TV.
  • EXT_HEALTHCARE : SubAmp Mode 3: Special mode to better support the Healthcare interface.

1.2 EnergySavingType

Energy Savings Type Enum

enum EnergySavingType {
  "OFF",
  "LOW",
  "MEDIUM",
  "HIGH"
};

The following values are supported

  • OFF : Energy Saving is OFF
  • LOW : Energy Saving is LOW
  • MEDIUM : Energy Saving is MEDIUM
  • HIGH : Energy Saving is HIGH

1.3 EcoSensorType

Eco Sensor Type Enum

enum EcoSensorType {
  "OFF",
  "ON"
};

The following values are supported

  • OFF : Eco Sensor is OFF
  • ON : Eco sensor is ON

2. Interfaces

2.1 AvInfoManagerObject

Defines a WebApi object instance of the Tizen Samsung Product API.
The webapis.avinfo object enables access to AVInfo API functionality.

[NoInterfaceObject] interface AvInfoManagerObject {
  readonly attribute AvInfoManager avinfo;
};
WebApi implements AvInfoManagerObject;

Attributes

2.2 AvInfoManager

This interface provides methods to use the AvInfo functionalities.

[NoInterfaceObject] interface AvInfoManager {
  readonly attribute AvInfoDigitalCompMode AvInfoDigitalCompMode;

  DOMString getVersion();
  AvInfoDigitalCompMode getDolbyDigitalCompMode();
  boolean isHdrTvSupport();
  void setSubAmpMode(AvInfoSubAmpMode mode);
  EnergySavingType getEnergySaving();
  void setEnergySaving(EnergySavingType value);
  EcoSensorType getEcoSensor();
  void setEcoSensor(EcoSensorType value);
};

Attributes

Methods

getVersion

This method get the plugin's version number.

DOMString getVersion();

Product : TV, AV, B2B

Return Value :

  • DOMString : return value of plugin's version

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method

Since : 2.3

Code Example :

try {
  var value = webapis.avinfo.getVersion();
  console.log("version value = " + value);
} catch (error) {
  console.log("error code = " + error.code);
}

getDolbyDigitalCompMode

This method get dolby digital component mode.

AvInfoDigitalCompMode getDolbyDigitalCompMode();

Product : TV, AV, B2B

Return Value :

Exceptions :

  • WebAPIException
    • with error type NotSupportedError, this feature doesn't be supported since 2016

Since : 2.3

Deprecated : 4.0

Code Example :

try {
  var mode = webapis.avinfo.getDolbyDigitalCompMode();
  console.log("mode = " + mode);
} catch (error) {
  console.log("error code = " + error.code);
}

isHdrTvSupport

This method is to check whether the HDR is supported or not.

boolean isHdrTvSupport();

Product : TV, AV, B2B

Return Value :

  • boolean : return value of boolean
    true is support
    false is not support

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method

Since : 2.3

Code Example :

try {
  var nResult = webapis.avinfo.isHdrTvSupport();
  console.log("nResult = " + nResult);
} catch (error) {
  console.log("error code = " + error.code);
}

setSubAmpMode

This method sets the sub amp mode

void setSubAmpMode(AvInfoSubAmpMode mode);

Product : B2B(HTV)

Parameters :

  • mode : the sub amp mode that want to set up

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
    • with error type InvalidValuesError, If any of the input parameter contains an invalid value. (since plugin version 3.0)
    • with error type NotSupportedError, if this API is called in any product other than Hotel TV.

Since : 6.0

Code Example :

try {
  webapis.avinfo.setSubAmpMode("EXT_AUDIO_TV");
} catch (error) {
  console.log("error code = " + error.code);
}

getEnergySaving

This method is to get energy saving values. Valid only for "Samsung" product.

EnergySavingType getEnergySaving();

Product : TV, B2B

Return Value :

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this API is called for non Samsung Products or called in an emulator and AV

Since : 6.5

Code Example :

try {
  var nResult = webapis.avinfo.getEnergySaving();
  console.log("nResult = " + nResult);
} catch (error) {
  console.log("error code = " + error.code);
}

setEnergySaving

This method is to set the energy saving values. Valid only for "Samsung" product.

void setEnergySaving(EnergySavingType value);

Product : TV, B2B

Parameters :

  • value : Energy Saving value to set (OFF, LOW, MEDIUM, HIGH)

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
    • with error type InvalidValuesError, If any of the input parameter contains an invalid value. (since plugin version 3.0)
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this API is called for non Samsung Products or called in an emulator and AV

Since : 6.5

Code Example :

try {
  webapis.avinfo.setEnergySaving("LOW");
} catch (error) {
  console.log("error code = " + error.code);
}

getEcoSensor

This method is to get eco sensor values. Valid only for "Samsung" product.

EcoSensorType getEcoSensor();

Product : TV, B2B

Return Value :

Exceptions :

  • WebAPIException
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this API is called for non Samsung Products or called in an emulator and AV

Since : 6.5

Code Example :

try {
  var nResult = webapis.avinfo.getEcoSensor();
  console.log("nResult = " + nResult);
} catch (error) {
  console.log("error code = " + error.code);
}

setEcoSensor

This method is to set the eco sensor values. Valid only for "Samsung" product.

void setEcoSensor(EcoSensorType value);

Product : TV, B2B

Parameters :

  • value : eco sensor value to set (OFF, ON)

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
    • with error type InvalidValuesError, If any of the input parameter contains an invalid value. (since plugin version 3.0)
    • with error type SecurityError, if the application does not have the privilege to call this method
    • with error type NotSupportedError, if this API is called for non Samsung Products or called in an emulator and AV

Since : 6.5

Code Example :

try {
  webapis.avinfo.setEcoSensor("ON");
} catch (error) {
  console.log("error code = " + error.code);
}

2.3 AvInfoDigitalCompMode

This interface defines the digital mode

[NoInterfaceObject] interface AvInfoDigitalCompMode {
  const unsigned long DOLBY_DIGITAL_COMP_MODE_LINE = 0;
  const unsigned long DOLBY_DIGITAL_COMP_MODE_RF = 1;
};

Constants

  • DOLBY_DIGITAL_COMP_MODE_LINE
    line mode
  • DOLBY_DIGITAL_COMP_MODE_RF
    rf mode

3. Full WebIDL

module AvInfo {
  enum AvInfoSubAmpMode {
    "NO_EXT_AUDIO",
    "EXT_AUDIO_TV",
    "EXT_AUDIO_SWITCH",
    "EXT_HEALTHCARE"
  };

  enum EnergySavingType {
    "OFF",
    "LOW",
    "MEDIUM",
    "HIGH"
  };

  enum EcoSensorType {
    "OFF",
    "ON"
  };

  [NoInterfaceObject] interface AvInfoManagerObject {
    readonly attribute AvInfoManager avinfo;
  };

  WebApi implements AvInfoManagerObject;

  [NoInterfaceObject] interface AvInfoManager {
    readonly attribute AvInfoDigitalCompMode AvInfoDigitalCompMode;
  
    DOMString getVersion();
    AvInfoDigitalCompMode getDolbyDigitalCompMode();
    boolean isHdrTvSupport();
    void setSubAmpMode(AvInfoSubAmpMode mode);
    EnergySavingType getEnergySaving();
    void setEnergySaving(EnergySavingType value);
    EcoSensorType getEcoSensor();
    void setEcoSensor(EcoSensorType value);
  };

  [NoInterfaceObject] interface AvInfoDigitalCompMode {
    const unsigned long DOLBY_DIGITAL_COMP_MODE_LINE = 0;
    const unsigned long DOLBY_DIGITAL_COMP_MODE_RF = 1;
  };

};