GUIDE

GUIDE


B2BRTPplay API

'B2BRTPPlay::B2BRTPPlayManagerObject' interface

Public Attributes

readonly attribute B2BRTPPlayManager b2brtpplay



Details in English

Namespace forB2BRTPPlay API.

Version

1.0

Privilege Level

Public

Privilege

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

Product

B2B

Since

2.4

SDK Support

N


'B2BRTPPlay::B2BRTPPlayManager' interface

Public Methods

DOMString getVersion ( )
This interface provides methods to get B2B RTPPlay module's version. More...
void stopChannel ( B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError )
This interface provides methods to Stop Current Channel, need to be called when Application exits. More...
void setEventListener ( B2bRTPPlayEventCallback handler )
This interface provides method to set Event handler callback which will receive events from RTP Player module. More...
void unsetEventListener ( )
This interface provides method to unset event listener. More...
void setAudioMute ( long muteType, B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError )
This interface provides method to Mute the Audio of the channel which is being played. More...

Public Methods

DOMString getVersion()

   This interface provides methods to get B2B RTPPlay module's version.


Details in English

This interface provides methods to get B2B RTPPlay module's version

Returns

Version of RTPPlay 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.
var Version = null;
try {
Version = b2bapis.b2brtpplay.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);
} 

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void playChannel(DOMString videoURL, B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError)



Details in English

This interface provides methods to Play the channel being streamed at given URL

Returns

N/A

Parameters

videoURL
   DOMString, video URL
onSuccess
   Callback method to be invoked when this api success
onError
   [optional] 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 InvalidStateError, if it is called before setDrm(if DRM channel), setDisplayRect and setEventListener.
B2bAPIException
   with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
