© 2013 Samsung Electronics Co., Ltd. All rights reserved.
This API provides stereoscopy (also called 3D) effects on the TV associated device.
A webapis.displaycontrol object provides access to the functionality of the displaycontrol API.
For more information on the Display Control features, see Display Control Guide.
Interface | Method |
---|---|
WebAPIsDisplayControlManager | |
DisplayControlManager | unsigned short get3DEffectMode() unsigned short check3DModeEnable() void get3DModeSupportList(Mode3DEffectListSupportCallback successCallback, ErrorCallback? errorCallback) |
Mode3DEffectListSupportCallback | void onsuccess(UnsignedShortArray mode3DEffectArray) |
The DisplayControl module handles the TV display functions. For example, it can check whether your device supports 3D.
[NoInterfaceObject] interface WebAPIsDisplayControlManager{ readonly attribute DisplayControlManager displaycontrol; };
WebAPIs implements WebAPIsDisplayControlManager;
A webapis.displaycontrol object provides access to th functionality of the DisplayControl module.
The DisplayControl interface that provides access to the TV API.
[NoInterfaceObject] interface DisplayControlManager { const unsigned short MODE_3D_EFFECT_OFF = 0; const unsigned short MODE_3D_EFFECT_TOP_BOTTOM = 1; const unsigned short MODE_3D_EFFECT_SIDE_BY_SIDE = 2; const unsigned short MODE_3D_EFFECT_LINE_BY_LINE= 3; const unsigned short MODE_3D_EFFECT_VERTICAL_STRIPE = 4; const unsigned short MODE_3D_EFFECT_FRAME_SEQUENCE = 5; const unsigned short MODE_3D_EFFECT_CHECKER_BD = 6; const unsigned short MODE_3D_EFFECT_FROM_2D_TO_3D = 7; const unsigned short MODE_3D_DEVICE_NOT_CONNECTED = -1; const unsigned short MODE_3D_NOT_SUPPORTED = 0; const unsigned short MODE_3D_ENABLE_OK = 1; unsigned short get3DEffectMode(); unsigned short check3DModeEnable(); void get3DModeSupportList(Mode3DEffectListSupportCallback successCallback, ErrorCallback? errorCallback); };
This manager interface exposes the TV control API for controlling basic functions of a TV.
unsigned short MODE_3D_EFFECT_OFF
Identifier for 3DEffect mode off
unsigned short MODE_3D_EFFECT_TOP_BOTTOM
Identifier for 3DEffect mode top_bottom
unsigned short MODE_3D_EFFECT_SIDE_BY_SIDE
Identifier for 3DEffect mode side_by_side
unsigned short MODE_3D_EFFECT_LINE_BY_LINE
Identifier for 3DEffect mode line_by_line
unsigned short MODE_3D_EFFECT_VERTICAL_STRIPE
Identifier for 3DEffect mode vertical_stripe
unsigned short MODE_3D_EFFECT_FRAME_SEQUENCE
Identifier for 3DEffect mode frame_sequence
unsigned short MODE_3D_EFFECT_CHECKER_BD
Identifier for 3DEffect mode checker BD
unsigned short MODE_3D_EFFECT_FROM_2D_TO_3D
Identifier for 3DEffect mode convert 2D to 3D
unsigned short MODE_3D_DEVICE_NOT_CONNECTED
Supports 3D mode, but 3D display is not connected.
unsigned short MODE_3D_NOT_SUPPORTED
No support for 3D mode.
unsigned short MODE_3D_ENABLE_OK
Identifier for enabling 3D mode
get3DEffectMode
Gets the current 3D effect mode.
unsigned short get3DEffectMode();
with error type UnknownError in any other error case.
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
try { var effect = webapis.displaycontrol.get3DEffectMode(); switch (effect) { case webapis.displaycontrol.MODE_3D_EFFECT_OFF : console.log("3D effect is off"); break; case webapis.displaycontrol.MODE_3D_EFFECT_TOP_BOTTOM : console.log("3D effect is top and bottom"); break; } } catch (error) { console.log(error.name); }
check3DModeEnable
Checks whether the 3D mode is available or not.
unsigned short check3DModeEnable();
with error type UnknownError in any other error case.
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
try { var mode = webapis.displaycontrol.check3DModeEnable(); switch (mode) { case webapis.displaycontrol.MODE_3D_DEVICE_NOT_CONNECTED : console.log("3D display is not connected"); break; case webapis.displaycontrol.MODE_3D_NOT_SUPPORTED : console.log("3D display is not supported"); break; case webapis.displaycontrol.MODE_3D_ENABLE_OK : console.log("3D display is enabled"); break; } catch (error) { console.log(error.name); }
get3DModeSupportList
Gets the supported 3D Effects
void get3DModeSupportList(Mode3DEffectListSupportCallback successCallback, ErrorCallback? errorCallback);
The ErrorCallback is launched with these error types:
If the errorCallback does not contain a valid function (such as null) or in the case of any other error that should be returned in the errorCallback (see above), the implementation MUST silently fail and no further action is required (that is the developer is not notified of the error).
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
with error type TypeMismatchError if any of the input attributes are of the wrong type
function successCB(effects) { for (var i = 0; i effects.length; i++) { switch (effects[i]) { case webapis.displaycontrol.MODE_3D_EFFECT_LINE_BY_LINE : console.log("Line by Line 3D effect is supported"); break; case webapis.displaycontrol.MODE_3D_EFFECT_VERTICAL_STRIPE : console.log("Vertical Stripe 3D effect is supported"); break; } } } function errorCB(error) { console.log(error.name); } try { webapis.displaycontrol.get3DModeSupportList(successCB, errorCB); } catch (error) { console.log(error.name); }
Success callback for retrieving a list of 3D modes.
[Callback=FunctionOnly, NoInterfaceObject] interface Mode3DEffectListSupportCallback { void onsuccess(UnsignedShortArray mode3DEffectArray); };
onsuccess
Method invoked when the list of 3D modes is retrieved successfully.
void onsuccess(UnsignedShortArray mode3DEffectArray);
module DisplayControl { [NoInterfaceObject] interface WebAPIsDisplayControlManager{ readonly attribute DisplayControlManager displaycontrol; }; WebAPIs implements WebAPIsDisplayControlManager; [NoInterfaceObject] interface DisplayControlManager { const unsigned short MODE_3D_EFFECT_OFF = 0; const unsigned short MODE_3D_EFFECT_TOP_BOTTOM = 1; const unsigned short MODE_3D_EFFECT_SIDE_BY_SIDE = 2; const unsigned short MODE_3D_EFFECT_LINE_BY_LINE= 3; const unsigned short MODE_3D_EFFECT_VERTICAL_STRIPE = 4; const unsigned short MODE_3D_EFFECT_FRAME_SEQUENCE = 5; const unsigned short MODE_3D_EFFECT_CHECKER_BD = 6; const unsigned short MODE_3D_EFFECT_FROM_2D_TO_3D = 7; const unsigned short MODE_3D_DEVICE_NOT_CONNECTED = -1; const unsigned short MODE_3D_NOT_SUPPORTED = 0; const unsigned short MODE_3D_ENABLE_OK = 1; unsigned short get3DEffectMode(); unsigned short check3DModeEnable(); void get3DModeSupportList(Mode3DEffectListSupportCallback successCallback, ErrorCallback? errorCallback); }; [Callback=FunctionOnly, NoInterfaceObject] interface Mode3DEffectListSupportCallback { void onsuccess(UnsignedShortArray mode3DEffectArray); }; };