peer-data
Advanced tools
Comparing version 3.0.4 to 3.0.5
@@ -20,3 +20,2 @@ import { EventHandler } from './EventHandler'; | ||
private onCandidate(event); | ||
private setLocalStream(); | ||
private newDataChannel(dataConstraints); | ||
@@ -23,0 +22,0 @@ private onIceCandidate(iceEvent); |
@@ -8,2 +8,3 @@ import * as tslib_1 from "tslib"; | ||
if (remoteDesc === void 0) { remoteDesc = null; } | ||
var _this = this; | ||
this.dispatcher = new EventDispatcher(); | ||
@@ -21,2 +22,6 @@ this.id = id; | ||
this.peer.ontrack = this.onTrack.bind(this); | ||
var stream = this.room.getStream(); | ||
if (stream instanceof MediaStream) { | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
} | ||
} | ||
@@ -35,3 +40,2 @@ Participant.prototype.getId = function () { | ||
.setRemoteDescription(this.remoteDesc) | ||
.then(function (_) { return _this.setLocalStream(); }) | ||
.then(function (_) { return _this.peer.createAnswer(); }) | ||
@@ -108,3 +112,2 @@ .then(function (desc) { return _this.peer.setLocalDescription(desc); }) | ||
.setRemoteDescription(new RTCSessionDescription(event.payload)) | ||
.then(function (_) { return _this.setLocalStream(); }) | ||
.catch(function (evnt) { return _this.dispatcher.dispatch('error', evnt); }); | ||
@@ -118,15 +121,2 @@ }; | ||
}; | ||
Participant.prototype.setLocalStream = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var _this = this; | ||
var stream; | ||
return tslib_1.__generator(this, function (_a) { | ||
stream = this.room.getStream(); | ||
if (stream instanceof MediaStream) { | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
} | ||
return [2 /*return*/]; | ||
}); | ||
}); | ||
}; | ||
Participant.prototype.newDataChannel = function (dataConstraints) { | ||
@@ -133,0 +123,0 @@ var label = Math.floor((1 + Math.random()) * 1e16).toString(16).substring(1); |
@@ -20,3 +20,2 @@ import { EventHandler } from './EventHandler'; | ||
private onCandidate(event); | ||
private setLocalStream(); | ||
private newDataChannel(dataConstraints); | ||
@@ -23,0 +22,0 @@ private onIceCandidate(iceEvent); |
@@ -10,2 +10,3 @@ "use strict"; | ||
if (remoteDesc === void 0) { remoteDesc = null; } | ||
var _this = this; | ||
this.dispatcher = new EventDispatcher_1.EventDispatcher(); | ||
@@ -23,2 +24,6 @@ this.id = id; | ||
this.peer.ontrack = this.onTrack.bind(this); | ||
var stream = this.room.getStream(); | ||
if (stream instanceof MediaStream) { | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
} | ||
} | ||
@@ -37,3 +42,2 @@ Participant.prototype.getId = function () { | ||
.setRemoteDescription(this.remoteDesc) | ||
.then(function (_) { return _this.setLocalStream(); }) | ||
.then(function (_) { return _this.peer.createAnswer(); }) | ||
@@ -110,3 +114,2 @@ .then(function (desc) { return _this.peer.setLocalDescription(desc); }) | ||
.setRemoteDescription(new RTCSessionDescription(event.payload)) | ||
.then(function (_) { return _this.setLocalStream(); }) | ||
.catch(function (evnt) { return _this.dispatcher.dispatch('error', evnt); }); | ||
@@ -120,15 +123,2 @@ }; | ||
}; | ||
Participant.prototype.setLocalStream = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var _this = this; | ||
var stream; | ||
return tslib_1.__generator(this, function (_a) { | ||
stream = this.room.getStream(); | ||
if (stream instanceof MediaStream) { | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
} | ||
return [2 /*return*/]; | ||
}); | ||
}); | ||
}; | ||
Participant.prototype.newDataChannel = function (dataConstraints) { | ||
@@ -135,0 +125,0 @@ var label = Math.floor((1 + Math.random()) * 1e16).toString(16).substring(1); |
{ | ||
"name": "peer-data", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "PeerData - library for files, media streaming/sharing using WebRTC", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
445063
1431