GUIDE

GUIDE


B2BSyncplay API

'B2BSyncplay::B2BSyncplayManagerObject' interface

Public Attributes

readonly attribute B2BSyncplayManager b2bsyncplay



Details in English

Namespace forB2BSyncplay API.

Returns

B2BSyncplay API의 네임스페이스.

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Version

1.0

Since

2.4

Product

B2B

SDK Support

Y


'B2BSyncplay::B2BSyncplayManager' interface

Public Methods

DOMString getVersion ( )
This interface provides methods to get Syncplay module's version. More...
void stopSyncPlay ( B2BSyncplayListener listener )
This interface provides methods to stop sync play. More...
void clearSyncPlayList ( B2BSyncplaySuccessCallback onSuccess, optional B2BSyncplayErrorCallback ? onError )
This interface provides methods to reset the play list which was made by makeSyncPlayList api. More...

Public Methods

DOMString getVersion()

   This interface provides methods to get Syncplay module's version.


Details in English

This interface provides methods to get Syncplay module's version

Returns

Version of Syncplay module

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
B2bAPIException
   with error type TypeMismatchError, Invalid ErrorCallback type passed for 'onerror' parameter
var Version = null;
try {
Version = b2bapis.b2bsyncplay.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);
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Version

1.0

Since

2.4

Product

B2B

SDK Support

Y


void makeSyncPlayList( syncPlayContent [] contentsArr, B2BSyncplaySuccessCallback onSuccess, optional B2BSyncplayErrorCallback ? onError)

   The content attribute to makeSyncPlayList contents.


Details in English

make play list with video,image content to syncplay

Returns

N/A

Parameters

contentsArr
   array which contains path and duration to be saved content's information
onSuccess
   Callback method to be invoked when this api success
optional
   onError Callback method to be invoked when an error occurs.

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
B2bAPIException
   with error type TypeMismatchError, Invalid ErrorCallback type passed for 'onerror' parameter
