# Namespace hcap.volume

hcap.volume

- Defined in: hcap-1.24.6.5901.js

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| hcap.volume

## Method Summary

## Namespace Detail

hcap.volume

## Method Detail

- <static> hcap.volume.getExternalSpeakerVolumeLevel(param)
  Gets the current volume level of the external speaker.

      hcap.volume.getExternalSpeakerVolumeLevel({
           "onSuccess" : function(s) {
               console.log("onSuccess : level = " + s.level);
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function (param) {
                // {Number} param.level - volume level of external speaker (0~100).
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.23.0
  See:
    hcap.volume.setExternalSpeakerVolumeLevel()
- <static> hcap.volume.getHeadphoneVolumeLevel(param)
  Gets the current volume level of the Headphone.

      hcap.volume.getHeadphoneVolumeLevel({
           "onSuccess" : function(s) {
               console.log("onSuccess : level = " + s.level);
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function (param) {
                // {Number} param.level - volume level of Headphone (0~100).
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.22.0
  See:
    hcap.volume.getHealthcareHeadphoneMode()
    hcap.volume.setHealthcareHeadphoneMode()
    hcap.volume.setHeadphoneVolumeLevel()
- <static> hcap.volume.getHealthcareHeadphoneMode(param)
  Gets whether healthcare headphone mode is enabled or disabled.

      hcap.volume.getHealthcareHeadphoneMode({
           "onSuccess" : function (param) {
               console.log("onSuccess : healthcare headphone mode = " + param.enable);
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function (param) {
                // {Boolean} param.enable - true if the healthcare headphone mode is enabled. false if the healthcare headphone mode is disabled.
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.22.0
  See:
    hcap.volume.setHealthcareHeadphoneMode()
    hcap.volume.getHeadphoneVolumeLevel()
    hcap.volume.setHeadphoneVolumeLevel()
- <static> hcap.volume.getVolumeLevel(param)
  Gets the current volume level of the TV.

      hcap.volume.getVolumeLevel({
           "onSuccess" : function(s) {
               console.log("onSuccess : level = " + s.level);
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function (param) {
                // {Number} param.level - volume level of TV (0~100). -1 if mute
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.3.1
  See:
    hcap.volume.setVolumeLevel()
- <static> hcap.volume.setExternalSpeakerVolumeLevel(param)
  Sets the external speaker volume level.

      hcap.volume.setExternalSpeakerVolumeLevel({
           "level" : 50,
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Number} param.level [Required] - range is 0~100.
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function() {
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.
      Setting to the same volume level as before will invoke this callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.23.0
  See:
    hcap.volume.getExternalSpeakerVolumeLevel()
- <static> hcap.volume.setHeadphoneVolumeLevel(param)
  Sets the Headphone volume level.
  This is worked only when the healthcare headphone mode is enabled.

      hcap.volume.setHeadphoneVolumeLevel({
           "level" : 50,
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Number} param.level [Required] - range is 0~100.
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function() {
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.
      Setting to the same volume level as before will invoke this callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.22.0
  See:
    hcap.volume.getHealthcareHeadphoneMode()
    hcap.volume.setHealthcareHeadphoneMode()
    hcap.volume.getHeadphoneVolumeLevel()
- <static> hcap.volume.setHealthcareHeadphoneMode(param)
  Sets the healthcare headphone mode is enabled or disabled.

      hcap.volume.setHealthcareHeadphoneMode({
           "enable" : true,
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Boolean} param.enable [Required] - true : enable to healthcare headphone mode, false : disable.
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function() {
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.22.0
  See:
    hcap.volume.getHealthcareHeadphoneMode()
    hcap.volume.getHeadphoneVolumeLevel()
    hcap.volume.setHeadphoneVolumeLevel()
    {Event} ui_value_changed
- <static> hcap.volume.setVolumeLevel(param)
  Sets the TV volume level.

      hcap.volume.setVolumeLevel({
           "level" : 50,
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Number} param.level [Required] - range is 0~100 or -1 if mute.
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function() {
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.
      Setting to the same volume level as before will invoke this callback function.
      Setting to a value larger than the property "maximum_volume_level" will also invoke this callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.3.1
  See:
    hcap.volume.getVolumeLevel()