new DataChannel(id, contact)
Creates a new call
Parameters:
| Name | Type | Description | 
|---|---|---|
| id | String | call id | 
| contact | Contact | called contact | 
Fires:
- DataChannel#event:response
- DataChannel#event:accepted
- DataChannel#event:declined
- DataChannel#event:opened
- DataChannel#event:closed
- DataChannel#event:ended
- DataChannel#event:transferProgress
- DataChannel#event:transferComplete
- DataChannel#event:dataReceived
- DataChannel#event:error
Returns:
this
- Type
- DataChannel
Extends
Methods
- 
    <static> getAvailableEvents()
- 
    
    Returns available events for this class Returns:- Type
- Array.<string>
 
- 
    close()
- 
    
    Stops datachannel session with contact Returns:- Type
- Void
 
- 
    getContact()
- 
    
    Returns called contact Returns:DataChannel contact - Type
- Contact
 
- 
    getId()
- 
    
    Returns datachannel session id Returns:DataChannel id - Type
- string
 
- 
    getStatus()
- 
    
    Returns datachannel session status Returns:DataChannel status, value can be DATACHANNEL_STATUS_WAITING, DATACHANNEL_STATUS_ONGOING, DATACHANNEL_STATUS_ENDED - Type
- Symbol
 
- 
    getType()
- 
    
    Returns datachannel session type Returns:DataChannel type - Type
- Symbol
 
- 
    on(listener)
- 
    
    Adds a listener to a Observable event Parameters:Name Type Description listenerfunction - Inherited From:
- Overrides:
 Returns:this instance for chaining - Type
- Observable
 
- 
    removeListener(eventType, listener)
- 
    
    Remove existing listener to Observable event Parameters:Name Type Description eventTypeString listenerfunction - Inherited From:
- Overrides:
 Returns:this instance for chaining - Type
- Observable
 
- 
    sendData(data, fileInfo)
- 
    
    Sends data over data channel (send side only) Parameters:Name Type Description dataany fileInfoFileInfo relevant file information for the contact Returns:uuid of the data transfered - Type
- Promise.<string>
 
Events
- 
    accepted
- 
    
    When contact accepts datachannel Type: Void
- 
    closed
- 
    
    When the data channel effectively closed Type: Void
- 
    dataReceived
- 
    
    Fired at the end of a data transfer when data has been received Type: objectProperties:Name Type Description uuidstring datastring 
- 
    declined
- 
    
    When contact decline datachannel Type: Void
- 
    ended
- 
    
    When contact hangs up from 1-1 datachannel, 'from' property indicates which side initiated the ended, either 'remote' or 'local' Type: objectProperties:Name Type Description fromstring 
- 
    error
- 
    
    When the data channel returns an error Type: Void
- 
    opened
- 
    
    When the data channel effectively opened Type: Void
- 
    response
- 
    
    When contact accepted or declined datachannel Type: Void
- 
    transferComplete
- 
    
    Fired at the end of a data transfer Type: TransferInformation
- 
    transferProgress
- 
    
    Fired periodically during a data transfer Type: TransferInformation