API Docs for: 0.4.2
Show:

Skyway Class

Defined in: source\skyway.js:5

Available since 0.1.0

Please check on the init() function on how you can initialize Skyway. Note that:

  • You will have to subscribe all Skyway events first before calling init().
  • If you need an api key, please register an api key at our developer console.

Constructor

Skyway

()

Defined in source\skyway.js:5

Available since 0.1.0

Example:

                

// Getting started on how to use Skyway var SkywayDemo = new Skyway(); SkywayDemo.init('apiKey');

Item Index

Methods

_addLocalStream

(
  • peerId
)
private

Defined in source\skyway.js:2765

Available since 0.2.0

Sends our Local MediaStream to other Peers. By default, it sends all it's other stream

Parameters:

  • peerId String

    PeerId of the peer to send local stream to.

_addStereo

(
  • sdpLines
)
Array private

Defined in source\skyway.js:2867

Available since 0.2.0

Adds stereo feature to the SDP.

  • This requires OPUS to be enabled in the SDP or it will not work.

Parameters:

  • sdpLines Array

    Sdp received.

Returns:

Array:

Updated version with Stereo feature

_answerHandler

(
  • message.type
  • message
)
private

Triggers:

handshakeProgress

Defined in source\skyway.js:2653

Available since 0.1.0

Signaling server sends an answer message.

  • SIG_TYPE: ANSWER
  • This occurs when a peer sends an answer message is received.

Parameters:

  • message.type String

    Message type

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • sdp String

      Answer sessionDescription

    • mid String

      PeerId of the peer that is sending the enter shake.

    • type String

      The type of message received.

_base64ToBlob

(
  • dataURL
)
private

Defined in source\skyway.js:3817

Available since 0.1.0

Converts base64 string to raw binary data.

  • Doesn't handle URLEncoded DataURIs
  • See StackOverflow answer #6850276 for code that does this This is to convert the base64 binary string to a blob

Parameters:

  • dataURL String

    Blob base64 dataurl.

_byeHandler

(
  • message
)
private

Triggers:

peerLeft

Defined in source\skyway.js:2327

Available since 0.1.0

Signaling server sends a bye message.

  • SIG_TYPE: BYE
  • This occurs when a peer left the room.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that has left the room.

    • type String

      The type of message received.

_candidateHandler

(
  • message
)
private

Defined in source\skyway.js:2601

Available since 0.1.0

Signaling server sends a candidate message.

  • SIG_TYPE: CANDIDATE
  • This occurs when a peer sends an ice candidate.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the offer shake.

    • sdp String

      Offer sessionDescription.

    • target String

      PeerId that is specifically targeted to receive the message.

    • id String

      Peer's ICE candidate id.

    • candidate String

      Peer's ICE candidate object.

    • label String

      Peer's ICE candidate label.

    • type String

      The type of message received.

_chunkFile

(
  • blob
  • blobByteSize
)
private

Defined in source\skyway.js:3840

Available since 0.1.0

Chunks blob data into chunks.

Parameters:

  • blob Blob

    The blob data to chunk.

  • blobByteSize Integer

    The blob data size.

_clearDataChannelTimeout

(
  • peerId
  • isSender
  • self
)
private

Defined in source\skyway.js:3799

Available since 0.1.0

Clears the datachannel timeout.

Parameters:

  • peerId String

    PeerId of the datachannel to clear timeout.

  • isSender Boolean

    Is peer the sender or the receiver?

  • self Skyway

    Skyway object.

_closeChannel

() private

Defined in source\skyway.js:3334

Available since 0.1.0

Closes the socket signaling connection.

_closeDataChannel

(
  • peerId
  • self
)
private

Defined in source\skyway.js:3443

Available since 0.1.0

Closes the datachannel.

Parameters:

  • peerId String

    PeerId of the peer's datachannel to close.

  • self Skyway

    Skyway object.

_createDataChannel

(
  • peerId
  • dc
)
private

Triggers:

dataChannelState

Defined in source\skyway.js:3349

Available since 0.1.0

Create a DataChannel. Only SCTPDataChannel support

Parameters:

  • peerId String

    PeerId of the peer which the datachannel is connected to

  • dc Object

    The datachannel object received.

_createPeerConnection

(
  • targetMid
)
Object private

Defined in source\skyway.js:3141

Available since 0.1.0

Creates a peerconnection to communicate with the peer whose ID is 'targetMid'. All the peerconnection callbacks are set up here. This is a quite central piece.

Parameters:

  • targetMid String

Returns:

Object:

The created peer connection object.

_dataChannelACKHandler

(
  • peerId
  • data
  • self
)
private

Triggers:

dataTransferState

Defined in source\skyway.js:3562

Available since 0.1.0

The user receives an acknowledge of the blob request.

Parameters:

  • peerId String

    PeerId of the peer that is sending the acknowledgement.

  • data Array

    The data object received from datachannel.

  • self Skyway

    Skyway object.

_dataChannelCHATHandler

(
  • peerId
  • data
  • self
)
private

Triggers:

incomingMessage

Defined in source\skyway.js:3614

Available since 0.4.0

The user receives a datachannel broadcast message.

Parameters:

  • peerId String

    PeerId of the peer that is sending a broadcast message.

  • data Array

    The data object received from datachannel.

  • self Skyway

    Skyway object.

_dataChannelDATAHandler

(
  • peerId
  • dataString
  • dataType
  • self
)
private

Triggers:

dataTransferState

Defined in source\skyway.js:3687

Available since 0.4.1

This is when the data is sent from the sender to the receiving user.

Parameters:

  • peerId String

    PeerId of the peer that is sending the data.

  • dataString ArrayBuffer | Blob | String

    The data received.

  • dataType String

    The data type received from datachannel. [Rel: Skyway.DATA_TRANSFER_DATA_TYPE]

  • self Skyway

    Skyway object.

_dataChannelERRORHandler

(
  • peerId
  • data
  • self
)
private

Triggers:

dataTransferState

Defined in source\skyway.js:3664

Available since 0.1.0

The user receives a timeout error.

Parameters:

  • peerId String

    PeerId of the peer that is sending the error.

  • data Array

    The data object received from datachannel.

  • self Skyway

    Skyway object.

_dataChannelHandler

(
  • data
)
private

Defined in source\skyway.js:3461

Available since 0.1.0

Handles all datachannel protocol events.

Parameters:

  • data String | Object

    The data received from datachannel.

_dataChannelWRQHandler

(
  • peerId
  • data
  • self
)
private

Triggers:

dataTransferState

Defined in source\skyway.js:3499

Available since 0.4.0

The user receives a blob request. From here, it's up to the user to accept or reject it

Parameters:

  • peerId String

    PeerId of the peer that is sending the request.

  • data Array

    The data object received from datachannel.

  • self Skyway

    Skyway object.

_doAnswer

(
  • targetMid
)
private

Defined in source\skyway.js:2703

Available since 0.1.0

We have succesfully received an offer and set it locally. This function will take care of cerating and sendng the corresponding answer. Handshake step 4.

Parameters:

  • targetMid String

    PeerId of the peer to send answer to.

_doCall

(
  • targetMid
)
private

Defined in source\skyway.js:2807

Available since 0.1.0

It then sends it to the peer. Handshake step 3 (offer) or 4 (answer)

Parameters:

  • targetMid String

    PeerId of the peer to send offer to.

_enterHandler

(
  • message
)
private

Triggers:

handshakeProgress, peerJoined

Defined in source\skyway.js:2447

Available since 0.1.0

Signaling server sends a enter message.

  • SIG_TYPE: ENTER
  • This occurs when a peer just entered the room.
  • If we don't have a connection with the peer, send a welcome.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the enter shake.

    • agent String

      Peer's browser agent.

    • version String

      Peer's browser version.

    • userInfo String

      Peer's user information.

      • settings JSON
        Peer's stream settings
      • settings.audio Boolean | JSON
      • settings.audio.stereo Boolean
      • settings.video Boolean | JSON
      • settings.video.resolution JSON
        [Rel: Skyway.VIDEO_RESOLUTION]
      • settings.video.resolution.width Integer
      • settings.video.resolution.height Integer
      • settings.video.frameRate Integer
      • mediaStatus JSON
        Peer stream status.
      • mediaStatus.audioMuted Boolean
        If peer's audio stream is muted.
      • mediaStatus.videoMuted Boolean
        If peer's video stream is muted.
      • userData String | JSON
        Peer custom data
    • type String

      The type of message received.

_errorHandler

(
  • message
)
deprecated private

Defined in source\skyway.js:2186

Available since 0.1.0

Signaling server sends an error message.

  • SIG_TYPE: ERROR
  • This occurs when an error was thrown by the signaling server.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the error message.

    • kind String

      The type of error.

    • type String

      The type of message received.

_findSDPLine

(
  • sdpLines
  • condition
  • value
)
Array private

Defined in source\skyway.js:2840

Available since 0.2.0

Finds a line in the SDP and returns it.

  • To set the value to the line, add an additional parameter to the method.

Parameters:

  • sdpLines Array

    Sdp received.

  • condition Array

    The conditions.

  • value String

    Value to set Sdplines to

Returns:

Array:

[index, line] - Returns the sdpLines based on the condition

_handleAV

(
  • mediaType
  • enableMedia
)
private

Triggers:

peerUpdated

Defined in source\skyway.js:4041

Available since 0.4.0

Handles all audio and video mute events.

  • If there is no available audio or video stream, it will call leaveRoom() and call joinRoom() to join user in the room to send their audio and video stream.

Parameters:

  • mediaType String

    Media types expected to receive. [Rel: 'audio' or 'video']

  • enableMedia Boolean

    Enable it or disable it

_handleLock

(
  • lockAction
  • callback
)
private

Triggers:

roomLock

Defined in source\skyway.js:3991

Available since 0.4.0

Handles all the room lock events.

Parameters:

  • lockAction String

    Lock action to send to server for response. [Rel: SkywayDemo.LOCK_ACTION]

  • callback Function

    The callback to return the response after everything's loaded.

_inRoomHandler

(
  • message
)
private

Triggers:

peerJoined

Defined in source\skyway.js:2403

Available since 0.1.0

Signaling server sends an inRoom message.

  • SIG_TYPE: IN_ROOM
  • This occurs the user has joined the room.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • sid String

      PeerId of self.

    • mid String

      PeerId of the peer that is sending the joinRoom message.

    • pc_config JSON

      The peerconnection configuration.

    • type String

      The type of message received.

_loadInfo

(
  • self
)
private

Triggers:

readyStateChange

Defined in source\skyway.js:969

Available since 0.1.0

Start the loading of information from the api server.

Parameters:

_muteAudioEventHandler

(
  • message
)
private

Triggers:

peerUpdated

Defined in source\skyway.js:2275

Available since 0.2.0

Signaling server sends a muteAudioEvent message.

  • SIG_TYPE: MUTE_AUDIO
  • This occurs when a peer's audio stream muted status has changed.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending their own updated audio stream status.

    • muted String

      If audio stream is muted or not.

    • type String

      The type of message received.

_muteVideoEventHandler

(
  • message
)
private

Triggers:

peerUpdated

Defined in source\skyway.js:2301

Available since 0.2.0

Signaling server sends a muteVideoEvent message.

  • SIG_TYPE: MUTE_VIDEO
  • This occurs when a peer's video stream muted status has changed.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending their own updated video streams status.

    • muted String

      If video stream is muted or not.

    • type String

      The type of message received.

_offerHandler

(
  • message
)
private

Triggers:

handshakeProgress

Defined in source\skyway.js:2563

Available since 0.1.0

Signaling server sends an offer message.

  • SIG_TYPE: OFFER
  • This occurs when we've just received an offer.
  • If there is no existing connection with this peer, create one, then set the remotedescription and answer.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the offer shake.

    • sdp String

      Offer sessionDescription

    • type String

      The type of message received.

_onIceCandidate

(
  • targetMid
  • event
)
private

Triggers:

candidateGenerationState

Defined in source\skyway.js:3218

Available since 0.1.0

A candidate has just been generated (ICE gathering) and will be sent to the peer. Part of connection establishment.

Parameters:

  • targetMid String
  • event Event

    This is provided directly by the peerconnection API.

_onRemoteStreamAdded

(
  • targetMid
  • event
)
private

Triggers:

incomingStream

Defined in source\skyway.js:2792

Available since 0.1.0

The remote peer advertised streams, that we are forwarding to the app. This is part of the peerConnection's addRemoteDescription() API's callback.

Parameters:

  • targetMid String

    PeerId of the peer that has remote stream to send.

  • event Event

    This is provided directly by the peerconnection API.

_onUserMediaError

(
  • error
  • self
)
private

Triggers:

mediaAccessFailure

Defined in source\skyway.js:2068

Available since 0.1.0

Access to user's MediaStream failed.

Parameters:

  • error Object

    Error object that was thrown.

  • self Skyway

    Skyway object.

_onUserMediaSuccess

(
  • stream
  • self
)
private

Triggers:

mediaAccessSuccess

Defined in source\skyway.js:2041

Available since 0.3.0

Access to user's MediaStream is successful.

Parameters:

  • stream MediaStream

    MediaStream object.

  • self Skyway

    Skyway object.

_openChannel

() private

Triggers:

channelMessage, channelOpen, channelError, channelClose

Defined in source\skyway.js:3285

Available since 0.1.0

Initiate a socket signaling connection.

_openPeer

(
  • targetMid
  • peerAgentBrowser
  • toOffer
  • receiveOnly
)
private

Defined in source\skyway.js:2731

Available since 0.1.0

We have a peer, this creates a peerconnection object to handle the call. if we are the initiator, we then starts the O/A handshake.

Parameters:

  • targetMid String

    PeerId of the peer we should connect to.

  • peerAgentBrowser String

    Peer's browser

  • toOffer Boolean

    Wether we should start the O/A or wait.

  • receiveOnly Boolean

    Should they only receive?

_parseInfo

(
  • info
  • self
)
private

Triggers:

readyStateChange

Defined in source\skyway.js:910

Available since 0.1.0

Parse the information received from the api server.

Parameters:

  • info JSON

    The parsed information from the server.

  • self Skyway

    Skyway object.

_parseStreamSettings

(
  • options
)
private

Defined in source\skyway.js:4209

Available since 0.4.0

Parse stream settings

Parameters:

  • options JSON

    Optional. Media Constraints.

    • user JSON

      Optional. User custom data.

    • audio Boolean | JSON

      This call requires audio

      • stereo Boolean
        Enabled stereo or not
    • video Boolean | JSON

      This call requires video

      • resolution JSON
        [Rel: Skyway.VIDEO_RESOLUTION]
      • resolution.width Integer
        Video width
      • resolution.height Integer
        Video height
      • frameRate Integer
        Mininum frameRate of Video
    • bandwidth String

      Bandwidth settings

      • audio String
        Audio Bandwidth
      • video String
        Video Bandwidth
      • data String
        Data Bandwidth

_privateMessageHandler

(
  • message
)
private

Triggers:

privateMessage

Defined in source\skyway.js:2346

Available since 0.4.0

Signaling server sends a privateMessage message.

  • SIG_TYPE: PRIVATE_MESSAGE
  • This occurs when a peer sends private message to user.

Parameters:

  • message JSON

    The message object received.

    • data JSON | String

      The data received.

    • rid String

      RoomId of the connected room.

    • cid String

      CredentialId of the room.

    • mid String

      PeerId of the peer that is sending a private broadcast message.

    • isDataChannel Boolean

      Is the message sent from datachannel.

    • type String

      The type of message received.

_processingSingleMessage

(
  • message
)
private

Defined in source\skyway.js:2112

Available since 0.1.0

Handles the single signaling message received.

Parameters:

  • message JSON

    The message object received.

_processSigMessage

(
  • messageString
)
private

Defined in source\skyway.js:2090

Available since 0.1.0

Handles everu incoming signaling message received.

  • If it's a SIG_TYPE.GROUP message, break them down to single messages and let Skyway/_processSingleMessage:method to handle them.

Parameters:

  • messageString String

    The message object stringified received.

_publicMessageHandler

(
  • message
)
private

Triggers:

publicMessage

Defined in source\skyway.js:2374

Available since 0.4.0

Signaling server sends a publicMessage message.

  • SIG_TYPE: PUBLIC_MESSAGE
  • This occurs when a peer broadcasts a public message to all connected peers.

Parameters:

  • message JSON

    The message object received.

    • data JSON | String

      The data broadcasted

    • rid String

      RoomId of the connected room.

    • cid String

      CredentialId of the room.

    • mid String

      PeerId of the peer that is sending a private broadcast message.

    • isDataChannel Boolean

      Is the message sent from datachannel.

    • type String

      The type of message received.

_redirectHandler

(
  • message
)
private

Triggers:

systemAction

Defined in source\skyway.js:2205

Available since 0.1.0

Signaling server sends a redirect message.

  • SIG_TYPE: REDIRECT
  • This occurs when the signaling server is warning us or wanting to move us out when the peer sends too much messages at the same tme.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • url String

      Deprecated. Url to redirect user to.

    • info String

      The reason for this action.

    • action String

      The action to work on. [Rel: Skyway.SYSTEM_ACTION]

    • type String

      The type of message received.

_reinit

(
  • options
  • callback
)
private

Triggers:

readyStateChange

Defined in source\skyway.js:1246

Available since 0.4.0

Initialize Skyway to retrieve new connection information bbasd on options.

