Class: KurentoClient

kurentoClient.KurentoClient(ws_uri, optionsopt, callbackopt)

new KurentoClient(ws_uri, optionsopt, callbackopt)

Creates a connection with the Kurento Media Server
Parameters:
Name Type Attributes Description
ws_uri external:String Address of the Kurento Media Server
options module:kurentoClient.KurentoClient~KurentoClientDict <optional>
callback module:kurentoClient.KurentoClient~constructorCallback <optional>
Source:

Methods

(static) getSingleton(ws_uri, optionsopt, callbackopt) → {external:Promise}

Creates a unique connection with the Kurento Media Server
Parameters:
Name Type Attributes Description
ws_uri external:String Address of the Kurento Media Server
options module:kurentoClient.KurentoClient~KurentoClientDict <optional>
callback module:kurentoClient.KurentoClient~constructorCallback <optional>
Source:
See:
Returns:
Type
external:Promise

catch(onRejectedopt) → {external:Promise}

Parameters:
Name Type Attributes Description
onRejected external:Function <optional>
Source:
Returns:
Type
external:Promise

close()

Source:

connect(…media, callbackopt) → {external:Promise}

Connect the source of a media to the sink of the next one
Parameters:
Name Type Attributes Description
media module:core/abstracts.MediaObject <repeatable>
A media to be connected
callback module:kurentoClient.KurentoClient~connectCallback <optional>
Source:
Throws:
SyntaxError
Returns:
Type
external:Promise

create(type, paramsopt, callback) → {module:core/abstracts.MediaObject|Array.<module:core/abstracts.MediaObject>}

Create a new instance of a MediaObject
Parameters:
Name Type Attributes Description
type external:String Type of the element
params Array.<external:string> <optional>
callback module:kurentoClient.KurentoClient~createCallback
Source:
Returns:
Type
module:core/abstracts.MediaObject | Array.<module:core/abstracts.MediaObject>

getComplexType(complexType) → {module:core/complexType}

Get a complexType across the qualified name
Parameters:
Name Type Description
complexType external:String ComplexType's name
Source:
Returns:
Type
module:core/complexType

getMediaobjectById(id, callback) → {external:Promise}

Get a MediaObject from its ID
Parameters:
Name Type Description
id external:String | Array.<external:string> ID of the MediaElement
callback module:kurentoClient.KurentoClient~getMediaobjectByIdCallback
Source:
Returns:
Type
external:Promise

getServerManager(callback) → {external:Promise}

Get a reference to the current Kurento Media Server we are connected
Parameters:
Name Type Description
callback module:kurentoClient.KurentoClient~getServerManagerCallback
Source:
Returns:
Type
external:Promise

then(onFulfilled, onRejectedopt) → {external:Promise}

Parameters:
Name Type Attributes Description
onFulfilled external:Function
onRejected external:Function <optional>
Source:
Returns:
Type
external:Promise

(inner) commitSerial(params, callback)

Parameters:
Name Type Description
params external:Object
callback external:Function
Source:

(inner) commitTransactional(params, callback)

Parameters:
Name Type Description
params external:Object
callback external:Function
Source:

(inner) deferred(mediaObject, params, prevRpc, callback) → {external:Promise}

Parameters:
Name Type Description
mediaObject module:core/abstracts.MediaObject
params external:Object
prevRpc external:Promise
callback external:Function
Source:
Returns:
Type
external:Promise

(inner) describe(id, callback)

Parameters:
Name Type Description
id external:string
callback external:Function
Source:

(inner) findIndex(list, predicate) → {external:Integer}

Parameters:
Name Type Description
list external:Array
predicate external:Function
Source:
Returns:
Type
external:Integer

(inner) noop(error, result)

Parameters:
Name Type Description
error
result
Source:
Returns:
result

(inner) registerObject(mediaObject, id)

Parameters:
Name Type Description
mediaObject module:core/abstracts.MediaObject
id external:string
Source:

(inner) serializeOperation(operation, index)

Parameters:
Name Type Description
operation external:Object
index external:Integer
Source:

(inner) serializeParams(params) → {external:Object}

Serialize objects using their id
Parameters:
Name Type Description
params external:Object
Source:
Returns:
Type
external:Object

Type Definitions

connectCallback(error)

Parameters:
Name Type Description
error external:Error
Source:

constructorCallback(error, client)

Parameters:
Name Type Description
error external:Error
client module:kurentoClient.KurentoClient The created KurentoClient
Source:

createCallback(error, result)

Parameters:
Name Type Description
error external:Error
result module:core/abstracts.MediaElement The created MediaElement
Source:

getMediaobjectByIdCallback(error, result)

Parameters:
Name Type Description
error external:Error
result module:core/abstracts.MediaElement | Array.<module:core/abstracts.MediaElement> The requested MediaElement
Source:

getServerManagerCallback(error, server)

Parameters:
Name Type Description
error external:Error
server module:core/abstracts.ServerManager Info of the MediaServer instance
Source:

KurentoClientDict

Type:
  • Object
Properties:
Name Type Attributes Default Description
failAfter external:Number <optional>
Infinity Fail after N reconnection attempts
enableTransactions external:Boolean <optional>
true Enable transactions functionality
strict external:Boolean <optional>
true Throw an error when creating an object of unknown type
access_token external:String <optional>
Set access token for the WebSocket connection
max_retries external:Number <optional>
0 Number of tries to send the requests
request_timeout external:Number <optional>
20000 Timeout between requests retries
response_timeout external:Number <optional>
20000 Timeout while a response is being stored
duplicates_timeout external:Number <optional>
20000 Timeout to ignore duplicated responses
socket Object <optional>
Websocket connection options
Source: