To use Samsung Product API, <script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script> Should be loaded in index.html
To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
This module defines the Preview functionalities provided by the Tizen Samsung Product API.
Since : 2.3
Product : TV, AV, B2B
Privilege Level : Public
Defines a WebApi object instance of the Tizen Samsung Product API. The webapis.preview object enables access to Preview API functionality.
[NoInterfaceObject] interface PreviewManagerObject { readonly attribute PreviewManager preview; };
WebApi implements PreviewManagerObject;
Provides methods for Preview functionalities.
[NoInterfaceObject] interface PreviewManager { void setPreviewData(DOMString previewData_JSON, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback); DOMString getVersion(); bool setActionDataEventListener(DeeplinkCallback deeplinkCallback); void unActionDataEventListener(); };
Sets the preview data. Each application can have 1 preview. The preview consists of at least 1 section, which contains at least 1 tile.
Prerequisites
void setPreviewData(DOMString previewData_JSON, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Parameters :
Exceptions :
Code Example :
var previewData = { "sections": [{ "title": "Popular Now", "tiles": [{ "title": "Parks and Recreation", "subtitle": "Pawnee Pony", "display_from": 1422766800, "display_until": 1441937400, "image_url": "http://yourserver.com/image.jpg", "action_url": "myapp://playVideo?videoId=185595-0324", "is_playable": true }] }] } function successCallback() { console.log("success"); } function errorCallback(error) { console.log(error.message); } try { webapis.preview.setPreviewData(JSON.stringify(previewData), successCallback, errorCallback); } catch(ex) { console.log(ex.message); }
Retrieves the Preview API version.
DOMString getVersion();
Return Value :
try { var result = webapis.preview.getVersion(); console.log(result); } catch(ex) { console.log(ex.message); }
Register callback function which is called when the preview tiles are clicked.
bool setActionDataEventListener(DeeplinkCallback deeplinkCallback);
Deprecated : 4.0
This method doesnot have sample code because of @deprecated 4.0.
Unregister callback function which is called when the preview tiles are clicked.
void unActionDataEventListener();
module Preview { [NoInterfaceObject] interface PreviewManagerObject { readonly attribute PreviewManager preview; }; WebApi implements PreviewManagerObject; [NoInterfaceObject] interface PreviewManager { void setPreviewData(DOMString previewData_JSON, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback); DOMString getVersion(); bool setActionDataEventListener(DeeplinkCallback deeplinkCallback); void unActionDataEventListener(); }; };