Parameters:

  • options String | JSON

    Connection options or API Key ID

    • apiKey String

      API Key ID to identify with the Temasys backend server

    • defaultRoom String

      Optional. The default room to connect to if there is no room provided in joinRoom().

    • roomServer String

      Optional. Path to the Temasys backend server. If there's no room provided, default room would be used.

    • region String

      Optional. The regional server that user chooses to use. [Rel: Skyway.REGIONAL_SERVER]

    • iceTrickle Boolean

      Optional. The option to enable ICE trickle or not.

      • Default is true.
    • dataChannel Boolean

      Optional. The option to enable datachannel or not.

      • Default is true.
    • credentials JSON

      Optional. Credentials options for setting a static meeting.

      • startDateTime String
        The start timing of the meeting in date ISO String
      • duration Integer
        The duration of the meeting
      • credentials String
        The credentials required to set the timing and duration of a meeting.
  • callback Function

    The callback fired once Skyway is re-initialized.

_removePeer

(
  • peerId
)
private

Triggers:

peerLeft

Defined in source\skyway.js:2685

Available since 0.1.0

Actually clean the peerconnection and trigger an event. Can be called by _byHandler and leaveRoom.

Parameters:

  • peerId String

    PeerId of the peer that has left.

_requestServerInfo

(
  • method
  • url
  • callback
  • params
)
private

Defined in source\skyway.js:877

Available since 0.2.0

Gets information from api server.

Parameters:

  • method String

    The http method.

  • url String

    The url to do a rest call.

  • callback Function

    The callback fired after Skyway receives a response from the api server.

  • params JSON

    HTTP Params

_roomLockEventHandler

(
  • message
)
private

Triggers:

roomLock

Defined in source\skyway.js:2253

Available since 0.2.0

Signaling server sends a roomLockEvent message.

  • SIG_TYPE: ROOM_LOCK
  • This occurs when a room lock status has changed.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the updated room lock status.

    • lock String

      If room is locked or not.

    • type String

      The type of message received.

_sendBlobDataToPeer

(
  • data
  • dataInfo
  • targetPeerId
)
private

Defined in source\skyway.js:3953

Available since 0.1.0

Sends blob data to individual peer.

  • This sends the Skyway/WRQ:event and to initiate the TFTP protocol.

Parameters:

  • data Blob

    The blob data to be sent over.

  • dataInfo JSON

    The data information.

    • transferId String

      TransferId of the data.

    • name String

      Data name.

    • timeout Integer

      Data timeout to wait for packets. [Default is 60].

    • size Integer

      Data size

  • targetPeerId String

    PeerId targeted to receive data. Leave blank to send to all peers.

_sendDataChannel

(
  • peerId
  • data
)
private

Defined in source\skyway.js:3406

Available since 0.1.0

Sends data to the datachannel.

Parameters:

  • peerId String

    PeerId of the peer's datachannel to send data.

  • data JSON

    The data to send.

_sendMessage

(
  • message
)
private

Defined in source\skyway.js:3265

Available since 0.1.0

Sends a message to the signaling server.

  • Not to be confused with method sendMessage() that broadcasts messages. This is for sending socket messages.

Parameters:

  • message JSON

_setDataChannelTimeout

(
  • peerId
  • timeout
  • isSender
  • self
)
private

Defined in source\skyway.js:3762

Available since 0.1.0

Sets the datachannel timeout.

  • If timeout is met, it will send the 'ERROR' message

Parameters:

  • peerId String

    PeerId of the datachannel to set timeout.

  • timeout Integer

    The timeout to set in seconds.

  • isSender Boolean

    Is peer the sender or the receiver?

  • self Skyway

    Skyway object.

_setFirefoxIceServers

(
  • config
)
JSON private

Defined in source\skyway.js:2991

Available since 0.1.0

Sets the STUN server specially for Firefox for ICE Connection.

Parameters:

  • config JSON

    Ice configuration servers url object.

Returns:

JSON:

Updated configuration

_setLocalAndSendMessage

(
  • targetMid
  • sessionDescription
)
private

Triggers:

handshakeProgress

Defined in source\skyway.js:2928

Available since 0.1.0

This takes an offer or an aswer generated locally and set it in the peerconnection it then sends it to the peer. Handshake step 3 (offer) or 4 (answer)

Parameters:

  • targetMid String

    PeerId of the peer to send offer/answer to.

  • sessionDescription JSON

    This should be provided by the peerconnection API. User might 'tamper' with it, but then , the setLocal may fail.

_setSDPBitrate

(
  • sdpLines
)
Array private

Defined in source\skyway.js:2897

Available since 0.2.0

Set Audio, Video and Data Bitrate in SDP

Parameters:

  • sdpLines Array

    Sdp received.

Returns:

Array:

Updated version with custom Bandwidth settings

_setStreams

(
  • options
)
Boolean private

Defined in source\skyway.js:3098

Available since 0.3.0

Opens or closes existing MediaStreams.

Parameters:

  • options JSON
    • audio JSON

      Enable audio or not

    • video JSON

      Enable video or not

Returns:

Boolean:

Whether we should re-fetch mediaStreams or not

_trigger

(
  • eventName
)
private

Defined in source\skyway.js:1084

Available since 0.1.0

Trigger all the callbacks associated with an event.

  • Note that extra arguments can be passed to the callback which extra argument can be expected by callback is documented by each event.

Parameters:

  • eventName String

    The Skyway event.

_updateUserEventHandler

(
  • message
)
private

Triggers:

peerUpdated

Defined in source\skyway.js:2228

Available since 0.2.0

Signaling server sends a updateUserEvent message.

  • SIG_TYPE: UPDATE_USER
  • This occurs when a peer's custom user data is updated.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the updated event.

    • userData String

      The peer's user data.

    • type String

      The type of message received.

_waitForMediaStream

(
  • callback
  • options
)
private

Defined in source\skyway.js:3028

Available since 0.4.0

Waits for MediaStream.

  • Once the stream is loaded, callback is called
  • If there's not a need for stream, callback is called

Parameters:

  • callback Function

    Callback after requested constraints are loaded.

  • options JSON

    Optional. Media Constraints.

    • user JSON

      Optional. User custom data.

    • audio Boolean | JSON

      This call requires audio

      • stereo Boolean
        Enabled stereo or not
    • video Boolean | JSON

      This call requires video

      • resolution JSON
        [Rel: Skyway.VIDEO_RESOLUTION]
      • resolution.width Integer
        Video width
      • resolution.height Integer
        Video height
      • frameRate Integer
        Mininum frameRate of Video
    • bandwidth String

      Bandwidth settings

      • audio String
        Audio Bandwidth
      • video String
        Video Bandwidth
      • data String
        Data Bandwidth

_welcomeHandler

(
  • message
)
private

Triggers:

handshakeProgress, peerJoined

Defined in source\skyway.js:2512

Available since 0.1.0

Signaling server sends a welcome message.

  • SIG_TYPE: WELCOME
  • This occurs when we've just received a welcome.
  • If there is no existing connection with this peer, create one, then set the remotedescription and answer.

Parameters:

  • message JSON

    The message object received.

    • rid String

      RoomId of the connected room.

    • mid String

      PeerId of the peer that is sending the welcome shake.

    • receiveOnly Boolean

      Peer to receive only

    • enableIceTrickle Boolean

      Option to enable Ice trickle or not

    • enableDataChannel Boolean

      Option to enable DataChannel or not

    • userInfo JSON

      Peer Skyway._user.info data.

      • settings JSON
        Peer stream settings
      • settings.audio Boolean | JSON
      • settings.audio.stereo Boolean
      • settings.video Boolean | JSON
      • settings.video.resolution JSON
        [Rel: Skyway.VIDEO_RESOLUTION]
      • settings.video.resolution.width Integer
      • settings.video.resolution.height Integer
      • settings.video.frameRate Integer
      • mediaStatus JSON
        Peer stream status.
      • mediaStatus.audioMuted Boolean
        If Peer's Audio stream is muted.
      • mediaStatus.videoMuted Boolean
        If Peer's Video stream is muted.
      • userData String | JSON
        Peer custom data
    • agent String

      Browser agent

    • type String

      The type of message received.

disableAudio

()

Triggers:

peerUpdated

Defined in source\skyway.js:4165

Available since 0.4.0

Disable microphone.

  • If microphone is not enabled from the beginning, there is no effect.

Example:

                

SkywayDemo.disableAudio();

disableVideo

()

Triggers:

peerUpdated

Defined in source\skyway.js:4193

Available since 0.4.0

Disable webcam video.

  • If webcam is not enabled from the beginning, there is no effect.
  • Note that in a Chrome-to-chrome session, each party's peer audio may appear muted in when the audio is muted.
  • You may follow up the bug on here.

Example:

                

SkywayDemo.disableVideo();

enableAudio

()

Triggers:

peerUpdated

Defined in source\skyway.js:4150