var path = "/opt/usr/apps/"+tizen.application.getAppInfo().packageId+"/res/wgt/images/";
var playlist = ["image6.jpg","image2.jpg","red.mp4","image5.jpg","blue.mp4","yellow.mp4","red.mp4"];
var onSuccess = function(val) {
console.log("[makeSyncPlayList] success : " + val);
}
var onError = function(error) {
console.log("[makeSyncPlayList] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[makeSyncPlayList]");
var syncPlayContents = [];
for(var i =0;i<7;i++)
{
syncPlayContents[i] = {
path : path + playlist[i],
duration : 10
}
}
b2bapis.b2bsyncplay.makeSyncPlayList(syncPlayContents, onSuccess, onError);

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Version

1.0

Since

2.4

Product

B2B

SDK Support

Y


void startSyncPlay(long posX, long posY, long width, long height, long groupID, B2BSyncplayRotateEnable rotate, B2BSyncplayListener listener)

   This interface provides methods to start sync play.


Details in English

This interface provides methods to start sync play

Returns

N/A

Parameters

posX
   long,position rect x
posY
   long,position rect y
width
   long,position rect width
height
   long,position rect height
groupID
   long,groupID
rotate
   enum B2BSyncplayRotateEnable, ON/OFF
listener
   function,listener handler

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
var startSyncPlay = null;
var onChange = function(data)
{
console.log("[startSyncPlay]data:" + data + "changed");
}
try { 
console.log("[startSyncPlay] b2bsync object : "+b2bsync); 
startSyncPlay = b2bapis.b2bsyncplay.startSyncPlay(0,0,960,540,5,"OFF",onChange);
} catch (e) { 
console.log("[startSyncPlay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== startSyncPlay){
console.log("[startSyncPlay] call syncFunction type: " + startSyncPlay);
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Version

1.0

Since

2.4

Product

B2B

SDK Support

Y


void stopSyncPlay( B2BSyncplayListener listener)

   This interface provides methods to stop sync play.


Details in English

This interface provides methods to stop sync play

Returns

N/A

Parameters

listener
   function,listener handler

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
var stopSyncPlay = null;
var onChange = function(data)
{
console.log("[stopSyncPlay]data:" + data + "changed");
}
try { 
console.log("[stopSyncPlay] b2bsync object : "+b2bsync); 
startSyncPlay = b2bapis.b2bsyncplay.stopSyncPlay(onChange);
} catch (e) { 
console.log("[stopSyncPlay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== stopSyncPlay){
console.log("[stopSyncPlay] call syncFunction type: " + stopSyncPlay);
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Version

1.0

Since

2.4

Product

B2B

SDK Support

Y


void clearSyncPlayList( B2BSyncplaySuccessCallback onSuccess, optional B2BSyncplayErrorCallback ? onError)

   This interface provides methods to reset the play list which was made by makeSyncPlayList api.


Details in English

reset the play list which was played via sync play.

Returns

N/A

Parameters

onSuccess
   Callback method to be invoked when this api success
optional
   onError Callback method to be invoked when an error occurs.

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
B2bAPIException
   with error type TypeMismatchError, Invalid ErrorCallback type passed for 'onerror' parameter
var onSuccess = function(val) {
console.log("[clearSyncPlayList] success : " + val.result);
}
var onError = function(error) {
console.log("[clearSyncPlayList] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[clearSyncPlayList]");
b2bapis.b2bsyncplay.clearSyncPlayList(onSuccess, onError); 

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Version

1.0

Since

2.4

Product

B2B

SDK Support

Y


'B2BSyncplay::B2BSyncplayListener' interface

Public Methods

void onlistener(DOMString data)



Details in English

This method is listener of syncplay

Returns

void

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
B2bAPIException
   with error type TypeMismatchError, Invalid ErrorCallback type passed for 'onerror' parameter
var stopSyncPlay = null;
var onChange = function(data)
{
console.log("[stopSyncPlay]data:" + data + "changed");
}
try { 
console.log("[stopSyncPlay] b2bsync object : "+b2bsync); 
startSyncPlay = b2bapis.b2bsyncplay.stopSyncPlay(onChange);
} catch (e) { 
console.log("[stopSyncPlay] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== stopSyncPlay){
console.log("[stopSyncPlay] call syncFunction type: " + stopSyncPlay);
}

Parameters

data
   provide status

Version

1.0

Since

2.4

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Product

B2B

SDK Support

Y


'B2BSyncplay::B2BSyncplaySuccessCallback' interface

Public Methods

void onsuccess(B2BRESULT data)



Details in English

This method is callback parameter.

Returns

void

Parameters

data
   provide status

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
B2bAPIException
   with error type TypeMismatchError, Invalid ErrorCallback type passed for 'onerror' parameter
var onSuccess = function(val) {
console.log("[clearSyncPlayList] success : " + val.result);
}
var onError = function(error) {
console.log("[clearSyncPlayList] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[clearSyncPlayList]");
b2bapis.b2bsyncplay.clearSyncPlayList(onSuccess, onError); 

Version

1.0

Since

2.4

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Product

B2B

SDK Support

Y


'B2BSyncplay::B2BSyncplayErrorCallback' interface

Public Methods

void onerror( B2BERROR data)



Details in English

This method is callback parameter.

Returns

void
N/A

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
B2bAPIException
   with error type TypeMismatchError, Invalid ErrorCallback type passed for 'onerror' parameter
var onSuccess = function(val) {
console.log("[clearSyncPlayList] success : " + val.result);
}
var onError = function(error) {
console.log("[clearSyncPlayList] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[clearSyncPlayList]");
b2bapis.b2bsyncplay.clearSyncPlayList(onSuccess, onError); 

Parameters

data
   provide status

Version

1.0

Since

2.4

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bsyncplay

Product

B2B

SDK Support

Y



위로가기