From d674a566d3f7382df5471d0be83e550e502d9bed Mon Sep 17 00:00:00 2001 From: "vikasmarwaha@webrtc.org" Date: Thu, 24 Oct 2013 19:38:47 +0000 Subject: [PATCH] Update dc1 demo as it was using invalid data Constraint (Reliable:true) for SCTP. The constraint Reliable is not supported by Standard and ignored in our implementation. See issue 2511. R=dutton@google.com, jiayl@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2739004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5030 4adac7df-926f-26a2-2b94-8c16560cd09d --- samples/js/demos/html/dc1.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/samples/js/demos/html/dc1.html b/samples/js/demos/html/dc1.html index 195296aa2..21aa4607b 100644 --- a/samples/js/demos/html/dc1.html +++ b/samples/js/demos/html/dc1.html @@ -72,21 +72,31 @@ function enableStartButton() { startButton.disabled = false; } +function disableSendButton() { + sendButton.disabled = true; +} + +rtp_select.onclick = sctp_select.onclick = function() { + dataChannelReceive.value = ''; + dataChannelSend.value = ''; + disableSendButton(); + enableStartButton(); +}; + function createConnection() { dataChannelSendId.placeholder = ""; var servers = null; - pcConstraint = {optional: [{RtpDataChannels: true}]}; - dataConstraint = {reliable: false}; + pcConstraint = null; + dataConstraint = null; if (sctp_select.checked && webrtcDetectedBrowser === 'chrome' && webrtcDetectedVersion >= 31) { - // SCTP is supported from Chrome M31. In current canary builds, - // you might need to enable it through flag #enable-sctp-data-channels. - // Use SCTP with reliable set to true. - pcConstraint = {optional: [{DtlsSrtpKeyAgreement: true}]}; - dataConstraint = {reliable: true}; + // SCTP is supported from Chrome M31. + // No need to pass DTLS constraint as it is on by default in Chrome M31. + // For SCTP, reliable and ordered is true by default. trace('Using SCTP based Data Channels'); } else { + pcConstraint = {optional: [{RtpDataChannels: true}]}; if (!rtp_select.checked) { // Use rtp data channels for chrome versions older than M31. trace('Using RTP based Data Channels,' +