Available since 0.4.0

Enable microphone.

  • If microphone is not enabled from the beginning, user would have to reinitate the joinRoom() process and ask for microphone again.

Example:

                

SkywayDemo.enableAudio();

enableVideo

()

Triggers:

peerUpdated

Defined in source\skyway.js:4178

Available since 0.4.0

Enable webcam video.

  • If webcam is not enabled from the beginning, user would have to reinitate the joinRoom() process and ask for webcam again.

Example:

                

SkywayDemo.enableVideo();

getPeerInfo

(
  • peerId
)
JSON

Defined in source\skyway.js:1455

Available since 0.4.0

Gets the peer information.

  • If input peerId is user's id or empty, getPeerInfo() would return user's peer information.

Parameters:

  • peerId String

    PeerId of the peer information to retrieve.

Returns:

JSON:

Peer information.

Example:

                

// Example 1: To get other peer's information var peerInfo = SkywayDemo.getPeerInfo(peerId);

// Example 2: To get own information var userInfo = SkywayDemo.getPeerInfo();

getUserData

() JSON | String

Defined in source\skyway.js:1441

Available since 0.4.0

Gets the user custom data.

Returns:

JSON | String:

User custom data.

Example:

                

var userInfo = SkywayDemo.getUserData();

getUserMedia

(
  • options
)

Triggers:

mediaAccessSuccess, mediaAccessError

Defined in source\skyway.js:1937

Available since 0.4.1

Gets the default webcam and microphone.

  • Please do not be confused with the MediaStreamConstraints specified in the original w3c specs.
  • This is an implemented function for Skyway.

Parameters:

  • options JSON

    Optional. MediaStream constraints.

    • audio JSON | Boolean

      Option to allow audio stream.

      • stereo Boolean
        Option to enable stereo during call.
    • video JSON | Boolean

      Option to allow video stream.

      • resolution JSON
        The resolution of video stream. - Check out VIDEO_RESOLUTION.
      • resolution.width Integer
        The video stream resolution width.
      • resolution.height Integer
        The video stream resolution height.
      • frameRate Integer
        The video stream mininum frameRate.

Example:

                

// Default is to get both audio and video // Example 1: Get both audio and video by default. SkywayDemo.getUserMedia();

// Example 2: Get the audio stream only SkywayDemo.getUserMedia({ 'video' : false, 'audio' : true });

// Example 3: Set the stream settings for the audio and video SkywayDemo.getUserMedia({ 'video' : { 'resolution': SkywayDemo.VIDEO_RESOLUTION.HD, 'frameRate': 50 }, 'audio' : { 'stereo': true } });

init

(
  • options
)

Triggers:

readyStateChange

Defined in source\skyway.js:1113

Available since 0.3.0

Intiailize Skyway to retrieve connection information.

  • IMPORTANT: Please call this method to load all server information before joining the room or doing anything else.
  • If you would like to set the start time and duration of the room, you have to generate the credentials. In example 3, we use the CryptoJS library.
    • Step 1: Generate the hash. It is created by using the roomname, duration and the timestamp (in ISO String format).
    • Step 2: Generate the Credentials. It is is generated by converting the hash to a Base64 string and then encoding it to a URI string.
    • Step 3: Initialize Skyway

Parameters:

  • options String | JSON

    Connection options or API Key ID

    • apiKey String

      API Key ID to identify with the Temasys backend server

    • defaultRoom String

      Optional. The default room to connect to if there is no room provided in joinRoom().

    • roomServer String

      Optional. Path to the Temasys backend server. If there's no room provided, default room would be used.

    • region String

      Optional. The regional server that user chooses to use. [Rel: Skyway.REGIONAL_SERVER]

    • iceTrickle Boolean

      Optional. The option to enable ICE trickle or not.

      • Default is true.
    • dataChannel Boolean

      Optional. The option to enable datachannel or not.

      • Default is true.
    • credentials JSON

      Optional. Credentials options for setting a static meeting.

      • startDateTime String
        The start timing of the meeting in Date ISO String
      • duration Integer
        The duration of the meeting
      • credentials String
        The credentials required to set the timing and duration of a meeting.

Example:

                

// Note: Default room is apiKey when no room // Example 1: To initalize without setting any default room. SkywayDemo.init('apiKey');

// Example 2: To initialize with apikey, roomServer and defaultRoom SkywayDemo.init({ 'apiKey' : 'apiKey', 'roomServer' : 'http://xxxx.com', 'defaultRoom' : 'mainHangout' });

// Example 3: To initialize with credentials to set startDateTime and // duration of the room var hash = CryptoJS.HmacSHA1(roomname + '' + duration + '' + (new Date()).toISOString(), token); var credentials = encodeURIComponent(hash.toString(CryptoJS.enc.Base64)); SkywayDemo.init({ 'apiKey' : 'apiKey', 'roomServer' : 'http://xxxx.com', 'defaultRoom' : 'mainHangout' 'credentials' : { 'startDateTime' : (new Date()).toISOString(), 'duration' : 500, 'credentials' : credentials } });

isRoomLocked

()

Defined in source\skyway.js:4128

Available since 0.4.0

Get the lock status of the room.

  • WARNING: If there's too many peers toggling the room lock feature at the same time, the returned results may not be completely correct since while retrieving the room lock status, another peer may be toggling it.

Example:

                

if(SkywayDemo.isRoomLocked()) { SkywayDemo.unlockRoom(); } else { SkywayDemo.lockRoom(); }

joinRoom

(
  • room
  • options
)

Triggers:

peerJoined

Defined in source\skyway.js:4298

Available since 0.2.0

User to join the room.

  • You may call getUserMedia() first if you want to get MediaStream and joining Room seperately.
  • If joinRoom() parameters is empty, it simply uses any previous media or user data settings.
  • If no room is specified, user would be joining the default room.

Parameters:

  • room String

    Optional. Room to join user in.

  • options JSON

    Optional. Media Constraints.

    • user JSON | String

      Optional. User custom data.

    • audio Boolean | JSON

      This call requires audio stream.

      • stereo Boolean
        Option to enable stereo during call.
    • video Boolean | JSON

      This call requires video stream.

      • resolution JSON
        The resolution of video stream. [Rel: Skyway.VIDEO_RESOLUTION]
      • resolution.width Integer
        The video stream resolution width.
      • resolution.height Integer
        The video stream resolution height.
      • frameRate Integer
        The video stream mininum frameRate.
    • bandwidth JSON

      Stream bandwidth settings.

      • audio Integer
        Audio stream bandwidth in kbps. - Recommended: 50 kbps.
      • video Integer
        Video stream bandwidth in kbps. - Recommended: 256 kbps.
      • data Integer
        Data stream bandwidth in kbps. - Recommended: 1638400 kbps.

Example:

                

// To just join the default room without any video or audio // Note that calling joinRoom without any parameters // Still sends any available existing MediaStreams allowed. // See Examples 2, 3, 4 and 5 etc to prevent video or audio stream SkywayDemo.joinRoom();

// To just join the default room with bandwidth settings SkywayDemo.joinRoom({ 'bandwidth': { 'data': 14440 } });

// Example 1: To call getUserMedia and joinRoom seperately SkywayDemo.getUserMedia(); SkywayDemo.on('mediaAccessSuccess', function (stream)) { attachMediaStream($('.localVideo')[0], stream); SkywayDemo.joinRoom(); });

// Example 2: Join a room without any video or audio SkywayDemo.joinRoom('room');

// Example 3: Join a room with audio only SkywayDemo.joinRoom('room', { 'audio' : true, 'video' : false });

// Example 4: Join a room with prefixed video width and height settings SkywayDemo.joinRoom('room', { 'audio' : true, 'video' : { 'resolution' : { 'width' : 640, 'height' : 320 } } });

// Example 5: Join a room with userData and settings with audio, video // and bandwidth SkwayDemo.joinRoom({ 'user': { 'item1': 'My custom data', 'item2': 'Put whatever, string or JSON or array' }, 'audio' : { 'stereo' : true }, 'video' : { 'res' : SkywayDemo.VIDEO_RESOLUTION.VGA, 'frameRate' : 50 }, 'bandwidth' : { 'audio' : 48, 'video' : 256, 'data' : 14480 } });

leaveRoom

()

Triggers:

peerLeft, channelClose

Defined in source\skyway.js:4439

Available since 0.1.0

User to leave the room.

Example:

                

SkywayDemo.leaveRoom();

lockRoom

()

Triggers:

lockRoom

Defined in source\skyway.js:4104

Available since 0.2.0

Lock the room to prevent peers from joining the room.

Example:

                

SkywayDemo.lockRoom();

off

(
  • eventName
  • callback
)

Defined in source\skyway.js:1060

Available since 0.1.0

To unregister a callback function from an event.

Parameters:

  • eventName String

    The Skyway event.

  • callback Function

    The callback fired after the event is triggered.

