Beruflich Dokumente
Kultur Dokumente
Copyright
Copyright
Copyright 2010 LG Electronics, Inc. All Rights Reserved. Though every care has been taken to ensure the accuracy of this document, LG Electronics, Inc. cannot accept responsibility for any errors or omissions or for any loss occurred to any person, whether legal or natural, from acting, or refraining from action, as a result of the information contained herein. Information in this document is subject to change at any time without obligation to notify any person of such changes. LG Electronics, Inc. may have patents or patent pending applications, trademarks copyrights or other intellectual property rights covering subject matter in this document. The provision of this document does not give the recipient or reader any license to these patents, trademarks copyrights or other intellectual property rights. No part of this document may be communicated, distributed, reproduced or transmitted in any form or by any means, electronic or mechanical or otherwise, for any purpose, without the prior written permission of LG Electronics, Inc. This document is subject to revision without further notice. All brand names and product names mentioned in this document are trademarks or registered trademarks of their respective owners. TRADEMARKS Adobe, the Adobe logo, Flash, the Flash logo, and Flash Lite are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. All other trademarks and copyrights are the property of their respective owners.
2.3
October 7, 2011
2.2 2.1 2.0 1.9 1.8 1.7 1.6 1.5 1.4 1.3 1.2
August 12, 2011 May 13, 2011 April 28, 2011 February 18, 2011 January 11, 2011 December 24, 2010 November 22, 2010 November 2, 2010 October 29, 2010 October 20, 2010 July 16, 2010
Purpose
This guide explains features, functions, and how-to-use information of the LG Flash Open API required to create the Flash content for LG DTV.
Reference Documents
Refer to the following documents: - LG Smart TV SDK Installation Guide - LG Flash Application Development Guide
Conventions
Codes
Source code and examples are indicated in the grey Courier New font.
Abbreviations
Note, Caution
Note and caution are used to emphasize information. The following samples describe when each is used. Note Contains information about something that is helpful to you.
Caution Contains important information about something that you should know.
Abbreviations
The following table defines the abbreviations used in this document. Abbreviation API ATC DLNA DVB FOA HOA NTSC OSD PAL PSI PSIP SI Application Programming Interface Advanced Television Systems Committee Digital Living Network Alliance Digital Video Broadcasting Flash Open API Home Multimedia Open API National Television Standards Committee On Screen Display Phaser Alternation Line Program and System Information Program and System Information Protocol Service Information Description
Contents
Contents
1 Introduction ......................................................................................................... 8
1.1 Architecture of LG Flash Open API ................................................................................... 9
Contents getMute........................................................................................... 56 setAVBlock ....................................................................................... 57 getAVBlock ....................................................................................... 58 resetAVBlock..................................................................................... 59 setDisplayResolution ........................................................................... 60 getDisplayResolution ........................................................................... 61 setDisplayMode .................................................................................. 62 getDisplayMode ................................................................................. 63 setDisplayArea................................................................................... 64 getDisplayArea .................................................................................. 65 resetDisplayArea ................................................................................ 66 setAspectRatio .................................................................................. 67 getAspectRatio .................................................................................. 68 resetAspectRatio ................................................................................ 69 channelUp ........................................................................................ 70 channelDown .................................................................................... 71 setChannel ....................................................................................... 72 getChannel ....................................................................................... 73 getChannelList .................................................................................. 74 getLocaleInfo .................................................................................... 75 getCountry ....................................................................................... 76 getMenuLanguage............................................................................... 77 getRegion ........................................................................................ 78 getCapability .................................................................................... 79 getSystemInfo ................................................................................... 80 getStorageSize .................................................................................. 81 getRemoconTypeInfo........................................................................... 82 setMotionRemoteMode......................................................................... 83 getDisplayPanelType ........................................................................... 84 setScreensaverOff .............................................................................. 85 setDimmingOff .................................................................................. 86 createPopup ..................................................................................... 87 activateSmartText .............................................................................. 88 set3DMode ....................................................................................... 89 get3DMode ....................................................................................... 90 2.4 Media .............................................................................................................................. 91 2.4.1 Description ....................................................................................... 91 2.4.2 Function .......................................................................................... 91 openChannel ..................................................................................... 92 closeChannel .................................................................................... 94 playClipFile ...................................................................................... 95 pauseClip ......................................................................................... 97 resumeClip ....................................................................................... 98 seekClip .......................................................................................... 99 stopClip .......................................................................................... 100 getPlayInfo ...................................................................................... 101 getSourceInfo ................................................................................... 103 getPlayClipFileBasePath ...................................................................... 105 2.4.3 Events ........................................................................................... 106 2.5 IO (Input/Output) ........................................................................................................... 109 2.5.1 Description ...................................................................................... 109 2.5.2 Function ......................................................................................... 109 getNetworkStatus .............................................................................. 110 getNetworkSettings ........................................................................... 111
Event Handling for Flash Application with Magic Motion Remote Control 113
6
Figures
3.1 Events for Magic Motion Remote Control ...................................................................... 114 3.2 Functions for Magic Motion Remote Control .................................................................. 116 setMotionRemoteMode ........................................................................117 getRemoconTypeInfo ..........................................................................118 createPopup ....................................................................................119
Figures
[Figure 1] Architecture of LG Flash Open API ........................................................................... 9
Introduction
This chapter provides an overview and architecture of LG Flash Open API. 1.1 Architecture of LG Flash Open API
1 Introduction
1.1
Application
Provides the basic functions required to run a Flash application from start to end.
Control
Uses the functionalities of a legacy application in the system and is used to implement TV middleware. This module provides APIs to support general TV functionalities including switching channels, adjusting volume and importing program information. It also allows inserting an image to the background.
Media
Provides APIs to play and view audios, videos and images. This module supports both streaming and downloaded media and offers related functionalities including playback, pause, resume, and stop. Also, it supports the seek functionality for the downloaded media.
IO
Provides functions required to use the network, except the functions provided by the Linux system or standard C library. This module receives the network connection status.
This chapter describes the data structure and APIs provided by LG Flash Open API. Each API is described in six categories: Description, Syntax, Parameter, Return Value, Remarks and Example. 2.1 General Data Structure 2.2 Application 2.3 Control 2.4 Media 2.5 IO
Note LG provides a test application for LG Flash Open API. Developers can test APIs by using this application. Location: [SDK Installation Path]\Flash_Project\FOA_Test.
2.1
2.1.1
11
AppType
This is application type for LG Flash Open API. class lge.apis.AppType { public static var ALL: Number public static var HOST: Number public static var ADDON: Number } Member ALL HOST ADDON 0 (1<<1) (1<<2) Value All applications Host application Add-on application
= 0; = (1<<1); = (1<<2);
Description
12
AspectRatio
This is aspect ratio for LG Flash Open API. class lge.apis.AspectRatio { public static var ARC16X9:Number = 0; public static var JUSTSCAN:Number = 1; public static var SET_BY_PROGRAM:Number = 2; public static var ARC4X3:Number = 3; public static var FULL:Number = 4; public static var ZOOM:Number = 5; } Member ARC16X9 JUSTSCAN SET_BY_PROGRAM 0 1 2 Value Description - For 16X9 monitor : full screen - For 4X3 monitor : letter box Just Scan turns off cropping (re-blanking) and shows the complete video. The Set By Program displays the original aspect ratio. (e.g. 4X3 signal into a 4X3 display; 16X9 signal into a 16X9 display). - For 16X9 monitor : 4X3 with black bars on both sides (pillar box) - For 4X3 monitor : full screen Always displays objects in full screen mode regardless of monitor and source types. - For 16X9 monitor : zooms vertically - For 4X3 monitor : Ignored
3 4 5
13
ChAttrib
This is channel attribute for LG Flash Open API. class lge.apis.ChAttrib { public static var INCLUDE_BLOCK public static var EXCLUDE_BLOCK public static var INCLUDE_SKIPHIDDEN public static var EXCLUDE_SKIPHIDDEN public static var INCLUDE_SCRAMBLE public static var EXCLUDE_SCRAMBLE public static var INCLUDE_INVISIBLE public static var EXCLUDE_INVISIBLE public static var INCLUDE_INACTIVE public static var EXCLUDE_INACTIVE public static var TV_ONLY public static var RADIO_ONLY public static var MAIN_CH public static var SUB_CH public static var UNUSED_CH } Member INCLUDE_BLOCK EXCLUDE_BLOCK INCLUDE_SKIPHIDDEN EXCLUDE_SKIPHIDDEN INCLUDE_SCRAMBLE EXCLUDE_SCRAMBLE INCLUDE_INVISIBLE EXCLUDE_INVISIBLE INCLUDE_INACTIVE EXCLUDE_INACTIVE TV_ONLY RADIO_ONLY MAIN_CH SUB_CH UNUSED_CH Value 0x00000100 0x00000200 0x00000400 0x00000800 0x00004000 0x00008000 0x00010000 0x00020000 0x00040000 0x00080000 0x01000000 0x02000000 0x10000000 0x20000000 0x40000000
:Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number
= = = = = = = = = = = = = = =
0x00000100; 0x00000200; 0x00000400; 0x00000800; 0x00004000; 0x00008000; 0x00010000; 0x00020000; 0x00040000; 0x00080000; 0x01000000; 0x02000000; 0x10000000; 0x20000000; 0x40000000;
Description Includes the blocked channel property. Excludes the blocked channel property. Includes skipped and hidden channel properties. Excludes skipped and hidden channel properties. Includes the scrambled channel property. Excludes the scrambled channel property. Includes the hidden channel property. Excludes the hidden channel property. Includes the inactive channel property. Excludes the inactive channel property. TV property Radio property Main channel property Sub channel property Unused channel property
14
ChMap
This is channel map for LG Flash Open API. class lge.apis.ChMap { public static var CUSTOMIZED:Number public static var FAVORITE :Number public static var NONE :Number } Member CUSTOMIZED FAVORITE NONE 1 2 3 Value
= 1; = 2; = 3;
15
DisplayMode
This is display mode for LG Flash Open API. class lge.apis.DisplayMode { public static var NONE:Number public static var UIWITHTV:Number public static var FULLUI:Number public static var FULLVIDEO:Number public static var FULLIMAGE:Number public static var FULLUIFAST:Number public static var FULLUIKEEP:Number public static var UIWITHTV_VCS:Number public static var UIWITHTV_VCSAUDIO:Number public static var FULLUI_VCSAUDIO:Number public static var FULLVCSAV:Number public static var RESERVED1:Number public static var FULLUIWITHTV:Number public static var FULLVIDEONVS:Number public static var NUM:Number } Member NONE UIWITHTV 0 1 Value No UI exists. UI elements overlap with the image on the TV screen. UI elements are displayed in full screen mode covering the image on the TV screen. (UI transition is slow. However, it enables a quick start when playing a media file.) When playing a video in full screen mode. When playing an image in full screen mode. UI elements are displayed in full screen mode covering the image on the TV screen. (UI transition is fast. However, it prevents a quick start when playing a media file.) Keeps existing UI and not performs Dimming On/Off. (Use at Netflix 2.1 trick/pause mode.) VCS UI elements overlap with the image on the TV screen. VCS UI elements overlap with the image on the TV screen while VCS audio is active. UI elements are displayed in full screen mode while VCS audio is active and TV source is used as video. VCS Audio + Video RESERVED1. Entire screen shows UI and small TV screen. Entire screen shows video. (No Video Setting Menu) Total number of these variables
= = = = = = = = = = = = = = =
Description
FULLUI
FULLVIDEO FULLIMAGE
3 4
FULLUIFAST
6 7 8 9 10 11 12 13 14
16
ExitCode
This is exit code for LG Flash Open API. class lge.apis.ExitCode { public static var BAD_CRASH:Number = -1; public static var NORMAL:Number = 0; public static var BACK_TO_BROWSER:Number = 1; public static var NEED_NETCONFIG:Number = 2; public static var SW_UPDATE:Number = 3; public static var BACK_TO_GAMEMENU = 4; public static var RETURN = 5; public static var EXEC_OTHERAPP = 6; public static var BACK_TO_DASHBOARD = 7; public static var BACK_TO_MYAPP = 8; public static var BACK_TO_SEARCHRESULT = 9; public static var NEED_NETCONFIG_NETCAST = 10; public static var BACK_TO_NETWORKSETTING = 11;public static var BACK_TO_LAST = 0xff; } Member BAD_CRASH NORMAL BACK_TO_BROWSER NEED_NETCONFIG SW_UPDATE BACK_TO_GAMEMENU RETURN EXEC_OTHERAPP BACK_TO_DASHBOARD BACK_TO_MYAPP BACK_TO_SEARCHRES ULT NEED_NETCONFIG_NE TCAST BACK_TO_NETWORKSE TTING BACK_TO_LAST -1 0 1 2 3 4 5 6 7 8 9 10 11 0xff Value Description When closed, restore to default TV state. Basic close When closed, go back to Application Browser. When closed, start Network Setting. When closed, start software update. When closed, go back to Game Menu. When closed, go back to the previous state. Run other application and close. When closed, go back to Smart board (Dash board.) When closed, go back to MyApp. When closed, go back to Search Result. When closed, start Network Setting. (In case when the CP is entered into NetCast of Smart board (Dash board.) When closed, go back to network setting. End of enumeration
17
LocaleGroup
This is locale group for LG Flash Open API. class lge.apis.LocaleGroup { public static var KR: Number public static var US: Number public static var BR: Number public static var EU: Number public static var CN: Number public static var AU: Number public static var SG: Number public static var ZA: Number public static var VN: Number public static var TW: Number public static var XA: Number public static var XB: Number public static var IL: Number public static var ID: Number public static var MY: Number public static var IR: Number public static var HK: Number public static var ZZ: Number }
= = = = = = = = = = = = = = = = = =
Member KR US BR EU CN AU SG ZA VN TW XA XB IL ID MY IR HK 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Value Korea United States Brazil EU China Australia Singapore South Africa Vietnam Taiwan
Description
Latin America - countries using the analog broadcast standard. (NTSC) Central Asia and Asia/Oceania - countries using the analog broadcast standard. (PAL) Israel Indonesia Malaysia Iran China (Hong Kong)
18
Member ZZ 18
Description
19
LocaleInfoType
This is locale information type for LG Flash Open API class lge.apis.LocaleInfoType { public static var COUNTRY:Number = 0; public static var LANGUAGE:Number = 1; public static var GROUP:Number = 2; } Member Value Description Gets the country information from TV settings. The country code complies with the ISO-3166 Alpha-3 standard. It returns a string that represents the three-letter code (alpha-3) of ISO 3166-1. For example, ISO 3166-1 Code : KOR Country code to be returned : "KOR" Gets the language information from TV settings. The language code complies with the ISO 639-2 standard. It returns a string that represents the three-letter code (alpha-3) of ISO 639. For example, ISO 639-2 Code : kor Language code to be returned : "kor" Gets the group information from TV settings and returns it in number. Group is defined as lge.apis.LocaleGroup.
COUNTRY
LANGUAGE
GROUP
20
MediaChannel
This is media channel for LG Flash Open API. Media channel type C is not used. class lge.apis.MediaChannel { public static var A:Number public static var B:Number public static var RESERVED1:Number public static var NUM:Number } Member A B RESERVED1 NUM 0 1 2 3 Value Channel A Channel B RESERVED1 Maximum channel number
= = = =
0; 1; 2; 3;
Description
21
MediaCodecAudio
This is media codec audio for LG Flash Open API. class lge.apis.MediaCodecAudio { public static var MP3:Number public static var AC3:Number public static var MPEG:Number public static var AAC:Number public static var CDDA:Number public static var PCM:Number public static var LBR:Number public static var WMA:Number public static var DTS:Number public static var AC3PLUS:Number public static var MASK:Number } Member MP3 AC3 MPEG AAC CDDA PCM LBR WMA DTS AC3PLUS MASK Value 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0F MP3 codec AC3 codec MPEG codec AAC codec CDDA codec PCM codec LBR codec WMA codec DTS codec AC3 plus codec Gets the audio codec from Mixed property from Audio/Video codec.
= = = = = = = = = = =
0x01; 0x02; 0x03; 0x04; 0x05; 0x06; 0x07; 0x08; 0x09; 0x0A; 0x0F;
Description
22
MediaCodecImage
This is media codec image for LG Flash Open API. class lge.apis.MediaCodecImage { public static var JPEG:Number public static var PNG:Number public static var MASK:Number } Member JPEG PNG MASK Value (0x01<<8) (0x02<<8) (0x0F<<8) JPEG codec PNG codec Image codec mask
Description
23
MediaCodecVideo
This is media codec video for LG Flash Open API. class lge.apis.MediaCodecVideo { public static var MPEG1:Number public static var MPEG2:Number public static var MPEG4:Number public static var MJPEG:Number public static var H264:Number public static var REALVIDEO:Number public static var WMV:Number public static var YUY2:Number public static var VC1:Number public static var DIVX:Number public static var MASK:Number } Member MPEG1 MPEG2 MPEG4 MJPEG H264 REALVIDEO WMV YUY2 VC1 DIVX MASK Value 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xA0 0xF0 MPEG1 codec MPEG2 codec MPEG4 codec MJPEG codec H.264 codec Real video codec WMV codec YUY2 (YUV422) format VC1 codec Divx codec Video codec mask
= = = = = = = = = = =
0x10; 0x20; 0x30; 0x40; 0x50; 0x60; 0x70; 0x80; 0x90; 0xA0; 0xF0;
Description
24
MediaFormatType
This is media format type for LG Flash Open API. class lge.apis.MediaFormatType { public static var RAW:Number public static var WAV:Number public static var MP3:Number public static var AAC:Number public static var AVI:Number public static var MP4:Number public static var MPEG1:Number public static var MPEG2:Number public static var ASF:Number public static var MKV:Number public static var JPG:Number public static var PNG:Number public static var CIF:Number public static var AUDIO_MASK:Number public static var VIDEO_MASK:Number public static var IMAGE_MASK:Number } Member RAW WAV MP3 AAC AVI MP4 MPEG1 MPEG2 ASF MKV JPG PNG CIF AUDIO_MASK VIDEO_MASK IMAGE_MASK Value 0x00 0x01 0x02 0x03 (0x01<<8) (0x02<<8) (0x03<<8) (0x04<<8) (0x05<<8) (0x06<<8) (0x08<<16) (0x09<<16) (0x0A<<16) 0xFF (0xFF<<8) (0xFF<<16)
= = = = = = = = = = = = = = = =
0x00; 0x01; 0x02; 0x03; (0x01<<8); (0x02<<8); (0x03<<8); (0x04<<8); (0x05<<8); (0x06<<8); (0x08<<16); (0x09<<16); (0x0A<<16); 0xFF; (0xFF<<8); (0xFF<<16);
Description Raw data encoded in audio/video codec with no file format specified WAVE file format (audio) MP3 file format (audio) AAC file format (audio) AVI file format (video) MPEG4 file format (video) MPEG1 file format (video) MPEG2 file format (video) ASF file format (video) MKV file format (video) JPEG file format (image) PNG file format (image) CIF file format (image) Audio file format mask Video file format mask Image file format mask
25
MediaPlayState
This is media play state for LG Flash Open API. class lge.apis.MediaPlayState { public static var STOP:Number public static var PLAY:Number public static var PAUSE:Number } Member STOP PLAY PAUSE 0 1 2 Value Stop state Play state Pause state
= 0; = 1; = 2;
Description
26
MediaTransportType
This is media transport type for LG Flash Open API. class lge.apis.MediaTransportType { public static var FILE:Number public static var DLNA:Number public static var RESERVED1:Number public static var RESERVED2:Number public static var RESERVED3:Number public static var MSDL:Number public static var RESERVED4:Number public static varRESERVED5:Number public static var RESERVED6:Number } Member FILE DLNA RESERVED1 RESERVED2 RESERVED3 MSDL RESERVED4 RESERVED5 RESERVED6 Value 0x01 0x02 0x03 0x04 0x05 0x06 0x10 0x11 0x12
= = = = = = = = =
Description Selects when playing files. Selects when playing files with DLNA. RESERVED1 RESERVED2 RESERVED3 Selects when playing files with MSDL. RESERVED4 RESERVED5 RESERVED6
27
MessageType
This is message type for LG Flash Open API. class lge.apis.MessageType { public static var MR_GESTURE_NORMAL:Number = 0; public static var MR_GESTURE_SWING:Number = 1; public static var MR_GESTURE_SWING_END:Number = 2; public static var MR_GESTURE_SPACE_SENSING:Number = 3; public static var MR_GESTURE_JUMP:Number = 4; public static var MR_GESTURE_THROW:Number = 5; public static var MR_GESTURE_FISHING:Number = 6; public static var MR_GESTURE_END:Number = 7; public static var MR_SETFEEDBACK:Number = 8; public static var MR_REMOVECURSOR:Number = 9; public static var MR_DISABLE_REMOVECURSOR:Number = 10; public static var MR_MOTION_ON:Number = 11; public static var MR_MOTION_OFF:Number = 12; public static var MR_MOTION_POINT_MODE_HIDDEN:Number = 13; public static var MR_MOTION_POINT_MODE_SELECT:Number = 14; public static var MR_MOTION_POINT_MODE_BUSY:Number = 15; public static var MR_MOTION_POINT_MODE_TEXT:Number = 16; public static var MR_MOTION_POINT_MODE_DRAG:Number = 17; public static var MR_MOTION_POINT_MODE_FORBIDDEN:Number = 18; public static var MR_MOTION_POINT_MODE_PREV:Number = 19; public static var END:Number = 0xff; } Member MR_GESTURE_NORMAL MR_GESTURE_SWING MR_GESTURE_SWING_END MR_GESTURE_SPACE_SENS ING MR_GESTURE_JUMP MR_GESTURE_THROW MR_GESTURE_FISHING MR_GESTURE_END MR_SETFEEDBACK MR_REMOVECURSOR MR_DISABLE_REMOVECURS OR MR_MOTION_ON MR_MOTION_OFF MR_MOTION_POINT_MODE_ HIDDEN MR_MOTION_POINT_MODE_ SELECT MR_MOTION_POINT_MODE_ BUSY Value 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Magic Motion Remote Control is ready for the gesture message. Magic Motion Remote Control is ready for the swing message. Magic Motion Remote Control is ready to end the swing message. Magic Motion Remote Control is ready for the space sensing message. Magic Motion Remote Control is ready for the jump message. Magic Motion Remote Control is ready for the throw message. Magic Motion Remote Control is ready for the fishing message. Magic Motion Remote Control is ready to end the gesture recognition message. Feed back of Magic Motion Remote Control Magic Motion Remote Control removes E-Manual MR pointer. Disables the Magic Motion Remote Controls function that removes E-Manual MR pointer. Disables the Magic Motion Remote Controls event if its input is received. Enables Magic Motion Remote Control. Magic Motion Remote Control is invisible. Arrow pointer of Magic Motion Remote Control Hourglass pointer of Magic Motion Remote Control
28
Member MR_MOTION_POINT_MODE_ TEXT MR_MOTION_POINT_MODE_ DRAG MR_MOTION_POINT_MODE_ FORBIDDEN MR_MOTION_POINT_MODE_ PREV END
Value 16 17 18 19 0xff
Description I-beam pointer of Magic Motion Remote Control Hand pointer of Magic Motion Remote Control Slashed circle pointer of Magic Motion Remote Control Previous style pointer of Magic Motion Remote Control End of enumeration
29
NetworkStatus
This is network status for LG Flash Open API. class lge.apis.NetworkStatus { public static var LINK_DISCONNECTED:Number public static var LINK_CONNECTED:Number public static var DISCONNECTED:Number public static var CONNECTED:Number public static var TRY_TO_CONNECT:Number } Member LINK_DISCONNECTED LINK_CONNECTED DISCONNECTED CONNECTED TRY_TO_CONNECT 0 1 2 3 4 Value
= = = = =
0; 1; 2; 3; 4;
Description Ethernet cable is disconnected. Ethernet cable is connected. Ethernet cable is connected. A ping operation on the given address is failed. Ethernet cable is connected and the Internet is working. Or, a ping on the given address is successful. Trying to connect the network.
30
NetworkType
This is network type for LG Flash Open API. class lge.apis.NetworkType { public static var NONE:Number = 0; public static var WIRED_ETHERNET:Number = 1; public static var WIRELESS_WIFI:Number = (1<<1); } Member NONE: WIRED WIRELESS_WIFI 0 1 (1<<1) Value None Wired Network Wireless Network Description
31
OSDType
This is OSD (On Screen Display) type for LG Flash Open API. class lge.apis.OSDType { public static var NONE:Number public static var MAIN:Number public static var SUB:Number public static var SUB_2:Number public static var NUM:Number } Member NONE MAIN SUB SUB_2 NUM -1 0 1 2 3 Value None Main OSD Sub OSD Sub-2 OSD Total number of these variables
= = = = =
-1; 0; 1; 2; 3;
Description
32
PanelAttributeType
This is panel attribute type for LG Flash Open API. class lge.apis.PanelAttributeType { public static var RESOLUTIONTYPE:Number public static var DISPLAYTYPE:Number public static var BACKLIGHTTYPE:Number public static var FRCFRAMERATE:Number public static var INCH:Number public static var LAST:Number } Member RESOLUTIONTYPE DISPLAYTYPE BACKLIGHTTYPE FRCFRAMERATE INCH LAST 0 1 2 3 4 5 Value
= = = = = =
0; 1; 2; 3; 4; 5;
Description Gets Resolution Type. (lge.apis.PanelResType) Gets Display Type. (lge.apis.PanelType) Gets Back Light Type. (lge.apis.PanelBacklightType) Sub-2 OSD Gets FRC Frame Rate. (Number, Hz) End of this enumeration
33
PanelBacklightType
This is panel backlight type for LG Flash Open API. class lge.apis.PanelBacklightType { public static var CCFL:Number public static var NOR_LED:Number public static var EDGE_LED:Number public static var IOP_LED:Number public static var LAST:Number } Member CCFL NOR_LED EDGE_LED IOP_LED LAST 0 1 2 3 4 Value CCFL NOR LED Edge LED IOP LED End of enumeration
= = = = =
0; 1; 2; 3; 4;
Description
34
PanelResType
This is panel resolution type for LG Flash Open API. class lge.apis. PanelResType { public static var RES_1920X1080P:Number public static var RES_1920X1080I:Number public static var RES_1376X776P:Number public static var RES_1366X768P:Number public static var RES_1365X768P:Number public static var RES_1024X768P:Number public static var RES_1024X720P:Number public static var RES_1280X720P:Number public static var RES_852X480P:Number public static var RES_720X480P:Number public static var NUMBER:Number } Member RES_1920X1080P RES_1920X1080I RES_1376X776P RES_1366X768P RES_1365X768P RES_1024X768P RES_1024X720P RES_1280X720P RES_852X480P RES_720X480P NUMBER 0 1 2 3 4 5 6 7 8 9 10 Value
= = = = = = = = = = =
0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10;
Description 1920x1080 Progressive 1920x1080 Interlaced 1376x776 Progressive 1366x768 Progressive 1365x768 Progressive 1024x768 Progressive 1024x720 Progressive 1280x720 Progressive 852x480 Progressive 720x480 Progressive Total number of these variables
35
PanelType
This is panel type for LG Flash Open API. class lge.apis. PanelType { public static var PLASMA:Number public static var LCD:Number public static var DLP_PROJECTION:Number public static var LCD_PROJECTION:Number public static var CRT:Number public static var NUMBER:Number } Member PLASMA LCD DLP_PROJECTION LCD_PROJECTION CRT NUMBER 0 1 2 3 4 5 Value PDP LCD DLP Projection LCD Projection CRT Total number of these variables
= = = = = =
0; 1; 2; 3; 4; 5;
Description
36
PopupType
This is popup type for LG Flash Open API. class lge.apis.PopupType { public static var RESERVED1:Number public static var RESERVED2:Number public static var RESERVED3:Number public static var RESERVED4:Number public static var RESERVED5:Number public static var RESERVED6:Number public static var 7RESERVED7:Number public static var QUICKMENU:Number public static var RESERVED8:Number public static var RESERVED9:Number public static var POPUP_3D:Number = 10; public static var LAST:Number } Member RESERVED1 RESERVED2 RESERVED3 RESERVED4 RESERVED5 RESERVED6 SRESERVED7 QUICKMENU RESERVED8 RESERVED9 POPUP_3D LAST 0 1 2 3 4 5 6 7 8 9 10 11 Value Reserved 1 Reserved 2 Reserved 3 Reserved 4 Reserved 5 Reserved 6 Reserved 7 Quick Menu (AV Setting menu) Reserved 8 Reserved 9 3D Menu(3D Setting Menu) End of this enumeration
= = = = = = = = = =
0; 1; 2; 3; 4; 5; 6; 7; 8; 9;
= 11;
Description
37
RemoconType
This is remote control type for LG Flash Open API. class lge.apis.RemoconType { public static var MOTION:Number = 0; public static var QUARTER_DIR:Number =1; } Member MOTION QUARTER_DIR 0 1 Value Description Magic Motion Remote Control Common Remote Control
38
ReturnCode
This is return type for LG Flash Open API. class lge.apis.ReturnCode { public static var OK:Number public static var HANDLED:Number public static var ERROR:Number public static var NOT_HANDLED:Number public static var BLOCKED:Number public static var INVALID_PARAMS:Number public static var NOT_ENOUGH_MEMORY:Number public static var TIMEOUT:Number public static var NOT_SUPPORTED:Number public static var BUFFER_FULL:Number public static var HOST_NOT_CONNECTED:Number public static var VERSION_MISMATCH:Number public static var ALREADY_REGISTERED:Number public static var LAST:Number } Member OK HANDLED ERROR NOT_HANDLED BLOCKED INVALID_PARAMS NOT_ENOUGH_MEMORY TIMEOUT NOT_SUPPORTED BUFFER_FULL HOST_NOT_CONNECTED VERSION_MISMATCH ALREADY_REGISTERED LAST 0 0 -1 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 Value
= = = = = = = = = = = = = =
0; 0; -1; -1; -2; -3; -4; -5; -6; -7; -8; -9; -10; -11;
Description Successfully executed. The given request is completely processed. An error occurred while processing the function. The given request is not processed completely. Other application is using HOA exclusively; failed to execute the function. The function parameter has an invalid value. The memory is not enough to execute the function. No response is received within the specified time since the execution request of the function. The function is not supported due to the version incompatibility. Failed to execute the function, because the buffer is filled up with data. Failed to execute the function, because the host is not connected. Failed to execute the function because of the version incompatibility between the application and the library. The application is already registered into the manager. End of enumeration
39
SupportType
This is support type for LG Flash Open API. class lge.apis.SupportType { public static var BLUETOOTH: Number public static var PHOTOMUSIC: Number public static var MOVIE: Number public static var CIFS:Number public static var DLNA:Number public static var MOTIONREMOCON:Number public static var DVRREADY:Number public static var WIRELESSREADY:Number public static var LOCALDIMMING:Number public static var PICTUREWIZARD:Number public static var ORANGE:Number public static var NETCAST:Number public static var CHANNELBROWSER:Number public static var IPTV:Number public static var SKYPE:Number public static var SUPPORT_3D:Number public static var LAST:Number } Member BLUETOOTH PHOTOMUSIC MOVIE CIFS DLNA MOTIONREMOCON DVRREADY WIRELESSREADY LOCALDIMMING PICTUREWIZARD ORANGE NETCAST CHANNELBROWSER IPTV SKYPE SUPPORT_3D LAST 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Value Support for Bluetooth Support for photos and music (in EMF) Support for movies (EMF) Support for CIFS Support for DLNA Support for the Magic Motion Remote Control Support for DVR Support for wireless connection Support for local dimming Support for Picture Wizard Support for Orange Support for NetCast Support for Channel Browser Support for IPTV Support for Skype Support for 3D End of enumeration
= = = = = = = = = = = = = = = = =
Description
40
TVSourceType
This is TV source type for LG Flash Open API. class lge.apis.TVSourceType { public static var INPUT_ANTENNA_ANALOG public static var INPUT_ANTENNA_DIGITAL public static var INPUT_CABLE_ANALOG public static var INPUT_CABLE_DIGITAL public static var INPUT_CABLE_UNDEFINED public static var INPUT_OCABLE_ANALOG public static var INPUT_OCABLE_DIGITAL public static var INPUT_1394_TV public static var INPUT_CABLE_BOX public static var INPUT_IP public static var SYS_DVB public static var SYS_ATSC public static var UNDEFINED } Member INPUT_ANTENNA_ANAL OG INPUT_ANTENNA_DIGIT AL INPUT_CABLE_ANALOG INPUT_CABLE_DIGITAL INPUT_CABLE_UNDEFI NED INPUT_OCABLE_ANALO G INPUT_OCABLE_DIGITA L INPUT_1394_TV INPUT_CABLE_BOX INPUT_IP SYS_DVB SYS_ATSC UNDEFINED Value 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007 0x0008 0x0009 0x000A 0x1000 0x2000 0x0000
:Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number :Number
= = = = = = = = = = = = =
0x0001; 0x0002; 0x0003; 0x0004; 0x0005; 0x0006; 0x0007; 0x0008; 0x0009; 0x000A; 0x1000; 0x2000; 0x0000;
Description Analog input transmitted through the antenna Digital input transmitted through the antenna Analog input transmitted through the cable Digital (QAM or VSB) input transmitted through the cable Undefined input transmitted through the cable Analog input transmitted through the OpenCable Digital input transmitted through the OpenCable 1394 input Cable box input IP input DVB System ATSC System Undefined input
41
SmartMsg
This is smart message type for LG Flash Open API. class lge.apis.SmartMsg { public static var NOTI:Number public static var SHOW:Number public static var HIDE:Number public static var LAST:Number } Member NOTI SHOW HIDE LAST 0 1 2 3 Value
= = = =
0; 1; 2; 3;
Description Send string and caret position to a smart phone Activate the virtual keyboard on a smart phone Deactivate the virtual keyboard on a smart phone End of enumeration
42
Input3DMode
This is 3D mode for LG Flash Open API. class lge.apis.Input3DMode { public static var TOP_BOTTOM:Number public static var SIDE_SIDE:Number public static var CHECK_BOARD:Number public static var FULL_HD:Number public static var RESERVED1:Number public static var RESERVED2:Number public static var INPUT_2D_3D:Number public static var LAST:Number } Member TOP_BOTTOM SIDE_SIDE CHECK_BOARD FULL_HD RESERVED1 RESERVED2 INPUT_2D_3D LAST 0 1 2 3 4 5 6 7 Value Top-Bottom mode Side-by-Side mode Check board mode Full HD mode RESERVED 1 RESERVED 2 Input-2D-3D mode End of enumeration
= = = = = = = =
0; 1; 2; 3; 4; 5; 6; 7;
Description
43
2.2
2.2.1
Application
Description
Definition
Application controls all instances and operations that occur when the system starts, runs and stops.
Features
Requests/cancels a focus Requests a resource assignment; returns the assigned resource Starts and stops other applications; gets the number of currently running applications
2.2.2
Function
Following is the functions of Application component.
44
releaseFocus
Description An application requests the release of focus. Syntax public function releaseFocus(exitCode:Number): Number;
Parameters exitCode
[in] The state when the application looses the focus (lge.apis.ExitCode)
Return Value OK if a notification on releasing focus is successfully sent; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var retNum:Number= app.releaseFocus(exitCode);
45
requestFocus
Description An application requests the focus. Syntax public function requestFocus(): Number;
Parameters None Return Value OK if the request is successfully sent; otherwise ERROR. Remarks Sometimes, the focus you requested is not delivered well. Check the message handler to confirm the focus status. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var retNum:Number= app.requestFocus();
46
setReady
Description This function informs manager that the application is ready to be executed. Syntax public function setReady():Number;
Parameters None Return Value OK if informing manager is successfully executed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var retNum:Number = app.setReady();
47
getCommonPath
Description This function gets the root path of common Flash Gadget. Syntax public function getCommonPath(): Object;
Parameters None Return Value retObject.retCode:Number OK if gadget path is successfully returned; otherwise ERROR. retObject.path:String Gadget path Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var retObj:Object= app.getCommonPath();
48
back
Description This function goes back to the display that user wanted. Syntax public function back(): Number;
Parameters None Return Value OK if the display goes back successfully; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var retNum:Number = app.back();
49
exit
Description This function exits the currently running application. Syntax public function exit(): Number; Parameters None Return Value OK if exit is successfully called, otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var retNum:Number = app.exit();
50
getAppArgument
Description This function returns appropriate value that matches the key in the argument string sent from the application which requested executing a Flash application. Syntax public function getAppArgument(key:String):String; Parameters key Return Value
keyValue:String
Data that stores the value. Remarks When you execute App, some parameters are sent to TV. It consists of 4 parts and they are separated with a space. - The type of execution (--multi or --bg) - The path of the executable parameter - --args - The data to be read -multi gostop.swf --args title=Go Stop&vender=LG? false. This is an executable parameter sample. The sample consists of: --multi, gostop.swf, --args and title=GoStop&vender=LG. --multi, gostop.swf and --args are the required parts by App Manager. The last part 'title=GoStop&vender=LG' is tomporarily stored in the memory for the application to access during the execution. This part consists of one or more key=value formats by an ampersand (&). Example //required class import import lge.apis.ReturnCode ; import lge.apis.Application; //object and variable declaration var app:Application = new Application; //function call var title:String = app.getAppArgument(title);
51
2.3
2.3.1
Control
Description
Definition
Control allows using the functionalities of a legacy application in the system. Currently, an API that supports the TV features is available. It offers the API to support general TV features including host software's exclusive information, channel switching, volume adjusting and program information loading. There are other functions which must be called by the application when TV works as a host.
Features
Channel up/down Volume setting Audio/video block/unblock Aspect ratio setting Video display area setting Importing a channel list, broadcast information list and schedule list Current language, country and country group Support for the TV features (e.g., Bluetooth, DLNA, and Magic Motion Remote Control) Creating a popup message box Magic Motion Remote Control-related features UI display setting (On/off, display mode)
2.3.2
Function
Following is the functions of Control component.
52
setVolume
Description This function adjusts the TV volume. Both relative (+1, -1...) and absolute (0 - 100) values can be used to adjust the volume. Syntax public function setVolume(bShowVolumebar:Boolean, appType:Number, bRelative:Boolean, volumeIn:Number): Number;
[in] TRUE if the DTV UI volume bar is displayed for the changed volume; otherwise FALSE. [in] Adjusts TV volume. Value lge.apis.AppType.HOST lge.apis.AppType.ADDON lge.apis.AppType.ALL Description Adjusts the TV volume. Adjusts the add-on application volume. Adjusts all volumes.
bRelative volumeIn
[in] TRUE if volumeIn is a relative value; FALSE if it is an absolute value. [in] Value to adjust the volume TRUE if bRelative is a relative value; FALSE if it is an absolute value. The volume can be adjusted within the range of 0 - 100.
Return Value OK if the volume is adjusted; otherwise ERROR. Remarks Before you use this API, check the Mute status with getMute. If Mute is on, turn it off to use this API. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.AppType; //object and variable declaration var control:Control = new Control; //function call var retNum:Number= control.setVolume(TRUE, AppType.HOST, FALSE, 50);
53
getVolume
Description This function gets the current TV volume. Syntax public function getVolume(appType:Number): Object;
Parameters appType
[in] lge.apis.AppType. Value AppType.HOST AppType.ADDON AppType.ALL Description The TV volume The add-on application volume All volumes
Return Value retObject.retCode:Number OK if the volume is adjusted; otherwise ERROR. retObject.volumeOut: Number Gets the current volume (absolute value) Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.AppType; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getVolume(AppType.HOST);
54
setMute
Description This function mutes the TV volume. Syntax public function setMute(bShowVolumebar:Boolean, bMute:Boolean): Number;
[in] TRUE if the DTV UI volume bar is displayed for the changed mute status; otherwise FALSE. [in] Mutes the current volume if TRUE; changes back to the original volume if FALSE.
Return Value OK if the volume is muted; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setMute(TRUE, TRUE);
55
getMute
Description This function gets the mute status of the TV. Syntax public function getMute(Void): Object;
Parameters None Return Value retObject.retCode:Number OK if the mute status is successfully obtained; otherwise ERROR. retObject.bMute: Boolean Gets the mute status Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getMute();
56
setAVBlock
Description This function blocks the video and/or audio from playing on the TV or from the speaker. Syntax public function setAVBlock(bBlockAudio:Boolean, bBlockVideo:Boolean): Number;
[in] TRUE to block the audio; otherwise FALSE. [in] TRUE to block the video; otherwise FALSE.
Return Value OK if audio/video is successfully blocked; otherwise ERROR. Remarks Audio or video state that was already blocked in TV is not changed, even if an application enables it. It is still blocked based on the TVs state. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setAVBlock(TRUE, TRUE);
57
getAVBlock
Description This function gets whether or not the video is being displayed on the screen; or whether or not the audio is being generated from the speaker. Syntax public function getAVBlock(void):Object Parameters None Return Value retObject.retCode:Number OK if the audio/video blocking status is successfully obtained; otherwise ERROR. retObject.bBlockAudio TRUE if the audio is being blocked; otherwise FALSE. retObject.bBlockVideo TRUE if the video is being blocked; otherwise FALSE. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getAVBlock();
58
resetAVBlock
Description This function resets the audio/video blocking. That is, it resets the audio/video blocking to the default setting used before the add-on application runs. Syntax public function resetAVBlock(Void): Number; Parameters None Return Value OK if it is reset successfully; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.resetAVBlock();
59
setDisplayResolution
Description This function sets the display resolution. Syntax public function setDisplayResolution(height:Number, width:Number, osdType:Number):Number; Parameters height width osdType
Return Value OK if setting display resolution is successful; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.OSDType; //object and variable declaration var control:Control = new Control; //function call var retNum:Number=control.setDisplayResolution(100,200,OSDType.MAIN);
60
getDisplayResolution
Description This function gets the display resolution. Syntax public function getDisplayResolution(void):Object; Parameters None Return Value retObject.retCode:Number OK if the display resolution is successfully obtained; otherwise ERROR. retObject.width: Number The width of the display retObject.height: Number The height of the display Remarks Note that the display resolution refers to the video plane resolution which is different to the UI plane resolution. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getDisplayResolution();
61
setDisplayMode
Description This function sets the display mode. Image quality is determined by the display mode. Syntax public function setDisplayMode(displayMode:Number): Number;
Parameters displayMode
Return Value OK if the display mode is successfully changed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.DisplayMode; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setDisplayMode(DisplayMode.FULLUI);
62
getDisplayMode
Description This function gets the display mode. Syntax public function getDisplayMode(): Object
Parameters None Return Value retObject.retCode:Number OK if the display mode is successfully obtained; otherwise ERROR. retObject.displayMode:Number Current Addon App on a screen (lge.apis.DisplayMode) Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.DisplayMode; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getDisplayMode();
63
setDisplayArea
Description This function sets the display area of the video. It uses the getDisplayResolution() function to get the resolution and sets the display area and size within the corresponding resolution. Syntax public function setDisplayArea(inX:Number, inY:Number, inWidth:Number, inHeight:Number,dispX:Nubmer, dispY:Number, dispWidth:Number, dispHeight:Number): Number; Parameters inX inY inWidth inHeigh dispX dispY dispWidth dispHeight
[in] The X coordinate of the area in which the input video is displayed [in] The Y coordinate of the area in which the input video is displayed [in] The width of the area in which the input video is displayed [in] The height of the area in which the input video is displayed [in] The X coordinate of the area to be displayed on the screen [in] The Y coordinate of the area to be displayed on the screen [in] The width of the area to be displayed on the screen [in] The height of the area to be displayed on the screen
Return Value OK if the display area is set successfully; otherwise ERROR. Remarks Note that the display resolution refers to the video plane resolution which is different to the UI plane resolution. Set inX, inY, inWidth, and inHeight to "0" to set the whole input video area as a display area; set dispX, dispY, dispWidth, and dispHeight to "0" to display the video in full screen mode. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setDisplayArea(50,50,80,100,0,0,200,200);
64
getDisplayArea
Description This function gets the area in which the video is displayed. Syntax public function getDisplayArea(Void): Object; Parameters None Return Value retObject.retCode:Number OK if the display area is set successfully; otherwise ERROR. retObject.inX: Number The X coordinate of the area in which the input video is displayed retObject.inY: Number The Y coordinate of the area in which the input video is displayed retObject.inWidth: Number The width of the area in which the input video is displayed retObject.inHeight: Number The height of the area in which the input video is displayed retObject.dispX: Number The X coordinate of the area to be displayed on the screen retObject.dispY: Number The Y coordinate of the area to be displayed on the screen retObject.dispWidth: Number The width of the area to be displayed on the screen retObject.dispHeight: Number The height of the area to be displayed on the screen Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getDisplayArea();
65
resetDisplayArea
Description This function resets the display area. That is, it resets the display area to the default setting used before the add-on application runs. Syntax public function resetDisplayArea(Void): Number; Parameters None Return Value OK if it is reset successfully; otherwise ERROR. Remarks Note that the display area refers to the video plane and does not apply to the UI plane. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.resetDisplayArea();
66
setAspectRatio
Description This function sets the aspect ratio. Syntax public function setAspectRatio(ratio: Number): Number; Parameters ratio
Return Value OK if the aspect ratio is applied successfully; otherwise ERROR. Remarks Note that the aspect ratio applies only to the video plane, not to the UI plane. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.AspectRatio; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setAspectRatio(AspectRatio.ARC16X9);
67
getAspectRatio
Description This function gets the current aspect ratio. Syntax public function resetAspectRatio(void): Number; Parameters None Return Value retObject.retCode:Number OK if the aspect ratio is successfully obtained; otherwise ERROR. retObject.ratio:Number The current aspect ratio (lge.apis.AspectRatio) Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getAspectRatio();
68
resetAspectRatio
Description This function resets the display area to the default setting used before the add-on application runs. Syntax public function resetAspectRatio(void): Number; Parameters None Return Value OK if it is reset successfully; otherwise ERROR. Remarks Note that the aspect ratio applies only to the video plane, not to the UI plane. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.resetAspectRatio();
69
channelUp
Description This function increases the current channel number one by one. Syntax public function channelUp(bShowBanner:Boolean): Number; Parameters bShowBanner
[in] TRUE if the DTV UI banner is displayed for the changed channel; otherwise FALSE.
Return Value OK if the channel is changed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control;
70
channelDown
Description This function decreases the current channel number one by one. Syntax public function channelDown(bShowBanner:Boolean): Number; Parameters bShowBanner
[in] TRUE if the DTV UI banner is displayed for the changed channel; otherwise FALSE.
Return Value OK if the channel is changed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control;
71
setChannel
Description This function changes the given channel number. Syntax public function setChannel(bShowBanner:Boolean,channel:Object): Number; Parameters bShowBanner channel
[in] TRUE if the DTV UI banner is displayed for the changed channel; otherwise FALSE. [in] Channel object Value channel.SourceType:Number channel.MajorNum:Number channel.MinorNum:Number channel.PhysicalNum:Number Description Broadcasting Source Type (lge.apis.TVSourceType) Major Number Minor Number (Not used in case of DVB) Physical Number
Return Value OK if the channel is changed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.TVSourceType; //object and variable declaration var control:Control = new Control; //parameter var chObj:Object = new Object(); chObj.SourceType = TVSourceType.INPUT_ANTENNA_DIGITAL; chObj.MajorNum = 15; chObj.MinorNum = 0; chObj.PhysicalNum = 15; //function call var retNum:Number = control.setChannel(true,chObj);
72
getChannel
Description This function gets the current channel. Syntax public function getChannel(); Parameters None Return Value retObject.retCode:Number OK if the current channel is successfully obtained; otherwise ERROR. retObject.SourceType: Number Broadcasting source type (lge.apis.TVSourceType) retObject.Name: String Channel Name retObject.MajorNum:Number Major Number retObject.MinorNum:Number Minor Number (Not used in case of DVB) retObject.PhysicalNum:Number Physical Number Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getChannel();
73
getChannelList
Description This function gets the channel list. Syntax public function getChannelList(attribute:Number):Object; Parameters None Parameters attribute
[in] Gets the related attribute for the channel. It gets the Favorite List, Audio channel or Video channel. lge.apis.ChMap and lge.apis.ChAttrib value can be used with an OR operation.
Return Value retObject.retCode:Number OK when channel list is successfully obtained; otherwise, ERROR. retObject.channelNum:Number The number of Channels retObject.channelArr:Array Channel array (amount of channelNum) retObject.channelArr[].SourceType:Number Broadcasting Source Type (lge.apis.TVSourceType) retObject.channelArr[].Name:String Channel Name retObject.channelArr[].MajorNum:Number Major Number retObject.channelArr[].MinorNum:Number Minor Number (Not used in case of DVB) retObject.channelArr[].PhysicalNum:Number Physical Number Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.ChAttrib; import lge.apis.ChMap; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control. getChannelList(ChMap.CUSTOMIZED|ChAttrib.TV_ONLY);
74
getLocaleInfo
Description This function gets the country, language and country group information from TV settings. The country code complies with the ISO 3166-1alpha-3 standard. It returns a string that represents the three-letter code (alpha-3) of ISO 3166-1. For example, ISO 3166-1 code : KOR Country code to be returned : "KOR" The language code complies with the ISO 639-2 standard. It returns a string that represents the three-letter code (alpha-3) of ISO 639. For example, ISO 639-2 Code : kor Language code to be returned : "kor" This function gets the group information from the TV settings and returns it in number. Group is defined as lge.apis.LocaleGroup. Syntax public function getLocaleInfo():Object Parameters None Return Value retObject.retCode:Number OK if the locale information is successfully obtained; otherwise ERROR. retObject.country: String The specified country retObject.language: String The specified language retObject.group: Number The specified group (lge.apis.LocaleGroup) Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.LocaleInfoType; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getLocaleInfo();
75
getCountry
Description This function gets the country information from TV settings. The country code complies with the ISO 3166-1 alpha-3 standard. It returns a string that represents the three-letter code (alpha-3) of ISO 3166-1. For example, ISO 3166-1 code : KOR Country code to be returned : "KOR" Syntax public function getCountry():Object Parameters None Return Value retObject.retCode:Number OK if the country information is successfully obtained; otherwise ERROR. retObject.country:String The specified country Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getCountry();
76
getMenuLanguage
Description This function gets the language information from TV settings. The language code complies with the ISO 639-2 standard. It returns a string that represents the three-letter code (alpha-3) of ISO 639. For example, ISO 639-2 Code : kor Language code to be returned : "kor" Syntax public function getMenuLanguage():Object Parameters None Return Value retObject.retCode:Number OK if the locale information is successfully obtained; otherwise ERROR. retObject.language: String The specified language Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getMenuLanguage();
77
getRegion
Description This function gets the country group information from TV settings. This function gets the group information from TV settings and returns it in number. Group is defined as lge.apis.LocaleGroup. Syntax public function getRegion():Object Parameters None Return Value retObject.retCode:Number OK if the locale information is successfully obtained; otherwise ERROR. retObject.group: Number The specified group (lge.apis.LocaleGroup) Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.LocaleInfoType; //object and variable declaration var control:Control = new Control; //function call var retObj:Object= control.getRegion();
78
getCapability
Description This function gets the TV features. The features are Bluetooth, DLNA, Magic Motion Remote Control, Skype, etc. Syntax public function getCapability(supportType: Number):Object; Parameters supportType
Return Value retObject.retCode:Number OK if the supported feature is identified; otherwise ERROR. retObject.bSupport:Boolean TRUE if the feature is supported; otherwise FALSE or the supported type Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.SupportType; //object and variable declaration var control:Control = new Control;
79
getSystemInfo
Description This function gets the TV system information such as the model name and hardware/software versions. Syntax public function getSystemInfo(Void): Object; Parameters None Return Value retObject.retCode:Number OK if the information is successfully obtained; otherwise ERROR. retObject.projectName:String The project name retObject.modelName:String The model name retObject.hwVer:String The hardware version retObject.swVer:String The software version retObject.ESN:String ESN retObject.toolTypeName:String The tool type name retObject.serialNumber:String The serial number Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control;
80
getStorageSize
Description This function gets the storage size. Syntax public function getStorageSize(absPath:String):Object; Parameters absPath
[in] Absolute path of storage that user want to get the size
Return Value retObject.retCode:Number OK if the storage size is successfully obtained; otherwise ERROR. retObject.availableStorageSize:Number The storage available size retObject.totalStorageSize:Number The storage total size Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //parameter var absPath:String = /mnt/test/bin //function call var retObj:Object = control.getStorageSize(absPath);
81
getRemoconTypeInfo
Description This function gets the information of remote control type. Syntax public function getRemoconTypeInfo():Object; Parameters None Return Value retObject.retCode:Number OK if the remote control type is successfully obtained; otherwise ERROR. retObject.remoconType:Number Remote control type (lge.apis.RemoconType) Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.RemoconType; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getRemoconTypeInfo();
82
setMotionRemoteMode
Description This function sets the mode of Magic Motion Remote Control. Syntax public function setMotionRemoteMode(mode:Number):Number
Parameters mode
Return Value OK if the remote mode is successfully changed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.Messagetype; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setMotionRemoteMode(Messagetype.MR_REMOVECURSOR);
83
getDisplayPanelType
Description This function gets the panel type of the TV display. Syntax public function getDisplayPanelType(panelAttribType:Number): Object;
Parameters panelAttribType
[in] The attribute type of the display panel, which you want to know (lge.apis.PanelAttributeType)
Return Value retObject.retCode:Number OK if the display panel attribute is successfully obtained; otherwise ERROR. retObject.type: Number The value varies depending on the display panel attribute and the attribute type. (see "lge.apis.PanelAttributeType") Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.PanelAttributeType; //object and variable declaration var control:Control = new Control; //function call var retObj:Object = control.getDisplayPanelType(PanelAttributeType.DISPLAYTYPE);
84
setScreensaverOff
Description This function disables the screen saver or resets the value to the default setting. Syntax public function setScreensaverOff(bOff:Boolean): Number;
Parameters bOff
[in] TRUE to disable the screen saver; FALSE to reset the value to the default setting.
Return Value OK if the screen saver is successfully enabled and disabled; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setScreensaverOff(true);
85
setDimmingOff
Description This function disables the dimming feature or resets the value to the default setting. Syntax public function setDimmingOff(bOff:Boolean): Number;
Parameters bOff
[in] TRUE to disable the dimming feature; FALSE to reset to the value to default setting.
Return Value OK if the dimming feature is successfully enabled or disabled; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.setDimmingOff(true);
86
createPopup
Description This function creates a TV native popup. Syntax public function createPopup(popupOption: Object)Object; Parameters popupOption
Return Value retObject.retCode:Number OK if the popup is successfully created; otherwise ERROR. retObject.popupHandle:Number The handle of the created popup Remarks If the popup type is QUICKMENU or POPUP_3D, DisplayMode must be FULLVIDEO. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.DisplayMode; import lge.apis.PopupType; //object and variable declaration var control:Control = new Control; var popupOption:Object; popupOption.type = PopupType.QUICKMENU; //function call var retNum:Number = con.setDisplayMode(DisplayMode.FULLVIDEO); if(retNum== ReturnCode.OK) { var retObj:Object = control.createPopup(popupOption); }
87
activateSmartText
Description Activates the virtual keyboard on a smart phone or sends the string to the smart phone. (See "FFC2.0 Development Guide" for more details.) Syntax public function activateSmartText(showSelect:Number, positionX:Number, positionY:Number, textString:String):Number;
[in] Start Text Strings show/hide/none enum (lge.apis.SmartMsg) [in] Smart Text position x [in] Smart Text position y [in] Smart Text string
Return Value HOA_OK on success; Otherwise, ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Control; import lge.apis.SmartMsg; //object and variable declaration var control:Control = new Control; //function call var retNum:Number = control.activateSmartText(SmartMsg.NOTI, 0, 0, "test");
88
set3DMode
Description This function sets 3D mode with the assigned value. Syntax public function set3DMode(input3DMode:Number, bRLBalance:Boolean):Number;
Return Value OK if the 3D mode is successfully set; Otherwise ERROR. Remarks - 3D video is displayed only when DisplayMode is FULLVIDEO. - While video is on play, status change to 3D mode is unavailable. Example //required class import import lge.apis.Control; import lge.apis.Input3DMode; //object and variable declaration var control:Control = new Control(); //function call var retNum:Number= control.set3DMode(Input3DMode.TOP_BOTTOM, true);
89
get3DMode
Description This function gets the 3D mode value that is set at current TV. Syntax public function get3DMode():Object;
Parameters None Return Value retObject.retCode:Number ReturnCode.OK when 3D mode information is successfully received; Otherwise, ERROR. retObject.current3DMode:Number 3D mode (lge.apis.Input3DMode) retObject.bRLBalance:Boolean RL:true, LR:false Remarks None Example //required class import import lge.apis.Control; import lge.apis.Input3DMode; //object and variable declaration var control:Control = new Control(); //function call var retObj:Object= control.get3DMode(); var current3DMode:Number = retObj.current3DMode; var bRLBalance:Boolean = retObj.bRLBalance;
90
2.4
2.4.1
Media
Description
Definition
Media provides APIs to play and view audios, videos, and images. This module supports both streaming and downloaded media and offers related functionalities including playback, pause, resume, and stop. Also, it supports the seek functionality for the downloaded media.
Features
Audio clip playback Audio streaming playback Video clip playback Video streaming playback Image clip decoding
2.4.2
Function
Following is the functions of Media component.
91
openChannel
Description This function starts a channel and prepares the channel to play with the given transfer type and, format type. . Syntax public function openChannel(ch:Number, mediaTransportType:Number, mediaFormatType: Number): Number;
Parameters ch [in] A channel number (lge.apis.MediaChannel) mediaTransportType [in] Transport type of media file (lge.apis.MediaTransportType) mediaFormatType [in] A media file format (lge.apis.MediaFormatType) Return Value OK if playback is ready; INVALID_PARAMS if the parameter is not valid; otherwise ERROR. Remarks Transfer type to set for each type: Play Type File Streaming(MMS or HTTP) FILE MSDL Media Transport Type
RTMP class uses NetConnection and NetStream, not a Flash Open API. Example1 ( MediaTransportType:FILE and MediaFormatType:MP4) //required class import import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; import lge.apis.MediaTransportType; import lge.apis.MediaFormatType; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; var mediaTransportType:Number = MediaTransportType.FILE; var mediaFormatType:Number = MediaFormatType.MP4; //function call var retNum:Number = media.openChannel(ch, mediaTransportType, mediaFormatType); Example2 ( MediaTransportType: MSDL and MediaFormatType: ASF) //required class import import lge.apis.ReturnCode ;
92
import lge.apis.Media; import lge.apis.MediaChannel; import lge.apis.MediaTransportType; import lge.apis.MediaFormatType; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; var mediaTransportType:Number = MediaTransportType.MSDL; var mediaFormatType:Number = MediaFormatType.ASF; //function call var retNum:Number = media.openChannel(ch, mediaTransportType, mediaFormatType);
93
closeChannel
Description This function ends the channel. Syntax public function closeChannel(ch:Number): Number;
Parameters ch
Return Value OK if the channel is successfully ended; INVALID_PARAMS if the parameter is not valid; otherwise ERROR. Remarks If it is not a stop state, this function returns ERROR. To close channel, call stopClip first. Or, play should be fully done to the end and then finalized. Example //required class import import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; //function call var retNum:Number = media.closeChannel(ch);
94
playClipFile
Description This function plays the clip. When the mediaFormatType that you set when you open a channel is Video or Image, display position is playOption. (If it is NULL, full screen display is set.) Syntax public function playClipFile(ch:Number, filename:String, repeatNumber:Number, playOption:Object): Number;
[in] A channel number (lge.apis.MediaChannel) [in] An address for File path, URL, etc [in] Repeated play numbers. 0 = repeat endlessly (Only for Audio.) [in] Starting time, Cache use or not and Display position All properties are optional. Only the necessary property is added and delivered. Value playOption.x: Number playOption.y: Number playOption.width: Number playOption.height: Number playOption.startPositionMs: Number playOption.bCacheOff: Boolean Description X position Y position Width Height Time to start playing (Millisecond) (Not supported now.) TRUE if you do not use cache. (Not supported now.)
Return Value OK if the clip is successfully played; otherwise ERROR. Remarks For more information on MediaTransportType setting for each file type, refer to the openChannel. Example //required class import import lge.apis.Media; import lge.apis.MediaChannel; import lge.apis.ReturnCode; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; var filename:String = sample.mp3"; //function call
95
96
pauseClip
Description This function pauses the clip, which is being played. Syntax public function pauseClip(ch: Number): Number;
Parameters ch
Return Value OK if the clip is successfully paused; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; //function call var retNum:Number = media.pauseClip(ch);
97
resumeClip
Description This function resumes the paused clip. Syntax public function resumeClip(ch: Number):Number;
Parameters ch
Return Value OK if the clip is successfully resumed; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; //function call var retNum:Number = media.resumeClip(ch);
98
seekClip
Description This function seeks the clip; changes the starting point of the clip which is being played to another point. Syntax public function seekClip(ch: Number, playPositionMs: Number): Number;
Parameters ch playPositionMs
[in] A channel number (lge.apis.MediaChannel) [in] A starting point to play (in milliseconds)
Return Value OK if the clip is successfully sought; INVALID_PARAMS if the parameter is not valid; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; //function call var retNum:Number = media.seekClip(ch, 30);
99
stopClip
Description This function stops the clip, which is being played or paused. Syntax public function stopClip(ch: Number):Number;
Parameters ch
Return Value OK if the clip is successfully stopped; otherwise ERROR. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; //function call var retNum:Number = media.stopClip(ch);
100
getPlayInfo
Description This function gets the media play information, such as playback state and playback time of the media. Playback state includes play, stop, and pause, and the playback time is returned in milliseconds. Syntax public function getPlayInfo(ch: Number):Object;
Parameters ch
Return Value retObject.retCode:Number OK if successful; INVALID_PARAMS if the parameter is not valid; otherwise ERROR. retObject.playState:Number Media play state (lge.apis.MediaPlayState) retObject.elapsedMS:Number Elapsed time in milliseconds retObject.durationMS:Number Total duration in milliseconds retObject.bufBeginSec:Number The beginning of the buffered stream This is only valid for: MediaTransportType.DLNA MediaTransportType.YOUTUBE MediaTransportType.YAHOO retObject.bufEndSec:Number The end of the buffered stream This is only valid for: MediaTransportType.DLNA MediaTransportType.YOUTUBE MediaTransportType.YAHOO retObject.bufRemainSec:Number The rest of the buffered stream This is only valid for: MediaTransportType.DLNA MediaTransportType.YOUTUBE MediaTransportType.YAHOO retObject.instantBps:Number Current streaming speed This is only valid for: MediaTransportType.DLNA MediaTransportType.YOUTUBE MediaTransportType.YAHOO retObject.totalBps:Number The total streaming speed This is only valid for: MediaTransportType.DLNA MediaTransportType.YOUTUBE MediaTransportType.YAHOO
101
102
getSourceInfo
Description This function gets the media information, which is being played. Syntax public function getSourceInfo(ch:Number): Object;
Parameters ch
Return Value retObject.retCode:Number OK if audio/video is successfully blocked; INVALID_PARAMS if the parameter is not valid; otherwise ERROR. retObject.title: String The source title retObject.date: Date The date when the source was created retObject.dataSize:Number The total length of the source retObject.format: Number Media format (container type) of the source (lge.apis.MediaFormatType) retObject.codec: Number Media codec of the source (lge.apis.MediaCodecAudio, The O-Ringed value for lge.apis.MediaCodecVideo and lge.apis.MediaCodecImage) retObject.width: Number The width of the source (Not available for playing the audio only) retObject.height: Number The height of the source (Not available for playing the audio only) retObject.durationMS: Number Total duration in milliseconds retObject.targetBitrateBps: Number Requires an average bitrate in bps (bits per second) retObject.bIsValidDuration:Boolean Whether or not durationMS is valid (FALSE if no duration exists. For example, live.) retObject.bIsSeekable: Boolean Whether seekClip is available (TRUE) or not retObject.bIsScannable: Boolean Whether setPlaySpeed is available (TRUE) or not Remarks This function is only valid when it is not a stop state. Example //required class import
103
import lge.apis.ReturnCode ; import lge.apis.Media; import lge.apis.MediaChannel; //object and variable declaration var media:Media = new Media; var ch:Number = MediaChannel.A; //function call var retObj:Object = media.getSourceInfo(ch);
104
getPlayClipFileBasePath
Description This function gets the absolute path of current running file. Syntax public function getPlayClipFileBasePath():Object; Parameters None Return Value retObject.retCode:Number OK if absolute path is successfully obtained; otherwise ERROR. retObject.basePath:String bsolute path of current running file. Remarks None Example //required class import import lge.apis.ReturnCode ; import lge.apis.Media; //object and variable declaration var media:Media = new Media; //function call var retObj:Object = media.getPlayClipFileBasePath();
105
2.4.3
Events
PLAYBACK_START
This event is delivered when Media play starts. <Example> import lge.apps.LGEvent; import lge.apps.LGExtendedEventManager; var kEvent:LGExtendedEventManager = LGExtendedEventManager.getInstance(); kEvent.addEventReceiver(this); function onExtendedEventReceived($evt:LGEvent):Void{ if($evt.id==LGEvent.PLAYBACK_START) { /* do something */ } }
PLAYBACK_END
This event is delivered when Media play ends. <Example> import lge.apps.LGEvent;import lge.apps.LGExtendedEventManager; var _evtMngr:LGExtendedEventManager = LGExtendedEventManager.getInstance(); _evtMngr.addEventReceiver(this); function onExtendedEventReceived($evt:LGEvent):Void{ if($evt.id==LGEvent.PLAYBACK_END) { /* do something */ } }
106
ERR_PLAYING
This event is delivered when an error occurs while Media is on play. <Example> import lge.apps.LGEvent; import lge.apps.LGExtendedEventManager; var _evtMngr:LGExtendedEventManager = LGExtendedEventManager.getInstance(); _evtMngr.addEventReceiver(this); function onExtendedEventReceived($evt:LGEvent):Void{ if($evt.id==LGEvent.ERR_PLAYING) { /* do something */ } }
ERR_BUFFERFULL
This event is delivered when a buffer is full while Media is on play. <Example> import lge.apps.LGEvent; import lge.apps.LGExtendedEventManager; var _evtMngr:LGExtendedEventManager = LGExtendedEventManager.getInstance(); _evtMngr.addEventReceiver(this); function onExtendedEventReceived($evt:LGEvent):Void{ if($evt.id==LGEvent.ERR_BUFFERFULL) { /* do something */ } }
107
ERR_BUFFERLOW
This event is delivered when an input to the buffer is low while Media is on play. <Example> import lge.apps.LGEvent; import lge.apps.LGExtendedEventManager; var _evtMngr:LGExtendedEventManager = LGExtendedEventManager.getInstance(); _evtMngr.addEventReceiver(this); function onExtendedEventReceived($evt:LGEvent):Void{ if($evt.id==LGEvent.ERR_BUFFERLOW) { /* do something */ } }
SLOW_NETWORK
This event is delivered when Media play is processed with the speed of 500k bps over 1 minute. <Example> import lge.apps.LGEvent; import lge.apps.LGExtendedEventManager; var _evtMngr:LGExtendedEventManager = LGExtendedEventManager.getInstance(); _evtMngr.addEventReceiver(this); function onExtendedEventReceived($evt:LGEvent):Void{ if($evt.id==LGEvent.SLOW_NETWORK) { /* do something */ } }
108
2.5
2.5.1
IO (Input/Output)
Description
Definition
IO provides functions required to use the network, except the functions provided by the Linux system or standard C library. This module receives the network connection status.
2.5.2
Function
Following is the functions of IO component.
109
getNetworkStatus
Description This function gets the network status. This function tests the connection status of the link (only if ipAddress is not "" (NULL)) and the network and returns the status. Syntax public function getNetworkStatus(ipAddress:String): Object;
Parameters ipAddress
Return Value retObject.retCode:Number OK if the network status is successfully obtained; otherwise ERROR. retObject.activatedNetwork:Number Currently enabled network type (lge.apis.NetworkType) retObject.status:Number The network status (lge.apis.NetworkStatus) Remarks None Example import lge.apis.ReturnCode ; import lge.apis.IO; //object and variable declaration var io:IO = new IO; //function call var retObj:Object = io.getNetworkStatus(ipAddress);
110
getNetworkSettings
Description This function gets the network settings. Syntax public function getNetworkSettings(networkType:Number): Object;
Parameters networkType
Return Value retObject.retCode:Number If the network setting is successfully obtained; otherwise ERROR. retObject.ipAddress: String An IP address in the "A.B.C.D" format retObject.subnetMask: String The subnet mask in the "A.B.C.D" format retObject.gateway: String The gateway in the "A.B.C.D" format retObject.DNSServer1: String DNS server 1 in the "A.B.C.D" format retObject.DNSServer2: String DNS server 2 in the "A.B.C.D" format retObject.macAddress: String The MAC address in the "A:B:C:D:E:F" format retObject.DHCPServer: String The DHCP server address in the "A.B.C.D" format retObject.bDHCP: Boolean Whether the DHCP is enabled (1) or not (0) retObject.macAddressOfAP: String The MAC address of the wireless AP in the "A:B:C:D:E:F" format Remarks None Example import lge.apis.ReturnCode ; import lge.apis.IO; import lge.apis.NetworkType; //object and variable declaration var io:IO = new IO; var networkType:Number = NetworkType.WIRELESS_WIFI; //function call
111
112
Event Handling for Flash Application with Magic Motion Remote Control
This chapter describes the events and functions for Flash application when users use Magic Motion Remote Control. 3.1 3.2 Events for Magic Motion Remote Control Functions for Magic Motion Remote Control
3 Event Handling for Flash Application with Magic Motion Remote Control
3.1
114
3 Event Handling for Flash Application with Magic Motion Remote Control
<Removing listener> // Removes the registered object, which was related to LGAPPEvent. _global.ExtendedEvents.LGAPPEvent.removeListener(this);
115
3 Event Handling for Flash Application with Magic Motion Remote Control
3.2
116
3 Event Handling for Flash Application with Magic Motion Remote Control
setMotionRemoteMode
Description This function hides the cursor. Syntax function setMotionRemoteMode(mode:Number):Number
Import lge.apis.Application; Var app:Application = new Application(); // hide cursor app. setMotionRemoteMode(9); //disable hide cursor event app. setMotionRemoteMode(10);
117
3 Event Handling for Flash Application with Magic Motion Remote Control
getRemoconTypeInfo
Description This function gets the remote control type information. Syntax public function getRemoconTypeInfo():Object;
Parameters None Return Value retObject.retCode:Number - On success, ReturnCode.OK, otherwise errors. retObject.remoconType:Number - 0: Magic Motion Remote Control - 1: Common Remote Control Remarks None Example Import lge.apis.Application; var kApp:Application = new Application(); var kObj:Object = kApp.getRemoconTypeInfo(); if(kObj.remoconType) trace(this is Basic RCU); else trace(this is pointing RCU);
118
3 Event Handling for Flash Application with Magic Motion Remote Control
createPopup
Description This function creates popup. Syntax function createPopup(popupOption:Object):Object
Parameters popupOption.type = 7 (It does not care other parameters attributes.) Return Value None Remarks None Example Import lge.apis.Control; var kCon:Control = new Control(); var kObj:Object = new Object(); kObj.type = 7; kCon.createPopup(kObj);
119