Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageko

$wp는 W Player API의 모든 인터페이스 (content, device, local, utility, callback)를 포함하는 네임스페이스(Namespace)입니다.

Anchor
setDefaultCallback()
setDefaultCallback()
setDefaultCallback()

  • 설명

...

  • W Player로부터 이벤트(Event)를 전달받는 리스너(Listener)를 추가할 수 있습니다.

...

  • 수명 주기에 대한 상태

...

  • 이벤트(ready/play/pageChanged/stop)를 수신하기 위해서는 초기 생성 단계에 추가가 필요합니다.

  • 구문

...

  • function setDefaultCallback (myFunction(object));

  • 파라미터

...

  • 이벤트(Event)는 콜백(Callback)을 통해 다음과 같은 객체(Object) 형태로 전달합니다.

State (ready)

Code Block
{ 
type: 'state',
sub: 'ready',
data: {

...

/* user_data object */
}
name: 'name of Web Content element',
pageId: 'id'
}

'ready' State: 페이지(Page) 내의 모든 요소를 모두 로드(Load)하면 응용 웹 콘텐츠 요소가 W Player API를 사용할 수 있는 시점을 전달합니다. 응용 웹 콘텐츠 요소는 iframe 형태로 로드(Load)하며 화면에 표시하기 전

...

상태(Back Page Layer, 현재 화면에는 이전 콘텐츠를 재생하고 있는 상태)입니다. 화면에 나타나기 전에 필요한 초기화를 진행할 수 있습니다.

...

data :

...

{

...

/*

...

user_data

...

object

...

*/

...

}

...

user_data는 ready 상태에서 초기화에 이용 가능 합니다. (user_data는 getProperty 를 통해서도 구할 수 있습니다.)

State (play)

Code Block
{ 
type: 'state',
sub: 'play',
name: 'name of Web Content element',
pageId: 'id'
}

'play' State: 웹 콘텐츠 요소를 화면에 표시하는 시점(Front Page layer)을 전달합니다.

State (pageChanged)

Code Block
{ 
type: 'state',
sub: 'pageChanged',
data: 'name of changed page',
name: 'name of Web Content element',
pageId: 'id'
}

'pageChanged' State: 재생 중 페이지(Page)가 전환되는 시점을 전달합니다.(단, 웹 콘텐츠가 공통 페이지에 속해 있을 경우에만 동작합니다.)

data로 전달되는 pageName 을 통해 어떤

...

페이지(Page)가 전환되었는지 확인 가능 합니다.

State (stop)

Code Block
{ 
type: 'state',
sub: 'stop',
name: 'name of Web Content element',
pageId: 'id'
}

'stop' State: 웹 콘텐츠 요소가 종료되기 전 시점을 전달합니다. 웹 콘텐츠 요소 내에 사용된 리소스를 반환할 수 있습니다. (예: clearInterval, clearTimeout, $wp = null)

※ 정상적으로 반환되지 않는 리소스는 메모리 누수 발생으로 W Player 재생이 영향을 받을 수 있습니다.

Error


Code Block
{ 
type: 'error',
sub: 'name of error api',
data: {

...

/* custom error object */
}
}

'error' Type: W Player API 실행 오류 또는 기타 오류가 발생하면 실행됩니다.

오류에 대한 자세한 정보는 error object를 통해 확인할 수 있습니다.

UDP

Code Block
{ 
type: 'udp',
sub: 'number of udp port',
data: 'received data string from udp port'
}

'udp' Type: UDP로 data가 전달되면 실행됩니다.

Port 등의 설정은 Web Author에서 저작 시 가능합니다.

Code Block
{ 
type: 'datalink',
sub: 'name of datalink table',
data: {

...

/* data of datalink table */
}
}

'datalink' Type: 데이터링크(

...

Datalink)에서 data가 전달되면 실행됩니다.

데이터링크(

...

Datalink) 정보에 대한 설정은 Web Author에서 저작 시 가능합니다.

  • 반환값

    Type: void

  • 코드 예제

    $wp.setDefaultCallback(object);

기타

Sv translation
languageen

"$wp" is a namespace that includes all interfaces of W Player API (e.g., content, device, local, utility, callback).

Anchor
setDefaultCallback()
setDefaultCallback()
setDefaultCallback()

  • Description

    Add a Listener that receives events from W Player. To receive a state event regarding life cycle (e.g., ready, play, pageChanged, stop), you need to add a Listener during the stage of initial function creation.

  • Syntax

    function setDefaultCallback (myFunction(object));

  • Parameter

    An event is sent in object format as follows through callback.

State (ready)

Code Block
{ 
type: 'state',
sub: 'ready',
data: {
/* user_data object */
}
name: 'name of Web Content element',
pageId: 'id'
}

'ready' State: Sends the time at which web content elements can use W Player API after all elements in a page are loaded. A web content element is loaded in iframe format, being in the Back Page layer which is a state in which the element is not displayed yet (and the previous content is playing on the current screen). Reset is possible as required, before the element appears on the screen.

data :{ /* user_data object*/ } user_data can be used for reset in ready state. (user_data can also be obtained through getProperty.)

State (play)

Code Block
{ 
type: 'state',
sub: 'play',
name: 'name of Web Content element',
pageId: 'id'
}

'play' State: Sends the time at which the web content element appears on the screen (Front Page layer).

State (pageChanged)

Code Block
{ 
type: 'state',
sub: 'pageChanged',
data: 'name of changed page',
name: 'name of Web Content element',
pageId: 'id'
}

'pageChanged' State: Sends the time at which a page transition takes place during playback. (This only works when the web content belongs to the common page.)

You can check which page has been switched by viewing the pageName included in the received data.

State (stop)

Code Block
{ 
type: 'state',
sub: 'stop',
name: 'name of Web Content element',
pageId: 'id'
}

'stop' State: Sends the time before which web content element playback ends. Resources used in a web content element can be returned. (e.g., clearInterval, clearTimeout, $wp = null)

* A resource that is not returned properly may affect W Player playback due to a memory leak.

Error


Code Block
{ 
type: 'error',
sub: 'name of error api',
data: {
/* custom error object */
}
}

'error' Type: Runs when a W Player API running error or other error occurs.

Error details can be viewed through the error object.

UDP

Code Block
{ 
type: 'udp',
sub: 'number of udp port',
data: 'received data string from udp port'
}

'udp' Type: Runs after data is sent to UDP.

Port and other settings can be configured when authoring from Web Author.

Datalink

Code Block
{ 
type: 'datalink',
sub: 'name of datalink table',
data: {
/* data of datalink table */
}
}

'datalink' Type: Runs after data is sent from datalink.

Datalink information can be configured when authoring from Web Author.