Example:

                

SkywayDemo.off('peerJoined', callback);

on

(
  • eventName
  • callback
)

Defined in source\skyway.js:1040

Available since 0.1.0

To register a callback function to an event.

Parameters:

  • eventName String

    The Skyway event.

  • callback Function

    The callback fired after the event is triggered.

Example:

                

SkywayDemo.on('peerJoined', function (peerId, peerInfo) { console.info(peerId + ' has joined the room'); console.log('Peer information are:'); console.info(peerInfo); });

respondBlobRequest

(
  • peerId
  • accept
)

Triggers:

dataTransferState

Defined in source\skyway.js:3534

Available since 0.4.0

User's response to accept or reject data transfer request.

Parameters:

  • peerId String

    PeerId of the peer that is expected to receive the request response.

  • accept Boolean

    The response of the user to accept the data transfer or not.

sendBlobData

(
  • data
  • dataInfo
  • targetPeerId
)

Triggers:

dataTransferState

Defined in source\skyway.js:3869

Available since 0.4.1

Start a data transfer with peer(s).

  • Note that peers have the option to download or reject receiving the blob data.
  • This method is ideal for sending files.
  • To send a private file to a peer, input the peerId after the data information.

Parameters:

  • data Object

    The data to be sent over. Data has to be a blob.

  • dataInfo JSON

    The data information.

    • transferId String

      transferId of the data.

    • name String

      Data name.

    • timeout Integer

      The timeout to wait for packets. [Default is 60].

    • size Integer

      The data size

  • targetPeerId String

    PeerId targeted to receive data. Leave blank to send to all peers.

Example:

                

// Send file to all peers connected SkywayDemo.sendBlobData(file, { 'name' : file.name, 'size' : file.size, 'timeout' : 67 });

// Send file to individual peer SkywayDemo.sendBlobData(blob, { 'name' : 'My Html', 'size' : blob.size, 'timeout' : 87 }, targetPeerId);

sendMessage

(
  • message
  • targetPeerId
)

Triggers:

incomingMessage

Defined in source\skyway.js:1855

Available since 0.4.0

Broadcast a message to all peers.

  • WARNING: Map arrays data would be lost when stringified in JSON, so refrain from using map arrays.

Parameters:

  • message String | JSON

    The message data to send.

  • targetPeerId String

    PeerId of the peer to send a private message data to.

Example:

                

// Example 1: Send to all peers SkywayDemo.sendMessage('Hi there!');

// Example 2: Send to a targeted peer SkywayDemo.sendMessage('Hi there peer!', targetPeerId);

sendP2PMessage

(
  • message
  • targetPeerId
)

Triggers:

incomingMessage

Defined in source\skyway.js:1894

Available since 0.4.0

Broadcasts to all P2P datachannel messages and sends to a peer only when targetPeerId is provided.

  • This is ideal for sending strings or json objects lesser than 16KB as noted in here.
  • For huge data, please check out function sendBlobData().
  • WARNING: Map arrays data would be lost when stringified in JSON, so refrain from using map arrays.

Parameters:

  • message String | JSON

    The message data to send.

  • targetPeerId String

    Optional. Provide if you want to send to only one peer

Example:

                

// Example 1: Send to all peers SkywayDemo.sendP2PMessage('Hi there! This is from a DataChannel!');

// Example 2: Send to specific peer SkywayDemo.sendP2PMessage('Hi there peer! This is from a DataChannel!', targetPeerId);

setUserData

(
  • userData
)

Triggers:

peerUpdated

Defined in source\skyway.js:1386

Available since 0.4.1

Updates the user custom data.

  • Please note that the custom data would be overrided so please call getUserData() and then modify the information you want individually.
  • peerUpdated only fires after setUserData() is fired. after the user joins the room.

Parameters:

  • userData JSON | String

    User custom data.

Example:

                

// Example 1: Intial way of setting data before user joins the room SkywayDemo.setUserData({ displayName: 'Bobby Rays', fbUserId: 'blah' });

// Example 2: Way of setting data after user joins the room var userData = SkywayDemo.getUserData(); userData.userData.displayName = 'New Name'; userData.userData.fbUserId = 'another Id'; SkywayDemo.setUserData(userData);

unlockRoom

()

Triggers:

lockRoom

Defined in source\skyway.js:4116

Available since 0.2.0

Unlock the room to allow peers to join the room.

Example:

                

SkywayDemo.unlockRoom();

Attributes

_apiKey

String private

Defined in source\skyway.js:556

Available since 0.3.0

The API Key ID.

_channel_open

Boolean private required

Defined in source\skyway.js:793

Available since 0.1.0

The current socket opened state.

_chunkFileSize

Integer private final required

Defined in source\skyway.js:820

Available since 0.1.0

The fixed size for each data chunk.

_dataChannels

Object private required

Defined in source\skyway.js:729

Available since 0.2.0

Internal array of datachannels.

_dataTransfersTimeout

Array private required

Defined in source\skyway.js:774

Available since 0.4.1

Internal array of data transfers timeout.

_defaultRoom

String private

Defined in source\skyway.js:564

Available since 0.3.0

The default room that the user connects to if no room is provided in joinRoom().

_downloadDataSessions

Array private required

Defined in source\skyway.js:765

Available since 0.4.1

Internal array of data download sessions.

_downloadDataTransfers

Array private required

Defined in source\skyway.js:756

Available since 0.4.1

Internal array of data download transfers.

_enableDataChannel

Boolean private required

Defined in source\skyway.js:851

Available since 0.3.0

The current state if datachannel is enabled.

Default: true

_enableIceTrickle

Boolean private required

Defined in source\skyway.js:841

Available since 0.3.0

The current state if ICE trickle is enabled.

Default: true

_in_room

Boolean private required

Defined in source\skyway.js:811

Available since 0.1.0

The current state if user is in the room.

_key

String private

Defined in source\skyway.js:611

Available since 0.1.0

The received server key.

_mozChunkFileSize

Integer private final required

Defined in source\skyway.js:830

Available since 0.2.0

The fixed for each data chunk for firefox implementation.

  • Firefox the sender chunks 49152 but receives as 16384.

_path

String private final required

Defined in source\skyway.js:514

Available since 0.1.0

The path that user is currently connect to.

  • NOTE ALEX: check if last char is '/'

Default: _serverPath

_peerConnections

Object private required

Defined in source\skyway.js:711

Available since 0.1.0

Internal array of peer connections.

_peerInformations

Object private required

Defined in source\skyway.js:720

Available since 0.3.0

Internal array of peer informations.

_readyState

Integer private required

Defined in source\skyway.js:783

Available since 0.1.0

The current Skyway ready state change. [Rel: Skyway.READY_STATE_CHANGE]

_room

JSON private required

Defined in source\skyway.js:671

Available since 0.3.0

The room connection information.

Keys:

  • room JSON

    Room information and credentials.

    • id String

      RoomId of the room user is connected to.

    • token String

      Token of the room user is connected to.

    • tokenTimestamp String

      Token timestamp of the room user is connected to.

    • signalingServer JSON

      The signaling server settings the room has to connect to.

      • protocol String
        The protocol the room has to use.
      • ip String
        The ip address of the signaling server the room has to connect to.
      • port String
        The port that the room & has to connec to.
    • pcHelper JSON

      Holder for all the constraints objects used in a peerconnection lifetime. Some are initialized by default, some are initialized by internal methods, all can be overriden through updateUser. Future APIs will help user modifying specific parts (audio only, video only, ...) separately without knowing the intricacies of constraints.

      • pcConstraints JSON
        The peer connection constraints object.
      • pcConfig JSON
        Will be provided upon connection to a room
      • pcConfig.mandatory JSON
        Mandantory options.
      • pcConfig.optional Array
        Optional options. - Ex: [{DtlsSrtpKeyAgreement: true}]
      • offerConstraints JSON
        The offer constraints object.
      • offerConstraints.mandatory JSON
        Offer mandantory object. - Ex: {MozDontOfferDataChannel:true}
      • offerConstraints.optional Array
        Offer optional object.
      • sdpConstraints JSON
        Sdp constraints object
      • sdpConstraints.mandatory JSON
        Sdp mandantory object. - Ex: { 'OfferToReceiveAudio':true, 'OfferToReceiveVideo':true }
      • sdpConstraints.optional Array
        Sdp optional object.

_room_lock

Boolean private required

Defined in source\skyway.js:802

Available since 0.4.0

The current state if room is locked.

_roomCredentials

String private optional

Defined in source\skyway.js:601

Available since 0.3.0

The credentials required to set the start date and time and the duration.

_roomDuration

Integer private optional

Defined in source\skyway.js:592

Available since 0.3.0

The static room's meeting duration.

_roomServer

String private

Defined in source\skyway.js:544

Available since 0.3.0

