This API provides a way to embed a video source in a Tizen Web Application running on a device associated with the TV. It allows an available video source to be selected and shown on or hidden from the display in a Tizen Web Application. There will be a tizen.tvwindow object that allows access to the functionality of the TV Window API. To show a TV signal, execute the show function. A TV source is controlled by the user or by you with the Tizen Web Device APIs. You do not have to implement any routines if you do not want to interact with the TV image.
The rectangle array requires exactly four elements which are described below:
The first element indicates the x coordinate of the top left corner of the TV window (distance from the left edge of the screen).
The second element indicates the y coordinate of the top left corner of the TV window (distance from the top edge of the screen).
The third element indicates the width of the TV window.
The fourth element indicates the height of the TV window.
Each element of rectangle can be described in either absolute value by using pixel units "px" or relative value by using percentage units "%". If you do not specify any unit after a value then it will be taken as an absolute value.
The errorCallback is invoked with these error types:
InvalidValuesError will be thrown if rectangle has any element with invalid format (e.g. "10p") or it does not have 4 elements.
NotSupportedError will be thrown if you set rectangle which is not within the boundary of the display area or when the TV window is not supported in the current screen orientation.
TypeMismatchError will be thrown if rectangle is not an array.
Privilege level: public
Privilege: http://tizen.org/privilege/tv.window
Parameters:
successCallback: The method which will be invoked when the position and size of the TV window has been changed successfully
errorCallback [optional][nullable]: The method which will be invoked when an error occurs
rectangle [optional][nullable]: An array that contains information about the position and size of a specified TV window as a string with units Without this parameter, the TV window will have the same size and location as when this method last suceeded. But, if a rectangle has never been specified, the TV window will be shown in full screen mode.
type [optional][nullable]: The window type - by default, this attribute is set to MAIN
zPosition [optional][nullable]: Specifies whether the TV window should be in front of or behind the Web Application since Tizen 2.4 By default, this parameter is set to FRONT. If this parameter is set to null or FRONT, this method behaves in the same way as it did before Tizen 2.4.
Exceptions:
WebAPIException
with error type TypeMismatchError, if any input attribute is not compatible with the expected type for this attribute.
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError if any other error occurs.
Code example:
function successCB(windowRect, type) {
// You will get exactly what you put as rectangle argument of show() through windowRect.
// expected result : ["0", "0px", "50%", "540px"]
console.log("Rectangle : [" + windowRect[0] + ", " + windowRect[1] + ", " + windowRect[2] + ", " + windowRect[3] + "]");
}
try {
tizen.tvwindow.show(successCB, null, ["0", "0px", "50%", "540px"], "MAIN");
} catch(error) {
console.log("error: " + error.name);
}
According to the specified unit, information about the area will be passed to an array that contains 4 strings through WindowRectangleSuccessCallback as follows :
If you set "px" as unit, ["0px", "0px", "1920px", "1080px"]
If you set "%" as unit, ["0%", "0%", "100%", "100%"]
If you omit unit, the pixel("px") unit will be used as a default unit.
Privilege level: public
Privilege: http://tizen.org/privilege/tv.window
Parameters:
successCallback: The method to invoke when the position and size of the TV window has been obtained successfully
errorCallback [optional][nullable]: The method to invoke when an error occurs
unit [optional][nullable]: The measurement unit for specifying the display area - by default, this attribute is set to "px"
type [optional][nullable]: The window type - by default, this attribute is set to MAIN
Exceptions:
WebAPIException
with error type TypeMismatchError, if any input attribute is not compatible with the expected type for this attribute.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError if any other error occurs.
Code example:
function rectangleCB(windowRect, type) {
// You call getRect() without specifying a unit, it expresses the area information with pixel unit.
// expected result : ["0px", "0px", "960px", "540px"] if the screen resolution of a device is 1920 x 1080.
console.log("Rectangle : [" + windowRect[0] + ", " + windowRect[1] + ", " + windowRect[2] + ", " + windowRect[3] + "]");
}
function successCB(windowRect, type) {
// You will get exactly what you put as rectangle argument through windowRect.
// expected result : ["0", "0", "50%", "50%"]
console.log("Rectangle : [" + windowRect[0] + ", " + windowRect[1] + ", " + windowRect[2] + ", " + windowRect[3] + "]");
tizen.tvwindow.getRect(rectangleCB);
}
try {
tizen.tvwindow.show(successCB, null, ["0", "0", "50%", "50%"]);
} catch(error) {
console.log("error: " + error.name);
}
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.