To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
Since : 2.4
Product : SSSP
Interface | Method |
---|---|
TvInfoManagerObject | |
TvInfoManager | DOMString getVersion () unsigned short getMenuValue (unsigned short key) unsigned long addCaptionChangeListener (TvInfoCaptionChangeCallback listener, unsigned short key) void removeCaptionChangeListener (unsigned long listenerId) boolean isTvsPicSizeResized(); void showCaption(boolean show); void registerInAppCaptionControl(boolean status); |
TvInfoCaptionChangeCallback | void onchange (TvInfoMenuKey key) |
TvInfoChangeCallback | void onchange (TvInfoKey key) |
TvInfoMenuKey | |
TvInfoMenuValue | |
TvInfoKey | |
TvInfoValue |
[NoInterfaceObject]interface TvInfoManagerObject {
readonly attribute TvInfoManager tvinfo;
};
WebApi implements TvInfoManagerObject;
[NoInterfaceObject]interface TvInfoManager {
attribute TvInfoMenuKey TvInfoMenuKey;
attribute TvInfoMenuValue TvInfoMenuValue;
attribute TvInfoKey TvInfoKey;
attribute TvInfoValue TvInfoValue;
DOMString getVersion();
TvInfoMenuValue getMenuValue(TvInfoMenuKey key);
unsigned long addCaptionChangeListener(TvInfoMenuKey key, TvInfoCaptionChangeCallback listener);
void removeCaptionChangeListener(unsigned long listenerId);
boolean isTvsPicSizeResized();
void showCaption(boolean show);
void registerInAppCaptionControl(boolean status);
};
getVersion
DOMString getVersion();
Since : 2.4
Product : SSSP
Return value:
Plugin versionCode example:
try {
var value = webapis.tvinfo.getVersion();
console.log("version value = " + value);
} catch (error) {
console.log("error code = " + error.code);
}
getMenuValue
TvInfoMenuValue getMenuValue(TvInfoMenuKey key);
Since : 2.4
Product : SSSP
Parameters:
Return value:
valueExceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type InvalidValuesError, if any of the input parameters contain an invalid value. (Since plugin version 3.0)
Code example:
try {
var value = webapis.tvinfo.getMenuValue(webapis.tvinfo.TvInfoMenuKey.CAPTION_ONOFF_KEY);
console.log("menu value = " + value);
} catch (error) {
console.log("error code = " + error.code);
}
addCaptionChangeListener
unsigned long addCaptionChangeListener(TvInfoMenuKey key, TvInfoCaptionChangeCallback listener);
Since : 2.4
Product : SSSP
Parameters:
Return value:
Listener IDExceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type InvalidValuesError, if any input parameter contains an invalid value. (Since plugin version 3.0)
Code example:
var listener = function(key) {
console.log("TVInfoCaptionChange");
}
try {
var value = webapis.tvinfo.addCaptionChangeListener(webapis.tvinfo.TvInfoMenuKey.CAPTION_ONOFF_KEY, listener);
console.log("listener id = " + value);
} catch (error) {
console.log("error code = " + error.code);
}
removeCaptionChangeListener
void removeCaptionChangeListener(unsigned long listenerId);
Since : 2.4
Product : SSSP
Parameters:
Exceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
with error type InvalidValuesError, if any input parameter contains an invalid value. (Since plugin version 3.0)
Code example:
try {
webapis.tvinfo.removeCaptionChangeListener(listenerId); // Listener ID defined by addCaptionChangeListener
console.log("listener id = " + value);
} catch (error) {
console.log("error code = " + error.code);
}
isTvsPicSizeResized
boolean isTvsPicSizeResized();
Since : 2.4
Product : SSSP
Return value:
Boolean value:Exceptions:
with error type NotSupportedError, if the device is a BD device.
Code example:
try {
var flag = webapis.tvinfo.isTvsPicSizeResized();
console.log("flag = " + flag);
} catch (error) {
console.log("error code = " + error.code);
}
showCaption
void showCaption(boolean show);
Since : 2.4
Product : SSSP
Parameters:
Exceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
Code example:
try {
webapis.tvinfo.showCaption(true);
} catch (error) {
console.log("error code = " + error.code);
}
registerInAppCaptionControl
void registerInAppCaptionControl(boolean status);
Since : 2.4
Product : SSSP
Parameters:
Exceptions:
with error type TypeMismatchError, if an input parameter is not compatible with its expected type.
Code example:
try {
webapis.tvinfo.registerInAppCaptionControl(true);
} catch (error) {
console.log("error code = " + error.code);
}
[Callback = FunctionOnly, NoInterfaceObject]interface TvInfoCaptionChangeCallback {
void onchange(TvInfoMenuKey key);
};
onchange
void onchange(TvInfoMenuKey key);
Since : 2.4
Product : SSSP
Parameters:
Code example:
var onchange = function (key){
console.log(" changed caption setting is = " + key);
};
[Callback = FunctionOnly, NoInterfaceObject]interface TvInfoChangeCallback {
void onchange(TvInfoKey key);
};
onchange
void onchange(TvInfoKey key);
Since : 2.4
Product : SSSP
Parameters:
Code example:
var onchange = function (key){
console.log(" changed setting is = " + key);
};
[NoInterfaceObject]interface TvInfoMenuKey {
const unsigned long CAPTION_ONOFF_KEY = 0;
const unsigned long CAPTION_MODE_KEY = 1;
const unsigned long CAPTION_FONT_SIZE_KEY = 2;
const unsigned long CAPTION_FONT_STYLE_KEY = 3;
const unsigned long CAPTION_FG_COLOR_KEY = 4;
const unsigned long CAPTION_FG_OPACITY_KEY = 5;
const unsigned long CAPTION_BG_COLOR_KEY = 6;
const unsigned long CAPTION_BG_OPACITY_KEY = 7;
const unsigned long CAPTION_EDGE_TYPE_KEY = 8;
const unsigned long CAPTION_EDGE_COLOR_KEY = 9;
const unsigned long CAPTION_WINDOW_COLOR_KEY = 10;
const unsigned long CAPTION_WINDOW_OPACITY_KEY = 11;
const unsigned long ACCESSIBILITY_FOCUS_ZOOM = 12;
const unsigned long ACCESSIBILITY_HIGH_CONTRAST = 13;
const unsigned long SMARTHUB_CHANNEL_BOUND_APPS_TICKER = 14;
const unsigned long VOICE_GUIDE_KEY = 15;
const unsigned long SUBTITLE_ONOFF_KEY = 16;
const unsigned long SUBTITLE_MODE_KEY = 17;
};
[NoInterfaceObject]interface TvInfoMenuValue {
const unsigned long OFF = 0;
const unsigned long ON = 1;
const unsigned long CAPTION_OFF = 0;
const unsigned long CAPTION_ON = 1;
const unsigned long CAPTION_MODE_DEFAULT = 0;
const unsigned long CAPTION_MODE_SERVICE1 = 1;
const unsigned long CAPTION_MODE_SERVICE2 = 2;
const unsigned long CAPTION_MODE_SERVICE3 = 3;
const unsigned long CAPTION_MODE_SERVICE4 = 4;
const unsigned long CAPTION_MODE_SERVICE5 = 5;
const unsigned long CAPTION_MODE_SERVICE6 = 6;
const unsigned long CAPTION_MODE_CC1 = 7;
const unsigned long CAPTION_MODE_CC2 = 8;
const unsigned long CAPTION_MODE_CC3 = 9;
const unsigned long CAPTION_MODE_CC4 = 10;
const unsigned long CAPTION_MODE_TEXT1 = 11;
const unsigned long CAPTION_MODE_TEXT2 = 12;
const unsigned long CAPTION_MODE_TEXT3 = 13;
const unsigned long CAPTION_MODE_TEXT4 = 14;
const unsigned long CAPTION_SIZE_DEFAULT = 0;
const unsigned long CAPTION_SIZE_SMALL = 1;
const unsigned long CAPTION_SIZE_STANDARD = 2;
const unsigned long CAPTION_SIZE_LARGE = 3;
const unsigned long CAPTION_SIZE_EXTRA_LARGE = 4;
const unsigned long CAPTION_FONT_DEFAULT = 0;
const unsigned long CAPTION_FONT_STYLE0 = 1;
const unsigned long CAPTION_FONT_STYLE1 = 2;
const unsigned long CAPTION_FONT_STYLE2 = 3;
const unsigned long CAPTION_FONT_STYLE3 = 4;
const unsigned long CAPTION_FONT_STYLE4 = 5;
const unsigned long CAPTION_FONT_STYLE5 = 6;
const unsigned long CAPTION_FONT_STYLE6 = 7;
const unsigned long CAPTION_COLOR_DEFAULT = 0;
const unsigned long CAPTION_COLOR_WHITE = 1;
const unsigned long CAPTION_COLOR_BLACK = 2;
const unsigned long CAPTION_COLOR_RED = 3;
const unsigned long CAPTION_COLOR_GREEN = 4;
const unsigned long CAPTION_COLOR_BLUE = 5;
const unsigned long CAPTION_COLOR_YELLOW = 6;
const unsigned long CAPTION_COLOR_MAGENTA = 7;
const unsigned long CAPTION_COLOR_CYAN = 8;
const unsigned long CAPTION_OPACITY_SOLID = 0;
const unsigned long CAPTION_OPACITY_FLASH = 1;
const unsigned long CAPTION_OPACITY_TRANSLUCENT = 2;
const unsigned long CAPTION_OPACITY_TRANSPARENT = 3;
const unsigned long CAPTION_OPACITY_DEFAULT = 4;
const unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5;
const unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6;
const unsigned long CAPTION_EDGE_NONE = 0;
const unsigned long CAPTION_EDGE_RAISED = 1;
const unsigned long CAPTION_EDGE_DEPRESSED = 2;
const unsigned long CAPTION_EDGE_UNIFORM = 3;
const unsigned long CAPTION_EDGE_DROP_SHADOWED = 4;
const unsigned long SUBTITLE_NORMAL = 0;
const unsigned long SUBTITLE_HEARING_IMMPEARED = 1;
};
[NoInterfaceObject]interface TvInfoKey {
const unsigned long TV_VIEWER_BG_EXECUTABLE = 0;
};
[NoInterfaceObject]interface TvInfoKey {
const unsigned long TV_VIEWER_BG_EXECUTABLE = 0;
};
module TvInfo {
[NoInterfaceObject]interface TvInfoManagerObject {
readonly attribute TvInfoManager tvinfo;
};
WebApi implements TvInfoManagerObject;
[NoInterfaceObject]interface TvInfoManager {
attribute TvInfoMenuKey TvInfoMenuKey;
attribute TvInfoMenuValue TvInfoMenuValue;
attribute TvInfoKey TvInfoKey;
attribute TvInfoValue TvInfoValue;
DOMString getVersion();
TvInfoMenuValue getMenuValue(TvInfoMenuKey key);
unsigned long addCaptionChangeListener(TvInfoMenuKey key, TvInfoCaptionChangeCallback listener);
void removeCaptionChangeListener(unsigned long listenerId);
boolean isTvsPicSizeResized();
void showCaption(boolean show);
void registerInAppCaptionControl(boolean status);
};
[Callback = FunctionOnly, NoInterfaceObject]interface TvInfoCaptionChangeCallback {
void onchange(TvInfoMenuKey key);
};
[Callback = FunctionOnly, NoInterfaceObject]interface TvInfoChangeCallback {
void onchange(TvInfoKey key);
};
[NoInterfaceObject]interface TvInfoMenuKey {
const unsigned long CAPTION_ONOFF_KEY = 0;
const unsigned long CAPTION_MODE_KEY = 1;
const unsigned long CAPTION_FONT_SIZE_KEY = 2;
const unsigned long CAPTION_FONT_STYLE_KEY = 3;
const unsigned long CAPTION_FG_COLOR_KEY = 4;
const unsigned long CAPTION_FG_OPACITY_KEY = 5;
const unsigned long CAPTION_BG_COLOR_KEY = 6;
const unsigned long CAPTION_BG_OPACITY_KEY = 7;
const unsigned long CAPTION_EDGE_TYPE_KEY = 8;
const unsigned long CAPTION_EDGE_COLOR_KEY = 9;
const unsigned long CAPTION_WINDOW_COLOR_KEY = 10;
const unsigned long CAPTION_WINDOW_OPACITY_KEY = 11;
const unsigned long ACCESSIBILITY_FOCUS_ZOOM = 12;
const unsigned long ACCESSIBILITY_HIGH_CONTRAST = 13;
const unsigned long SMARTHUB_CHANNEL_BOUND_APPS_TICKER = 14;
const unsigned long VOICE_GUIDE_KEY = 15;
const unsigned long SUBTITLE_ONOFF_KEY = 16;
const unsigned long SUBTITLE_MODE_KEY = 17;
};
[NoInterfaceObject]interface TvInfoMenuValue {
const unsigned long OFF = 0;
const unsigned long ON = 1;
const unsigned long CAPTION_OFF = 0;
const unsigned long CAPTION_ON = 1;
const unsigned long CAPTION_MODE_DEFAULT = 0;
const unsigned long CAPTION_MODE_SERVICE1 = 1;
const unsigned long CAPTION_MODE_SERVICE2 = 2;
const unsigned long CAPTION_MODE_SERVICE3 = 3;
const unsigned long CAPTION_MODE_SERVICE4 = 4;
const unsigned long CAPTION_MODE_SERVICE5 = 5;
const unsigned long CAPTION_MODE_SERVICE6 = 6;
const unsigned long CAPTION_MODE_CC1 = 7;
const unsigned long CAPTION_MODE_CC2 = 8;
const unsigned long CAPTION_MODE_CC3 = 9;
const unsigned long CAPTION_MODE_CC4 = 10;
const unsigned long CAPTION_MODE_TEXT1 = 11;
const unsigned long CAPTION_MODE_TEXT2 = 12;
const unsigned long CAPTION_MODE_TEXT3 = 13;
const unsigned long CAPTION_MODE_TEXT4 = 14;
const unsigned long CAPTION_SIZE_DEFAULT = 0;
const unsigned long CAPTION_SIZE_SMALL = 1;
const unsigned long CAPTION_SIZE_STANDARD = 2;
const unsigned long CAPTION_SIZE_LARGE = 3;
const unsigned long CAPTION_SIZE_EXTRA_LARGE = 4;
const unsigned long CAPTION_FONT_DEFAULT = 0;
const unsigned long CAPTION_FONT_STYLE0 = 1;
const unsigned long CAPTION_FONT_STYLE1 = 2;
const unsigned long CAPTION_FONT_STYLE2 = 3;
const unsigned long CAPTION_FONT_STYLE3 = 4;
const unsigned long CAPTION_FONT_STYLE4 = 5;
const unsigned long CAPTION_FONT_STYLE5 = 6;
const unsigned long CAPTION_FONT_STYLE6 = 7;
const unsigned long CAPTION_COLOR_DEFAULT = 0;
const unsigned long CAPTION_COLOR_WHITE = 1;
const unsigned long CAPTION_COLOR_BLACK = 2;
const unsigned long CAPTION_COLOR_RED = 3;
const unsigned long CAPTION_COLOR_GREEN = 4;
const unsigned long CAPTION_COLOR_BLUE = 5;
const unsigned long CAPTION_COLOR_YELLOW = 6;
const unsigned long CAPTION_COLOR_MAGENTA = 7;
const unsigned long CAPTION_COLOR_CYAN = 8;
const unsigned long CAPTION_OPACITY_SOLID = 0;
const unsigned long CAPTION_OPACITY_FLASH = 1;
const unsigned long CAPTION_OPACITY_TRANSLUCENT = 2;
const unsigned long CAPTION_OPACITY_TRANSPARENT = 3;
const unsigned long CAPTION_OPACITY_DEFAULT = 4;
const unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5;
const unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6;
const unsigned long CAPTION_EDGE_NONE = 0;
const unsigned long CAPTION_EDGE_RAISED = 1;
const unsigned long CAPTION_EDGE_DEPRESSED = 2;
const unsigned long CAPTION_EDGE_UNIFORM = 3;
const unsigned long CAPTION_EDGE_DROP_SHADOWED = 4;
const unsigned long SUBTITLE_NORMAL = 0;
const unsigned long SUBTITLE_HEARING_IMMPEARED = 1;
};
[NoInterfaceObject]interface TvInfoKey {
const unsigned long TV_VIEWER_BG_EXECUTABLE = 0;
};
[NoInterfaceObject]interface TvInfoValue {
const unsigned long TV_VIEWER_BG_NOT_EXECUTABLE = 0;
const unsigned long TV_VIEWER_BG_EXECUTABLE = 1;
};
};