JSDoc: Namespace: webrtc

# Namespace: webrtc

## jsxc.webrtc

WebRTC namespace for jsxc.

Source:
  - jsxc.lib.webrtc.js, line 4

### Members

#### (static) AUTO_ACCEPT

should we auto accept incoming calls?

Source:
  - jsxc.lib.webrtc.js, line 23

#### (static) chatJids

bare jid to current jid mapping

Source:
  - jsxc.lib.webrtc.js, line 32

#### (static) conn

strophe connection

Source:
  - jsxc.lib.webrtc.js, line 11

#### (static) last_caller

jid of the last caller

Source:
  - jsxc.lib.webrtc.js, line 20

#### (static) localStream

local video stream

Source:
  - jsxc.lib.webrtc.js, line 14

#### (static) remoteStream

remote video stream

Source:
  - jsxc.lib.webrtc.js, line 17

#### (static) reqFileFeatures

required disco features for file transfer

Source:
  - jsxc.lib.webrtc.js, line 29

#### (static) reqVideoFeatures

required disco features for video call

Source:
  - jsxc.lib.webrtc.js, line 26

### Methods

#### (static) attachMediaStream(element, stream)

Attach media stream to element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`element` | Element | jQuery |
`stream` | mediastream |

Source:
  - jsxc.lib.webrtc.js, line 874

#### (static) getCapableRes(jid, features) → {Array}

Return list of capable resources.

##### Parameters:

Name | Type | Description
--- | --- | ---
`jid` |  |
`features` | string | Array.<string> | list of required features

Source:
  - jsxc.lib.webrtc.js, line 275

##### Returns:

Type
  Array

#### (static) getScreenMedia()

Get screen media from local browser.

Source:
  - jsxc.lib.webrtc.js, line 1213

#### (static) getUserMedia()

Get user media from local browser.

Source:
  - jsxc.lib.webrtc.js, line 1178

#### (static) hangUp()

Hang up the current call.

Source:
  - jsxc.lib.webrtc.js, line 999

#### (static) initiateOutgoingCall(jid, stream)

Start jingle session to jid with stream.

##### Parameters:

Name | Type | Description
--- | --- | ---
`jid` | String |
`stream` | Object |

Source:
  - jsxc.lib.webrtc.js, line 961

#### (static) initiateScreenSharing(jid, stream)

Initiate outgoing (one-way) jingle session to jid with stream.

##### Parameters:

Name | Type | Description
--- | --- | ---
`jid` | String |
`stream` | Object |

Source:
  - jsxc.lib.webrtc.js, line 1058

#### (static) onIncoming(session)

Process incoming jingle offer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | BaseSession |

Source:
  - jsxc.lib.webrtc.js, line 554

#### (static) onIncomingFileTransfer(session)

Process incoming file offer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | FileSession |

Source:
  - jsxc.lib.webrtc.js, line 645

#### (static) onIncomingStream(session)

Process incoming stream offer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | MediaSession |

Source:
  - jsxc.lib.webrtc.js, line 588

#### (static) onReceivedFile(sess, file, metadata)

Display received file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`sess` | object |
`file` | File |
`metadata` | object | file metadata

Source:
  - jsxc.lib.webrtc.js, line 1332

#### (static) onSessionAccepted(session)

Session was accepted by other peer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | BaseSession |

Source:
  - jsxc.lib.webrtc.js, line 1115

#### (static) onTerminated(session, reason)

Process jingle termination event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`session` | BaseSession |
`reason` | Object | Reason for termination

Source:
  - jsxc.lib.webrtc.js, line 758

#### (static) reqUserMedia()

Request media from local user.

Source:
  - jsxc.lib.webrtc.js, line 1128

#### (static) sendFile(jid, file) → {object}

Send file to full jid via jingle.

##### Parameters:

Name | Type | Description
--- | --- | ---
`jid` | string | full jid
`file` | file |

Source:
  - jsxc.lib.webrtc.js, line 1299

##### Returns:

session

Type
  object

#### (static) setStatus(txt, d)

Display status message to user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`txt` |  | message
`d` |  | duration in ms

Source:
  - jsxc.lib.webrtc.js, line 452

#### (static) snapshot(video)

Make a snapshot from a video stream and display it.

##### Parameters:

Name | Type | Description
--- | --- | ---
`video` |  | Video stream

Source:
  - jsxc.lib.webrtc.js, line 1256

#### (static) startCall(jid, um)

Start a call to the specified jid.

##### Parameters:

Name | Type | Description
--- | --- | ---
`jid` | String | full jid
`um` | Array.<String> | requested user media

Source:
  - jsxc.lib.webrtc.js, line 931

#### (static) startScreenSharing(jid)

Start outgoing screen sharing session.

##### Parameters:

Name | Type | Description
--- | --- | ---
`jid` | String |

Source:
  - jsxc.lib.webrtc.js, line 1015

#### (static) updateIcon(bid)

Enable or disable "video" icon and assign full jid.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` |  | CSS conform jid

Source:
  - jsxc.lib.webrtc.js, line 346