Class: DataSource

OSH.DataReceiver. DataSource

The DataSource is the abstract class used to create different datasources.

abstractnew OSH.DataReceiver.DataSource(name, properties)

Name Type Description
name string

the datasource name

properties Object

the datasource properties

Name Type Description
timeShift boolean

fix some problem with some android devices with some timestamp shift to 16 sec

syncMasterTime boolean

defines if the datasource is synchronize with the others one

bufferingTime number

defines the time during the data has to be buffered

timeOut number

defines the limit time before data has to be skipped

protocol string

defines the protocol of the datasource. @see OSH.DataConnector.DataConnector

Methods

Builds the full url.

Name Type Description
properties object
Name Type Description
protocol string

the connector protocol

endpointUrl string

the endpoint url

service string

the service

offeringID string

the offeringID

observedProperty string

the observed property

startTime string

the start time (ISO format)

endTime string

the end time (ISO format)

replaySpeed number

the replay factor

responseFormat number

the response format (e.g video/mp4)

Returns:
Type Description
string the full url

Builds the full url.

Name Type Description
properties object
Name Type Description
protocol string

the connector protocol

endpointUrl string

the endpoint url

service string

the service

offeringID string

the offeringID

observedProperty string

the observed property

startTime string

the start time (ISO format)

endTime string

the end time (ISO format)

replaySpeed number

the replay factor

responseFormat number

the response format (e.g video/mp4)

Returns:
Type Description
string the full url

Connect the dataSource then the connector will be opened as well.

Disconnect the dataSource then the connector will be closed as well.

Gets the datasource id.

Returns:
Type Description
string the datasource id

Gets the datasource name.

Returns:
Type Description
*

Inits the datasource with the constructor properties.

Name Type Description
properties
Name Type Description
data Object

the data object

Example

data is represented as
data = {
timeStamp: timeStamp // number
data: data // data to render
};

parseData(data){String|Object|number|ArrayBuffer|*}

The default timestamp parser

Name Type Description
data

the full data message returned by the connector

Returns:
Type Description
String | Object | number | ArrayBuffer | * data the formatted data

The default timestamp parser

Name Type Description
data

the full data message returned by the connector

Returns:
Type Description
number the formatted timestamp

Type Definitions

onMessage

The callback which receives data.