The server that user connects to to make api calls to.

  • The reason why users can input this value is to give users the chance to connect to any of our beta servers if available instead of the stable version.

_roomStart

String private optional

Defined in source\skyway.js:582

Available since 0.3.0

The static room's meeting starting date and time.

  • The value is in ISO formatted string.

_selectedRoom

String private

Defined in source\skyway.js:573

Available since 0.3.0

The room that the user is currently connected to.

Default: _defaultRoom

_serverPath

String private final required

Defined in source\skyway.js:526

Available since 0.2.0

The path that Skyway makes rest api calls to.

_serverRegion

String private

Defined in source\skyway.js:536

Available since 0.5.0

The regional server that Skyway connects to.

_socket

Object private required

Defined in source\skyway.js:619

Available since 0.1.0

The actual socket object that handles the connection.

_socketVersion

Float private

Defined in source\skyway.js:628

Available since 0.1.0

The version of the _socket object.

_streamSettings

JSON private

Defined in source\skyway.js:861

Available since 0.2.0

The user stream settings.

  • By default, all is false.

Default: { 'audio' : false, 'video' : false }

_uploadDataSessions

Array private required

Defined in source\skyway.js:747

Available since 0.4.1

Internal array of data upload sessions.

_uploadDataTransfers

Array private required

Defined in source\skyway.js:738

Available since 0.4.1

Internal array of data upload transfers.

_user

JSON private required

Defined in source\skyway.js:638

Available since 0.3.0

User information, credential and the local stream(s).

Keys:

  • id String

    User's session id.

  • sid String

    User's secret id. This is the id used as the peerId.

  • apiOwner String

    Owner of the room.

  • streams Array

    The array of user's MediaStream(s).

  • timestamp String

    User's timestamp.

  • token String

    User access token.

  • info JSON

    Optional. User information object.

    • settings JSON

      User stream settings.

      • audio Boolean | JSON
        User audio settings.
      • audio.stereo Boolean
        User has enabled stereo or not.
      • video Boolean | JSON
        User video settings.
      • video.resolution Bolean | JSON
        User video resolution set. [Rel: Skyway.VIDEO_RESOLUTION]
      • video.resolution.width Integer
        User video resolution width.
      • video.resolution.height Integer
        User video resolution height.
      • video.frameRate Integer
        User video minimum frame rate.
    • mediaStatus JSON

      User MediaStream(s) status.

      • audioMuted Boolean
        Is user's audio muted.
      • videoMuted Boolean
        Is user's vide muted.
    • userData String | JSON

      User's custom data set.

CANDIDATE_GENERATION_STATE

JSON readonly

Defined in source\skyway.js:127

Available since 0.4.1

The list of ICE candidate generation states.

Keys:

  • NEW String

    The object was just created, and no networking has occurred yet.

  • GATHERING String

    The ICE engine is in the process of gathering candidates for this RTCPeerConnection.

  • COMPLETED String

    The ICE engine has completed gathering. Events such as adding a new interface or a new TURN server will cause the state to go back to gathering.

DATA_CHANNEL_STATE

JSON readonly

Defined in source\skyway.js:171

Available since 0.1.0

The list of datachannel states.

  • Check out the w3 specification documentation.
  • This is the RTCDataChannelState of the peer.
  • ERROR is an additional implemented state by Skyway for further error tracking.
  • The states that would occur are:

Keys:

  • CONNECTING String

    The user agent is attempting to establish the underlying data transport. This is the initial state of a RTCDataChannel object created with createDataChannel().

  • OPEN String

    The underlying data transport is established and communication is possible. This is the initial state of a RTCDataChannel object dispatched as a part of a RTCDataChannelEvent.

  • CLOSING String

    The procedure to close down the underlying data transport has started.

  • CLOSED String

    The underlying data transport has been closed or could not be established.

  • ERROR String

    Datachannel has occurred an error.

DATA_TRANSFER_DATA_TYPE

JSON readonly

Defined in source\skyway.js:351

Available since 0.1.0

The list of data transfer data types.

  • TODO: ArrayBuffer and Blob data transfer in datachannel.
  • The available data transfer data types are:

Keys:

  • BINARY_STRING String

    BinaryString data type.

  • ARRAY_BUFFER String

    Still-implementing. ArrayBuffer data type.

  • BLOB String

    Still-implementing. Blob data type.

DATA_TRANSFER_STATE

JSON readonly

Defined in source\skyway.js:319

Available since 0.4.0

The list of datachannel transfer state.

  • These are the states to inform the state of the data transfer.
  • The list of states would occur are:

Keys:

  • UPLOAD_REQUEST String

    Peer has a data transfer request.

  • UPLOAD_STARTED String

    Data transfer of upload has just started.

  • DOWNLOAD_STARTED String

    Data transfer of download has just started.

  • UPLOADING String

    Data upload transfer is occurring.

  • DOWNLOADING String

    Data download transfer is occurring.

  • UPLOAD_COMPLETED String

    Data upload transfer has been completed.

  • DOWNLOAD_COMPLETED String

    Data download transfer has been completed.

  • REJECTED String

    Peer rejected user's data transfer request.

  • ERROR String

    Data transfer had an error occurred when uploading or downloading file.

DATA_TRANSFER_TYPE

JSON readonly

Defined in source\skyway.js:303

Available since 0.1.0

The list of datachannel transfer types.

  • This is used to identify if the stream is an upload stream or a download stream.
  • The available types are:

Keys:

  • UPLOAD String

    The datachannel transfer is an upload stream.

  • DOWNLOAD String

    The datachannel transfer is a download stream.

HANDSHAKE_PROGRESS

JSON readonly

Defined in source\skyway.js:150

Available since 0.1.0

The list of handshake progress steps.

  • This are the list of steps for the Skyway peer connection.
  • The steps that would occur are:

Keys:

  • ENTER String

    Step 1. Received "enter" from peer.

  • WELCOME String

    Step 2. Received "welcome" from peer.

  • OFFER String

    Step 3. Received "offer" from peer.

  • ANSWER String

    Step 4. Received "answer" from peer.

  • ERROR String

    Error state.

ICE_CONNECTION_STATE

JSON readonly

Defined in source\skyway.js:52

Available since 0.1.0

The list of ICE connection states.

Keys:

  • STARTING String

    The ICE agent is gathering addresses and/or waiting for remote candidates to be supplied.

  • CHECKING String

    The ICE agent has received remote candidates on at least one component, and is checking candidate pairs but has not yet found a connection. In addition to checking, it may also still be gathering.

  • CONNECTED String

    The ICE agent has found a usable connection for all components but is still checking other candidate pairs to see if there is a better connection. It may also still be gathering.

  • COMPLETED String

    The ICE agent has finished gathering and checking and found a connection for all components.

  • FAILED String

    The ICE agent is finished checking all candidate pairs and failed to find a connection for at least one component.

  • DISCONNECTED String

    Liveness checks have failed for one or more components. This is more aggressive than "failed", and may trigger intermittently (and resolve itself without action) on a flaky network.

  • CLOSED String

    The ICE agent has shut down and is no longer responding to STUN requests.

LOCK_ACTION

JSON readonly

Defined in source\skyway.js:456

Available since 0.2.0

The list of actions for room lock application.

  • This are the list of actions available for locking a room.
  • The available actions are:

Keys:

  • LOCK String

    Lock the room

  • UNLOCK String

    Unlock the room

  • STATUS String

    Get the status to check the room is locked or not.

PEER_CONNECTION_STATE

JSON readonly

Defined in source\skyway.js:92

Available since 0.1.0

The list of peer connection states.

Keys:

  • STABLE String

    There is no offer/answer exchange in progress. This is also the initial state in which case the local and remote descriptions are empty.

  • HAVE_LOCAL_OFFER String

    A local description, of type "offer", has been successfully applied.

  • HAVE_REMOTE_OFFER String

    A remote description, of type "offer", has been successfully applied.

  • HAVE_LOCAL_PRANSWER String

    A remote description of type "offer" has been successfully applied and a local description of type "pranswer" has been successfully applied.

  • HAVE_REMOTE_PRANSWER String

    "Answer" remote description is applied.

  • ESTABLISHED String

    A local description of type "offer" has been successfully applied and a remote description of type "pranswer" has been successfully applied.

  • CLOSED String

    The connection is closed.

READY_STATE_CHANGE

JSON readonly

Defined in source\skyway.js:219

Available since 0.1.0

The list of api server data retrieval state.

  • These are the states to inform the state of retrieving the information from the api server required to start the peer connection or if the browser is eligible to start the peer connection.
  • This is the first event that would fired, because Skyway would retrieve information from the api server that is required to start the connection.
  • Once the state is COMPLETED, Skyway is ready to start the call.
  • The states that would occur are:

