SystemInfo 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 system state and settings functionalities provided by the Tizen Samsung Product API.

Since : 6.0

Product : TV, B2B

Summary of Interfaces and Methods

Interface Method
SystemInfoManagerObject

SystemInfoManager

DOMString getVersion();
boolean isSupportedAudioCodec(DOMString audiocodec);
boolean isSupportedVideoCodec(DOMString videocodec);

1. Interfaces

1.1 SystemInfoManagerObject

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

[NoInterfaceObject] interface SystemInfoManagerObject {
  readonly attribute SystemInfoManager systeminfo;
};
WebApi implements SystemInfoManagerObject;

Attributes

1.2 SystemInfoManager

Provides methods for SystemInfo functionalities.

[NoInterfaceObject] interface SystemInfoManager {
  DOMString getVersion();
  boolean isSupportedAudioCodec(DOMString audiocodec);
  boolean isSupportedVideoCodec(DOMString videocodec);
};

Methods

getVersion

This method retrieves the plugin's version information

DOMString getVersion();

Return Value :

  • DOMString : value of plugin's version

Since : 6.0

Code Example :

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

isSupportedAudioCodec

This method check whether the audio codec is supported or not

boolean isSupportedAudioCodec(DOMString audiocodec);

Parameters :

  • audiocodec : audio codec type to check
    "MPEG" The audio codec type for MPEG
    "MPEG-H" The audio codec type for MPEG-H
    "AC3" The audio codec type for AC3
    "E-AC3" The audio codec type for E-AC3
    "AC4" The audio codec type for AC4
    "TrueHD" The audio codec type for TrueHD
    "Vorbis" The audio codec type for Vorbis
    "G2Cook" The audio codec type for G2Cook
    "AAC" The audio codec type for AAC
    "HE-AAC" The audio codec type for HE-AAC
    "WMA" The audio codec type for WMA
    "ADPCM" The audio codec type for ADPCM
    "OPUS" The audio codec type for OPUS
    "PCM" The audio codec type for PCM

Return Value :

  • boolean : value to indicate whether the audio codec is supported or not
    true: supported
    false: unsupported

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

Since : 6.0

Code Example :

try {
  var audiocodec = "MPEG";
  var value = webapis.systeminfo.isSupportedAudioCodec(audiocodec);
} catch(error) {
  console.log("error code = " + error.code);
}

isSupportedVideoCodec

This method check whether the video codec is supported or not

boolean isSupportedVideoCodec(DOMString videocodec);

Parameters :

  • videocodec : video codec type to check
    "MPEG1" The video codec type for MPEG1
    "MPEG2" The video codec type for MPEG2
    "MPEG4" The video codec type for MPEG4
    "H263" The video codec type for H263
    "H264" The video codec type for H264
    "HEVC" The video codec type for HEVC
    "VP8" The video codec type for VP8
    "VP9" The video codec type for VP9
    "RV" The video codec type for RV
    "WMV" The video codec type for WMV
    "AVS" The video codec type for AVS
    "AVS_PLUS" The video codec type for AVS_PLUS
    "MJPEG" The video codec type for MJPEG
    "JPEG" The video codec type for JPEG
    "H264_MVC" The video codec type for H264
    "HEIC" The video codec type for HEIC
    "AVS2" The video codec type for AVS2
    "HEVC_VR360" The video codec type for HEVC_VR360
    "H264_VR360" The video codec type for H264_VR360
    "VP9_VR360" The video codec type for VP9_VR360
    "HEVC_SHVC" The video codec type for HEVC_SHVC
    "AV1" The video codec type for AV1
    "AV1_VR360" The video codec type for AV1_VR360

Return Value :

  • boolean : value to indicate whether the video codec is supported or not
    true: supported
    false: unsupported

Exceptions :

  • WebAPIException
    • with error type TypeMismatchError, if an input parameter is not compatible with its expected type.

Since : 6.0

Code Example :

try {
  var videocodec = "MPEG4";
  var value = webapis.systeminfo.isSupportedVideoCodec(videocodec);
} catch(error) {
  console.log("error code = " + error.code);
}

2. Full WebIDL

module SystemInfo {
  [NoInterfaceObject] interface SystemInfoManagerObject {
    readonly attribute SystemInfoManager systeminfo;
  };

  WebApi implements SystemInfoManagerObject;

  [NoInterfaceObject] interface SystemInfoManager {
    DOMString getVersion();
    boolean isSupportedAudioCodec(DOMString audiocodec);
    boolean isSupportedVideoCodec(DOMString videocodec);
  };

};