var onSuccess = function(val) {
console.log("[playChannel] success result: " + val);
}
var onError = function(error) {
console.log("[playChannel] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[playChannel]");
b2bapis.b2brtpplay.playChannel("rtp://239.10.10.11:11000",onSuccess, onError); 

Constraint

This can be called only aftersetDrm if DRM channel, setDisplayRect and setEventListener

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void stopChannel( B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError)

   This interface provides methods to Stop Current Channel, need to be called when Application exits.


Details in English

This interface provides methods to Stop Current Channel, need to be called when Application exits

Returns

N/A

Parameters

onSuccess
   Callback method to be invoked when this api success
onError
   [optional] 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, if any input parameter is not compatible with the expected type for that parameter.
var onSuccess = function(val) {
console.log("[stopChannel] success result: " + val);
}
var onError = function(error) {
console.log("[stopChannel] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[stopChannel]");
b2bapis.b2brtpplay.stopChannel(onSuccess, onError); 

Constraint

N/A

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void setDrm(B2BRTPPlayDRMType drmType, DOMString drmURL, B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError)

   This interface provides methods to Set DRM Info for playing encrypted streams.


Details in English

This interface provides methods to Set DRM Info for playing encrypted streams

Returns

N/A

Parameters

drmType
   enum B2BRTPPlayDRMType, DRM type of playing streams
drmURL
   DOMString, DRM server URL
onSuccess
   Callback method to be invoked when this api success
onError
   [optional] 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 InvalidStateError, if it is not called beofore playchannel.
B2bAPIException
   with error type TypeMismatchError,if any input parameter is not compatible with the expected type for that parameter.
var onSuccess = function(val) {
console.log("[setDrm] success result: " + val);
}
var onError = function(error) {
console.log("[setDrm] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[setDrm]");
b2bapis.b2brtpplay.setDrm("LYNK","NONE", onSuccess, onError); 

Constraint

This should be called beforeplayChannel()

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void setDisplayRect(long rectX, long rectY, long rectWidth, long rectHeight, B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError)

   This interface provides methods to Set Player Window where video will be played.


Details in English

This interface provides methods to Set Player Window where video will be played

Returns

N/A

Parameters

rectX
   long, rect X
rectY
   long, rect Y
rectWidth
   long,Width
rectHeight
   long,Height
onSuccess
   Callback method to be invoked when this api success
onError
   [optional] 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 InvalidStateError, if it is called after playChannel.
B2bAPIException
   with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
var onSuccess = function(val) {
console.log("[setDisplayRect] success result: " + val);
}
var onError = function(error) {
console.log("[setDisplayRect] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[setDisplayRect] ");
b2bapis.b2brtpplay.setDisplayRect(0,0,1920,1280,onSuccess, onError); 

Constraint

This should be called beforeplayChannel()

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void setEventListener( B2bRTPPlayEventCallback handler)

   This interface provides method to set Event handler callback which will receive events from RTP Player module.


Details in English

This interface provides method to set Event handler callback which will receive events from RTP Player module

Returns

N/A

Parameters

handler
    B2bRTPPlayEventCallback , Callback method to be invoked when on event

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 InvalidStateError, if it is called after playChannel.
B2bAPIException
   with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
var handler = function(eventName, param ) {
console.log("[event received] success : " + eventName);
}
console.log("[setEventListener] ");
b2bapis.b2brtpplay.setEventListener(handler); 

Constraint

This should be called beforeplayChannel()

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void unsetEventListener()

   This interface provides method to unset event listener.


Details in English

This interface provides method to unset event listener

Returns

N/A

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type InvalidStateError, if it is called after stopChannel.
B2bAPIException
   with error type UnknownError in any other error case.
console.log("[unsetEventListener] ");
b2bapis.b2brtpplay.unsetEventListener(); 

Constraint

This should be called beforestopChannel

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


void setAudioMute(long muteType, B2BRTPPlaySuccessCallback onSuccess, optional B2BRTPPlayErrorCallback ? onError)

   This interface provides method to Mute the Audio of the channel which is being played.


Details in English

This interface provides method to Mute the Audio of the channel which is being played

Returns

N/A

Parameters

muteType
   long, Audio Mute flag (0: Mute state, 1: Unmute state)
onSuccess
   Callback method to be invoked when this api success
onError
   [optional] 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, if any input parameter is not compatible with the expected type for that parameter.
var onSuccess = function(val) {
console.log("[setAudioMute] success result: " + val);
}
var onError = function(error) {
console.log("[setAudioMute] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[setAudioMute]");
b2bapis.b2brtpplay.setAudioMute(1,onSuccess, onError); 

Constraint

N/A

Product

B2B

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

SDK Support

N


'B2BRTPPlay::B2bRTPPlayEventCallback' interface

Public Methods

void onEvent(B2BRTPPlayEventName eventName, B2BRTPPlayEventData param)



Details in English

This method is callback for events

Returns

void

Parameters

eventName
   provides name of player events
param
   type of events

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 EventCallback type passed.
var b2brtpplayCallback = function(eventName, param) {
consol.log("eventName: " + eventName + " | param: " + param);
}
console.log("[setEventListner]");
b2bapis.b2brtpplay.setEventListener(b2brtpplayCallback);

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

Product

B2B

SDK Support

N


'B2BRTPPlay::B2BRTPPlaySuccessCallback' interface

Public Methods

void onSuccess( b2bResult resultData)



Details in English

This method is callback parameter.

Parameters

resultData
   result status

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.
var onSuccess = function(val) {
console.log("[stopChannel] success result: " + val);
}
console.log("[stopChannel]");
b2bapis.b2brtpplay.stopChannel(onSuccess, onError); 

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

Product

B2B

SDK Support

N


'B2BRTPPlay::B2BRTPPlayErrorCallback' interface

Public Methods

void onError( b2bError 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 onError = function(error) {
console.log("[stopChannel] code :" + error.code + " error name: " + error.name + " message " + error.message);
}
console.log("[stopChannel]");
b2bapis.b2brtpplay.stopChannel(onSuccess, onError); 

Version

1.0

Since

2.4

Deprecated

5.0

Privilege Level

Public

Privilege

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

Product

B2B

SDK Support

N



위로가기