Keys:

  • INIT Integer

    Skyway has just started. No information are retrieved yet.

  • LOADING Integer

    Skyway is starting the retrieval of the connection information.

  • COMPLETED Integer

    Skyway has completed retrieving the connection.

  • ERROR Integer

    Skyway has occurred an error when retrieving the connection information.

READY_STATE_CHANGE_ERROR

JSON readonly

Defined in source\skyway.js:247

Available since 0.4.0

The list of ready state change errors.

  • These are the error states from the error object error code.
  • The states that would occur are:

Keys:

  • API_INVALID Integer

    Api Key provided does not exist.

  • API_DOMAIN_NOT_MATCH Integer

    Api Key used in domain does not match.

  • API_CORS_DOMAIN_NOT_MATCH Integer

    Api Key used in CORS domain does not match.

  • API_CREDENTIALS_INVALID Integer

    Api Key credentials does not exist.

  • API_CREDENTIALS_NOT_MATCH Integer

    Api Key credentials does not match what is expected.

  • API_INVALID_PARENT_KEY Integer

    Api Key does not have a parent key nor is a root key.

  • API_NOT_ENOUGH_CREDIT Integer

    Api Key does not have enough credits to use.

  • API_NOT_ENOUGH_PREPAID_CREDIT Integer

    Api Key does not have enough prepaid credits to use.

  • API_FAILED_FINDING_PREPAID_CREDIT Integer

    Api Key preapid payments does not exist.

  • API_NO_MEETING_RECORD_FOUND Integer

    Api Key does not have a meeting record at this timing. This occurs when Api Key is a static one.

  • ROOM_LOCKED Integer

    Room is locked.

  • NO_SOCKET_IO Integer

    No socket.io dependency is loaded to use.

  • NO_XMLHTTPREQUEST_SUPPORT Integer

    Browser does not support XMLHttpRequest to use.

  • NO_WEBRTC_SUPPORT Integer

    Browser does not have WebRTC support.

  • NO_PATH Integer

    No path is loaded yet.

  • INVALID_XMLHTTPREQUEST_STATUS Integer

    Invalid XMLHttpRequest when retrieving information.

REGIONAL_SERVER

JSON readonly

Defined in source\skyway.js:32

Available since 0.5.0

The list of available regional servers.

  • This is for developers to set the nearest region server for Skyway to connect to for faster connectivity.
  • The available regional servers are:

Keys:

  • US1 String

    USA server 1.

  • US2 String

    USA server 2.

  • SG String

    Singapore server.

  • EU String

    Europe server.

SIG_TYPE

JSON private readonly

Defined in source\skyway.js:369

Available since 0.3.0

The list of signaling message types.

  • These are the list of available signaling message types expected to be received.
  • These message types are fixed.
  • The available message types are:

Keys:

  • JOIN_ROOM - String

    Send: User request to join the room.

  • IN_ROOM - String

    Received: Response from server that user has joined the room.

  • ENTER - String

    Send: Broadcast message to inform other connected peers in the room that the user is the new peer joining the room.

    • Received: A peer has just joined the room. To send a welcome message.
  • WELCOME - String

    Send: Respond to user to request peer to create the offer.

    • Received: Response from peer that peer acknowledges the user has joined the room. To send and create an offer message.
  • OFFER - String

    Send: Respond to peer's request to create an offer.

    • Received: Response from peer's offer message. User to create and send an answer message.
  • ANSWER - String

    Send: Response to peer's offer message.

    • Received: Response from peer's answer message. Connection is established.
  • CANDIDATE - String

    Send: User to send the ICE candidate after onicecandidate is called.

    • Received: User to add peer's ice candidate in addIceCandidate.
  • BYE - String

    Received: Peer has left the room.

  • CHAT - String

    Send: Deprecated. User sends a chat message.

    • Received: Deprecated. Peer sends a chat message to user.
  • REDIRECT - String

    Received: Server warning to user.

  • ERROR - String

    Received: Deprecated. Server error occurred.

  • UPDATE_USER - String

    Send: User's custom data is updated and to inform other peers of updated custom data.

    • Received: Peer's user custom data has changed.
  • ROOM_LOCK - String

    Send: Room lock action has changed and to inform other peers of updated room lock status.

    • Received: Room lock status has changed.
  • MUTE_VIDEO - String

    Send: User has muted video and to inform other peers of updated muted video stream status.

    • Received: Peer muted video status has changed.
  • MUTE_AUDIO - String

    Send: User has muted audio and to inform other peers of updated muted audio stream status.

    • Received: Peer muted audio status has changed.
  • PUBLIC_MESSAGE - String

    Send: User sends a broadcast message to all peers.

    • Received: User receives a peer's broadcast message.
  • PRIVATE_MESSAGE - String

    Send: User sends a private message to a peer.

    • Received: User receives a private message from a peer.

SYSTEM_ACTION

JSON readonly

Defined in source\skyway.js:202

Available since 0.1.0

The list of signaling actions received.

  • These are usually received from the signaling server to warn the user.
  • The system action outcomes are:

Keys:

  • WARNING String

    Server is warning user that the room is closing.

  • REJECT String

    Server has rejected user from room.

  • CLOSED String

    Server has closed the room.

VERSION

String readonly

Defined in source\skyway.js:24

Available since 0.1.0

Version of Skyway

VIDEO_RESOLUTION

JSON readonly

Defined in source\skyway.js:474

Available since 0.2.0

The list of recommended video resolutions.

  • Note that the higher the resolution, the connectivity speed might be affected.
  • The available video resolutions type are:

Keys:

  • QVGA JSON

    QVGA video resolution.

    • width Integer

      320

    • height Integer

      180

  • VGA JSON

    VGA video resolution.

    • width Integer

      640

    • height Integer

      360

  • HD JSON

    HD video quality

    • width Integer

      1280

    • height Integer

      720

  • FHD JSON

    Might not be supported. Full HD video resolution.

    • width Integer

      1920

    • height Integer

      1080

Events

candidateGenerationState

Defined in source\skyway.js:1530

Available since 0.1.0

Event fired when an ICE gathering state has changed.

Event Payload:

  • state String

    The ice candidate generation state. [Rel: Skyway.CANDIDATE_GENERATION_STATE]

  • peerId String

    PeerId of the peer that had an ice candidate generation state change.

channelClose

Defined in source\skyway.js:1485

Available since 0.1.0

Event fired when the socket connection to the signaling server has closed.

channelError

Defined in source\skyway.js:1500

Available since 0.1.0

Event fired when the socket connection has occurred an error.

Event Payload:

  • error Object | String

    Error message or object thrown.

channelMessage

Defined in source\skyway.js:1492

Available since 0.1.0

Event fired when the socket connection received a message from the signaling server.

Event Payload:

  • message JSON

channelOpen

Defined in source\skyway.js:1478

Available since 0.1.0

Event fired when the socket connection to the signaling server is open.

Datachannel: ACK

private

Defined in source\skyway.js:1820

Available since 0.4.0

Fired when a datachannel has a blob data send request acknowledgement.

  • 0: User accepts the request.
  • -1: User rejects the request.
  • Above 0: User acknowledges the blob data packet.

Event Payload:

  • ackN Integer

    The acknowledge number.

  • userAgent Integer

    The user's browser agent.

Datachannel: CHAT

private

Defined in source\skyway.js:1841

Available since 0.4.0

Fired when a datachannel chat has been received.

Event Payload:

  • type String

    If the message is a private or group message.

    • PRIVATE: This message is a private message targeted to a peer.
    • GROUP: This message is to be sent to all peers.
  • peerId String

    PeerId of the sender.

  • message JSON | String

    The message data or object.

Datachannel: ERROR

private

Defined in source\skyway.js:1832

Available since 0.4.0

Fired when a datachannel transfer has an error occurred.

Event Payload:

  • message String

    The error message.

  • isSender Boolean

    If user's the uploader.

Datachannel: WRQ

private

Defined in source\skyway.js:1808

Available since 0.4.0

Fired when a datachannel has a blob data send request.

Event Payload:

  • userAgent String

    The user's browser agent.

  • name String

    The blob data name.

  • size Integer

    The blob data size.

  • chunkSize Integer

    The expected chunk size.

  • timeout Integer

    The timeout in seconds.

dataChannelState

Defined in source\skyway.js:1760

Available since 0.1.0

Event fired when a peer's datachannel state has changed.

Event Payload:

  • state String

    The datachannel state. [Rel: Skyway.DATA_CHANNEL_STATE]

  • peerId String

    PeerId of peer that has a datachannel state change.

dataTransferState

Defined in source\skyway.js:1770

Available since 0.4.1

Event fired when a data transfer state has changed.

  • Note that transferInfo.data sends the blob data, and no longer a blob url.

