fix channel type, callback
This commit is contained in:
parent
119af2bcb9
commit
77b00187de
@ -38,11 +38,7 @@ var input = document.getElementById("messageInput");
|
|||||||
function initialize() {
|
function initialize() {
|
||||||
var configuration = null;
|
var configuration = null;
|
||||||
|
|
||||||
peerConnection = new RTCPeerConnection(configuration, {
|
peerConnection = new RTCPeerConnection(configuration);
|
||||||
optional : [ {
|
|
||||||
RtpDataChannels : true
|
|
||||||
} ]
|
|
||||||
});
|
|
||||||
|
|
||||||
// Setup ice handling
|
// Setup ice handling
|
||||||
peerConnection.onicecandidate = function(event) {
|
peerConnection.onicecandidate = function(event) {
|
||||||
@ -71,6 +67,11 @@ function initialize() {
|
|||||||
dataChannel.onclose = function() {
|
dataChannel.onclose = function() {
|
||||||
console.log("data channel is closed");
|
console.log("data channel is closed");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
peerConnection.ondatachannel = function (event) {
|
||||||
|
dataChannel = event.channel;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createOffer() {
|
function createOffer() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user