Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions dist/RTCMultiConnection.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,25 +190,34 @@ var RTCMultiConnection = function(roomid, forceOptions) {
})
},
send: function(data, remoteUserId) {
console.log("%%%",data)
var that = this;
if (!isNull(data.size) && !isNull(data.type)) {
console.log("111111111111111111111111111",data)
console.log("enableFILESHARING ",connection.enableFileSharing)
if (connection.enableFileSharing) return void self.shareFile(data, remoteUserId);
"string" != typeof data && (data = JSON.stringify(data))
}
if (!("text" === data.type || data instanceof ArrayBuffer || data instanceof DataView)) return void TextSender.send({
if (!("text" === data.type || data instanceof ArrayBuffer || data instanceof DataView))
{
console.log("222222222222222222222222222",data.size)
return void TextSender.send({
text: data,
channel: this,
connection: connection,
remoteUserId: remoteUserId
});
});
}
if ("text" === data.type && (data = JSON.stringify(data)), remoteUserId) {
console.log("333333333333333333333333333")
var remoteUser = connection.peers[remoteUserId];
if (remoteUser) return remoteUser.channels.length ? void remoteUser.channels.forEach(function(channel) {
channel.send(data)
}) : (connection.peers[remoteUserId].createDataChannel(), connection.renegotiate(remoteUserId), void setTimeout(function() {
that.send(data, remoteUserId)
}, 3e3))
}
console.log("444444444444444444444",data)
this.getAllParticipants().forEach(function(participant) {
return that[participant].channels.length ? void that[participant].channels.forEach(function(channel) {
channel.send(data)
Expand Down Expand Up @@ -317,6 +326,7 @@ var RTCMultiConnection = function(roomid, forceOptions) {
}, this.onGettingRemoteMedia = function(stream, remoteUserId) {}, this.onRemovingRemoteMedia = function(stream, remoteUserId) {}, this.onGettingLocalMedia = function(localStream) {}, this.onLocalMediaError = function(error, constraints) {
connection.onMediaError(error, constraints)
}, this.shareFile = function(file, remoteUserId) {
console.log("SHAREFILE !",file)
initFileBufferReader(), connection.fbr.readAsArrayBuffer(file, function(uuid) {
var arrayOfUsers = connection.getAllParticipants();
remoteUserId && (arrayOfUsers = [remoteUserId]), arrayOfUsers.forEach(function(participant) {
Expand Down Expand Up @@ -2065,6 +2075,7 @@ var RTCMultiConnection = function(roomid, forceOptions) {
}, connection.onmessage = function(event) {
connection.enableLogs && console.debug("data-message", event.userid, event.data)
}, connection.send = function(data, remoteUserId) {
console.log("$$$",data)
connection.peers.send(data, remoteUserId)
}, connection.close = connection.disconnect = connection.leave = function() {
connection.onbeforeunload(!1, !0)
Expand Down
1 change: 1 addition & 0 deletions dist/canvas-designer/widget_mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function getRecordVideoFormData() {
var chunks = [];
let clearFlag = false;
mediaRecorder.ondataavailable = function (e) {
console.log("무슨타입이야? ",e)
chunks.push(e.data);
};
mediaRecorder.onstop = function (e) {
Expand Down
Loading