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
Since: 6.5
Product: B2B (LFD)
onerror
void onerror(Error data);
Parameters:
Code example:
var onsuccess = function(val) { console.log("[removePlaylist] success : " + val.result); } var onerror = function(error) { console.log("[removePlaylist] code :" + error.code + " error name: " + error.name + " message " + error.message); } try { webapis.syncplay.removePlaylist(onsuccess, onerror); } catch (e) { console.log("[removePlaylist] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
Syncplay::SyncplayListener
onlistener
void onlistener(DOMString data);
var onlistener = function(data) { console.log("[stop]data:" + data + "changed"); } try { webapis.syncplay.stop(onlistener); } catch (e) { console.log("[stop] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
Syncplay::SyncplayManager
getVersion
DOMString getVersion();
Exceptions:
with error type SecurityError if the application does not have the privilege to call this method.
with error type UnknownError in any other error case.
var Version = null; try { Version = webapis.syncplay.getVersion(); } catch (e) { console.log("[getVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); } if (null !== Version) { console.log("[getVersion] call syncFunction type: " + Version); }
createPlaylist
void createPlaylist(SyncPlayContent [] contentsArr, SyncplaySuccessCallback onsuccess, optional SyncplayErrorCallback? onerror);
with the error type TypeMismatchError if invalid values are passed for an input parameter.
var sharedDir = tizen.application.getAppSharedURI(PackageId); var path = sharedDir + "../res/wgt/syncplay/"; var playlist = ["image6.jpg","image2.jpg","red.mp4","image5.jpg","blue.mp4","yellow.mp4","red.mp4"]; var onsuccess = function(val) { console.log("[createPlaylist] success : " + val); } var onerror = function(error) { console.log("[createPlaylist] code :" + error.code + " error name: " + error.name + " message " + error.message); } var contentsArr = []; for (var i = 0; i < 7;="" i++)="" {="" contentsarr[i]="{" path="" :="" path="" +="" playlist[i],="" duration="" :="" 10="" }="" }="" try="" {="" webapis.syncplay.createplaylist(contentsarr,="" onsuccess,="" onerror);="" }="" catch="" (e)="" {="" console.log("[createplaylist]="" call="" syncfunction="" exception="" ["="" +="" e.code="" +="" "]="" name:="" "="" +="" e.name="" +="" "="" message:="" "="" +="" e.message);="" }="">
start
void start(SyncInfo syncinfo, SyncplayListener onlistener);
with the error type SecurityError if the application does not have the privilege to call this method.
var start = null; var syncinfo = { "rectX" : 0, "rectY" : 0, "rectWidth" : 960, "rectHeight": 540, "groupID" : 55, "rotate" : "OFF" } var onlistener = function(data) { console.log("[start]data:" + data + "changed"); } try { webapis.syncplay.start(syncinfo,onlistener); } catch (e) { console.log("[start] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message); }
stop
void stop(SyncplayListener onlistener);
removePlaylist
void removePlaylist(SyncplaySuccessCallback onsuccess, optional SyncplayErrorCallback? onerror);
with the error type TypeMismatchError if an invalid ErrorCallback type is passed for the 'onerror' parameter.