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 697

#### <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 202

  ##### Returns:

  Type
    Array

#### <static> getTurnCrendentials(url)

  Checks if cached configuration is valid and if necessary update it.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `url` | string | <optional> |

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

#### <static> hangUp()

  Hang up the current call.
  Source:
    - jsxc.lib.webrtc.js, line 806

#### <private, static> init()

  Initialize webrtc plugin.
  Source:
    - jsxc.lib.webrtc.js, line 40

#### <private, static> initWindow(event, win)

  Add "video" button to window menu.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `win` |  | jQuery window object

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

#### <private, static> onCallRinging()

  Remote station is ringing.
  Source:
    - jsxc.lib.webrtc.js, line 659

#### <private, static> onCallTerminated(event, sid, reason, text)

  Called if call is terminated.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `event` |  |  |
  `sid` |  |  | Session id
  `reason` |  |  | Reason for termination
  `text` |  | <optional> | Optional explanation

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

#### <private, static> onCaps(event, jid)

  Update "video" button if we receive cap information.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `jid` |  |

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

#### <private, static> onIceConnectionStateChanged(event, sid, sess)

  Extracts local and remote ip and display it to the user.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `sid` |  | session id
  `sess` |  |

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

#### <private, static> onIncomingCall(event, sid)

  Called on incoming call.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `sid` |  | Session id

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

#### <private, static> onMediaFailure()

  Called if media failes.
  Source:
    - jsxc.lib.webrtc.js, line 476

#### <private, static> onMediaReady(event, stream)

  Called if video/audio is ready. Open window and display some messages.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `stream` |  |

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

#### <private, static> onMessage(e, from)

  Check if full jid changed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `e` |  |
  `from` |  | full jid

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

#### <private, static> onPresence(ev, status)

  Update icon on presence.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ev` |  |
  `status` |  |

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

#### <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 955

#### <private, static> onRemoteStreamAdded(event, data, sid)

  Called if we receive a remote stream.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `data` |  |
  `sid` |  | Session id

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

#### <private, static> onRemoteStreamRemoved(event, data, sid)

  Called if the remote stream was removed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `data` |  |
  `sid` |  | Session id

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

#### <static> reqUserMedia()

  Request video and audio from local user.
  Source:
    - jsxc.lib.webrtc.js, line 822

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

  Send file to full jid.

  ##### Parameters:

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

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

  ##### 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 370

#### <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 887

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

  Start a call to the specified jid.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jid` |  | full jid
  `um` |  | requested user media

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

#### <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 259