버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.
Sv translation
languageko

이 인터페이스는 W Player, Tizen 등의 Device 관련 리소스 정보를 얻기 위한 API들을 제공합니다.

getProperty()

  • 설명

...

  • Device의 속성값을 구합니다.

  • 구문

...

  • function getProperty(‘name’);

  • 파라미터

    아래 표에서 제공되는 속성의 이름을 확인하고, 원하는 정보의 속성 이름을 파라미터로 입력하세요.

    name: 속성명

    name

    반환값

    유형설명

    player_version

    string

    value: w player version

    fw_version

    string

    value: firmware version

    variable_tag

    array

    value: tag list

    mis_ip

    string

    value: MagicInfo Server ip address

    mac

    string

    value: mac address

    ipaddress

    string

    value: ip address

    resolution

    object

    { width: 1920, height: 1080 }

    orientation

    string

    value: landscape/portrait

  • 반환값

    Type: 위 표 참고

    API가 성공적으로 수행된 경우: 정상값

    API가 성공적으로 수행되지 않은 경우: undefined Type: bool

  • 코드 예제

    $wp.device.getProperty(‘mac’);

getPropertyType()

  • 설명

...

  • Device 인터페이스에서 제공하는 속성들의 이름을 가져올 수 있습니다.

    속성명

    반환값

    PLAYER_VERSION

    'player_version'

    FIRMWARE_VERSION

    'fw_version'

    VARIABLE_TAG

    'variable_tag'

    MIS_IP

    'mis_ip'

    MACADDRESS

    'mac'

    IPADDRESS

    'ipaddress'

    RESOLUTION

    'resolution'

    ORIENTATION

    'orientation'

  • 구문

...

  • function getPropertyType();

  • 파라미터

    None

  • 반환값

    성공: object(속성명), 실패: 항상 성공

  • 코드 예제

    $wp.device.getPropertyType();

  • 기타

    $wp.device.getPropertyType();로부터 반환되는 객체를 변수화해 사용하면 오타 방지 등의 편리함이 있습니다.

    var devicePropertyType = $wp.device.getPropertyType();

    $wp.device.getProperty(devicePropertyType.MACADDRESS);

$wp.local

이 인터페이스는 웹 콘텐츠 요소가 실행되는 local 환경 정보를 얻기 위한 API들을 제공합니다.

...

getApiVersion ()

  • 설명: 웹 콘텐츠가 가져온 W Player API Lib의 버전을 알 수 있습니다.

  • 구문: function getApiVersion();

  • 파라미터

    None

  • 반환값

    성공: string (version), 실패: 항상 성공

  • 코드 예제

    $wp.local.getApiVersion();

  • 기타

    $wp.utility.getApiVersion();과 함께 사용해 버전 관리를 할 수 있습니다.

getRootDirectory ()

...

설명: 웹 콘텐츠가 로드된 루트 디렉터리를 알 수 있습니다.

...

구문: function getRootDirectory();

...

파라미터

none

...

반환값

성공: string (Root Directory), 실패: 항상 성공

코드 예제

...

기타

웹 콘텐츠에 추가한 asset은 getRootDirectory()를 통해 전달받은 루트 디렉터리 경로 하위에 저장됩니다.

$wp.utility

이 인터페이스는 응용 웹 콘텐츠 요소 개발을 위한 여러 utility API들을 제공합니다.

  • log ()

    • 설명: 웹 콘텐츠가 가져온 W Player API Lib의 버전을 알 수 있습니다.

    • 구문: function log(“message”);

    • 파라미터

      message: string

    • 반환값

      Type: void

    • 코드 예제

      $wp.utility.log(“Hello World!”);

    • 기타

      로그를 원격으로 가져올 수 있습니다. 다음을 참고하세요. ▶ 로그 가져오기

  • getApiVersion ()

    • 설명: 웹 콘텐츠가 실행되는 W Player가 지원하는 W Player API Lib의 버전을 알 수 있습니다.

    • 구문: function getApiVersion();

    • 파라미터

      none

    • 반환값

      성공: string (version), 실패: 항상 성공

    • 코드 예제

      $wp.utility.getApiVersion();

    • 기타

      $wp.local.getApiVersion();과 함께 사용해 버전 관리를 할 수 있습니다.

Sv translation
languageen

This interface provides APIs required for obtaining resource information related to devices such as W Player and Tizen.

getProperty()

  • Description

    Find the property value of the device.

  • Syntax

    function getProperty(‘name’);

  • Parameter

    View the names of provided properties from the table below, and enter the property name of the information you need as a parameter.

    name: Property name

    name

    Return value

    Type
    Description

    player_version

    string

    value: w player version

    fw_version

    string

    value: firmware version

    variable_tag

    array

    value: tag list

    mis_ip

    string

    value: MagicInfo Server ip address

    mac

    string

    value: mac address

    ipaddress

    string

    value: ip address

    resolution

    object

    { width: 1920, height: 1080 }

    orientation

    string

    value: landscape/portrait

  • Return value

    Type: Refer to the table above

    If API has been run successfully: Normal value

    If API has not been run successfully: undefined Type: bool

  • Code example

    $wp.device.getProperty(‘mac’);

getPropertyType()

  • Description

    Import the names of properties provided in the device interface.

    Property name

    Return value

    PLAYER_VERSION

    'player_version'

    FIRMWARE_VERSION

    'fw_version'

    VARIABLE_TAG

    'variable_tag'

    MIS_IP

    'mis_ip'

    MACADDRESS

    'mac'

    IPADDRESS

    'ipaddress'

    RESOLUTION

    'resolution'

    ORIENTATION

    'orientation'

  • Syntax

    function getPropertyType();

  • Parameter

    None

  • Return value

    Success: object (property name), fail: Always successful

  • Code example

    $wp.device.getPropertyType();

  • Others

    If you convert objects returned from $wp.device.getPropertyType(); to variables, typos can be prevented.

    var devicePropertyType = $wp.device.getPropertyType();

    $wp.device.getProperty(devicePropertyType.MACADDRESS);