     peerConnection.tunnel   = options.tunnel
     peerConnection.channel  = null
 
+    # Initialize a datachannel with callbacks.
     setDataChannel          = (channel) =>
         channel.onopen      = () =>
             if options.onChannelOpen?


###

window.RTCPeerConnection = window.webkitRTCPeerConnection or window.mozRTCPeerConnection or window.RTCPeerConnection
window.SessionDescription = window.RTCSessionDescription or window.mozRTCSessionDescription or window.RTCSessionDescription
window.IceCandidate = window.RTCIceCandidate or window.mozRTCIceCandidate or window.RTCIceCandidate

navigator.getUserMedia = navigator.webkitGetUserMedia or navigator.mozGetUserMedia or navigator.getUserMedia

window.defaults = {
    iceServers: { "iceServers": [{ "url": "stun:stun.ekiga.net" }] },
    constraints: { 'mandatory': { 'OfferToReceiveAudio': true, 'OfferToReceiveVideo': true } }
    optional: { optional: [{ RtpDataChannels: true}] }
}

Runnable                = () ->
    if RTCPeerConnection? and navigator.getUserMedia?
        return true

            if options.onChannelError?
                do options.onChannelError

    # Check if datachannels are available and create one.
    createDataChannel       = () =>
        try
            if peerConnection.createDataChannel?
