Skip to content
Open
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
5 changes: 3 additions & 2 deletions peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Peer.prototype.handleDataChannelAdded = function (channel) {
this._observeDataChannel(channel);
};

Peer.prototype.sendFile = function (file) {
Peer.prototype.sendFile = function (file, metadata) {
var sender = new FileTransfer.Sender();
var dc = this.getDataChannel('filetransfer' + (new Date()).getTime(), {
protocol: INBAND_FILETRANSFER_V1
Expand All @@ -272,7 +272,8 @@ Peer.prototype.sendFile = function (file) {
dc.onopen = function () {
dc.send(JSON.stringify({
size: file.size,
name: file.name
name: file.name,
additionalData : metadata
}));
sender.send(file, dc);
};
Expand Down