TV.WINDOW
This class supports window control of TV in use.
Add the following line for tv.window class into a html file your own : <script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script> |
You can declare tv.window class like this : ex) var tvWindow = webapis.tv.window; |
Methods
getAvailableWindow | ||
Description | ||
Gets the number of available sub-window. | ||
Parameters | ■successCallback - Function - To be invoked if the operation is successfully ■errorCallback (Optional) - Function - Function called when an error occurs | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
try { webapis.tv.window.getAvailableWindow(successCB, errorCB); catch (error) { console.log(error.name); } |
getSource | ||
Description | ||
This function returns the current Source Information. | ||
Parameters | ■windowID (Optional) - Window ID - window identifier. Deault is main window | |
Return | ■SourceInfo - specifies the options for source information | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var source = webapis.tv.window.getSource(windows[i]); |
hide | ||
Description | ||
This function upon execution hides the PIP window. It returns true on success and false on failure | ||
Parameters | ■windowID - subwindow id | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
function successCB(windows) { for (var i = 0; i windows.length; i++) { if (i == 0) { if (webapis.tv.window.hide(windows[i])) { console.log("window #0 is hidden"); } } } } |
setRect | ||
Description | ||
This function is used to set the display area of the tvScreen. It takes rectangle dimensions as parameter and subWindowID as optional parameter. | ||
Parameters | ■Rect - Window display area ■SubWindowID (Optional) - Subwindow id | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var retValue = deviceapis.tv.window.setRect(srect); |
setSource | ||
Description | ||
This function is used to change the TV Source (TV or DVI or PC..). | ||
Parameters | ■windowID - window ID - 0: Main window ■source (Optional) - Source information | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
. |
show | ||
Description | ||
This function upon execution shows the PIP window. | ||
Parameters | ■windowID - subwindow id | |
Return | ■Boolean - true : success - false : failure | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
function successCB(windows) { for (var i = 0; i windows.length; i++) { if (i == 0) { if (webapis.tv.window.show(windows[i])) { console.log("window #0 is shown"); } } } } |