Event Payload:

  • state String

    The data transfer state. [Rel: Skyway.DATA_TRANSFER_STATE]

  • transferId String

    TransferId of the data.

  • peerId String

    PeerId of the peer that has a data transfer state change.

  • transferInfo JSON

    Data transfer information.

    • percentage JSON

      The percetange of data being uploaded / downloaded.

    • senderPeerId JSON

      PeerId of the sender.

    • data JSON

      The blob data. See the createObjectURL method on how you can convert the blob to a download link.

    • name JSON

      Data name.

    • size JSON

      Data size.

  • error JSON

    The error object.

    • message String

      Error message thrown.

    • transferType String

      Is error from uploading or downloading. [Rel: Skyway.DATA_TRANSFER_TYPE]

handshakeProgress

Defined in source\skyway.js:1520

Available since 0.3.0

Event fired when a peer's handshake progress has changed.

Event Payload:

  • step String

    The handshake progress step. [Rel: Skyway.HANDSHAKE_PROGRESS]

  • peerId String

    PeerId of the peer's handshake progress.

  • error Object | String

    Error message or object thrown.

incomingMessage

Defined in source\skyway.js:1685

Available since 0.4.1

Event fired when a message being broadcasted is received.

  • This is changed from chatMessageReceived, privateMessage and publicMessage event.
  • Note that chatMessageReceived, privateMessage and publicMessage is removed from the specs.

Event Payload:

  • message JSON

    Message object that is received.

    • content JSON | String

      Data that is broadcasted.

    • senderPeerId String

      PeerId of the sender peer.

    • targetPeerId String

      PeerId that is specifically targeted to receive the message.

    • isPrivate Boolean

      Is data received a private message.

    • isDataChannel Boolean

      Is data received from a data channel.

  • peerId String

    PeerId of the sender peer.

  • peerInfo JSON

    Peer's information.

    • settings JSON

      Peer's stream settings.

      • audio Boolean | JSON
        Peer's audio stream settings.
      • audio.stereo Boolean
        If peer has stereo enabled or not.
      • video Boolean | JSON
        Peer's video stream settings.
      • video.resolution JSON
        Peer's video stream resolution [Rel: Skyway.VIDEO_RESOLUTION]
      • video.resolution.width Integer
        Peer's video stream resolution width.
      • video.resolution.height Integer
        Peer's video stream resolution height.
      • video.frameRate Integer
        Peer's video stream resolution minimum frame rate.
    • mediaStatus JSON

      Peer stream status.

      • audioMuted Boolean
        If peer's audio stream is muted.
      • videoMuted Boolean
        If peer's video stream is muted.
    • userData JSON | String

      Peer's custom user data.

  • isSelf Boolean

    Is the peer self.

incomingStream

Defined in source\skyway.js:1673

Available since 0.4.0

Event fired when a remote stream has become available.

  • This occurs after the user joins the room.
  • This is changed from addPeerStream event.
  • Note that addPeerStream is removed from the specs.

Event Payload:

  • stream Object

    MediaStream object.

  • peerId String

    PeerId of the peer that is sending the stream.

  • isSelf Boolean

    Is the peer self.

mediaAccessError

Defined in source\skyway.js:1559

Available since 0.1.0

Event fired when webcam or microphone media access fails.

Event Payload:

  • error Object | String

    Error object thrown.

mediaAccessSuccess

Defined in source\skyway.js:1566

Available since 0.1.0

Event fired when webcam or microphone media acces passes.

Event Payload:

  • stream Object

    MediaStream object.

peerConnectionState

Defined in source\skyway.js:1540

Available since 0.1.0

Event fired when a peer Connection state has changed.

Event Payload:

  • state String

    The peer connection state. [Rel: Skyway.PEER_CONNECTION_STATE]

  • peerId String

    PeerId of the peer that had a peer connection state change.

peerJoined

Defined in source\skyway.js:1573

Available since 0.3.0

Event fired when a peer joins the room.

Event Payload:

  • peerId String

    PeerId of the peer that joined the room.

  • peerInfo JSON

    Peer's information.

    • settings JSON

      Peer's stream settings.

      • audio Boolean | JSON
        Peer's audio stream settings.
      • audio.stereo Boolean
        If peer has stereo enabled or not.
      • video Boolean | JSON
        Peer's video stream settings.
      • video.resolution JSON
        Peer's video stream resolution [Rel: Skyway.VIDEO_RESOLUTION]
      • video.resolution.width Integer
        Peer's video stream resolution width.
      • video.resolution.height Integer
        Peer's video stream resolution height.
      • video.frameRate Integer
        Peer's video stream resolution minimum frame rate.
    • mediaStatus JSON

      Peer stream status.

      • audioMuted Boolean
        If peer's audio stream is muted.
      • videoMuted Boolean
        If peer's video stream is muted.
    • userData JSON | String

      Peer's custom user data.

  • isSelf Boolean

    Is the peer self.

peerLeft

Defined in source\skyway.js:1633

Available since 0.3.0

Event fired when a peer leaves the room

Event Payload:

  • peerId String

    PeerId of the peer that left.

  • peerInfo JSON

    Peer's information.

    • settings JSON

      Peer's stream settings.

      • audio Boolean | JSON
        Peer's audio stream settings.
      • audio.stereo Boolean
        If peer has stereo enabled or not.
      • video Boolean | JSON
        Peer's video stream settings.
      • video.resolution JSON
        Peer's video stream resolution [Rel: Skyway.VIDEO_RESOLUTION]
      • video.resolution.width Integer
        Peer's video stream resolution width.
      • video.resolution.height Integer
        Peer's video stream resolution height.
      • video.frameRate Integer
        Peer's video stream resolution minimum frame rate.
    • mediaStatus JSON

      Peer stream status.

      • audioMuted Boolean
        If peer's audio stream is muted.
      • videoMuted Boolean
        If peer's video stream is muted.
    • userData JSON | String

      Peer's custom user data.

  • isSelf Boolean

    Is the peer self.

peerUpdated

Defined in source\skyway.js:1603

Available since 0.3.0

Event fired when a peer information is updated.

Event Payload:

  • peerId String

    PeerId of the peer that had information updaed.

  • peerInfo JSON

    Peer's information.

    • settings JSON

      Peer's stream settings.

      • audio Boolean | JSON
        Peer's audio stream settings.
      • audio.stereo Boolean
        If peer has stereo enabled or not.
      • video Boolean | JSON
        Peer's video stream settings.
      • video.resolution JSON
        Peer's video stream resolution [Rel: Skyway.VIDEO_RESOLUTION]
      • video.resolution.width Integer
        Peer's video stream resolution width.
      • video.resolution.height Integer
        Peer's video stream resolution height.
      • video.frameRate Integer
        Peer's video stream resolution minimum frame rate.
    • mediaStatus JSON

      Peer stream status.

      • audioMuted Boolean
        If peer's audio stream is muted.
      • videoMuted Boolean
        If peer's video stream is muted.
    • userData JSON | String

      Peer's custom user data.

  • isSelf Boolean

    Is the peer self.

presenceChanged

deprecated private

Defined in source\skyway.js:1663

Available since 0.1.0

TODO Event fired when a peer joins the room

Event Payload:

  • users JSON

    The list of users

readyStateChange

Defined in source\skyway.js:1507

Available since 0.4.0

Event fired whether the room is ready for use.

Event Payload:

  • readyState String

    [Rel: Skyway.READY_STATE_CHANGE]

  • error JSON

    Error object thrown.

    • status Integer

      Http status when retrieving information. May be empty for other errors.

    • content String

      Error message.

    • errorCode Integer

      Error code. [Rel: Skyway.READY_STATE_CHANGE_ERROR]

roomLock

Defined in source\skyway.js:1727

Available since 0.4.0

Event fired when a room lock status has changed.

Event Payload:

  • isLocked Boolean

    Is the room locked.

  • peerId String

    PeerId of the peer that is locking/unlocking the room.

  • peerInfo JSON

    Peer's information.

    • settings JSON

      Peer's stream settings.

      • audio Boolean | JSON
        Peer's audio stream settings.
      • audio.stereo Boolean
        If peer has stereo enabled or not.
      • video Boolean | JSON
        Peer's video stream settings.
      • video.resolution JSON
        Peer's video stream resolution [Rel: Skyway.VIDEO_RESOLUTION]
      • video.resolution.width Integer
        Peer's video stream resolution width.
      • video.resolution.height Integer
        Peer's video stream resolution height.
      • video.frameRate Integer
        Peer's video stream resolution minimum frame rate.
    • mediaStatus JSON

      Peer stream status.

      • audioMuted Boolean
        If peer's audio stream is muted.
      • videoMuted Boolean
        If peer's video stream is muted.
    • userData JSON | String

      Peer's custom user data.

  • isSelf Boolean

    Is the peer self.

systemAction

Defined in source\skyway.js:1796

Available since 0.1.0

Event fired when the signaling server warns the user.

Event Payload:

  • action String

    The action that is required for the user to follow. [Rel: Skyway.SYSTEM_ACTION]

  • message String

    The reason for the action.