peer-data
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -18,5 +18,5 @@ import { EventHandler } from './EventHandler'; | ||
handleEvent(event: SignalingEvent): void; | ||
private stream(stream); | ||
private onAnswer(event); | ||
private onCandidate(event); | ||
private setLocalStream(); | ||
private newDataChannel(dataConstraints); | ||
@@ -23,0 +23,0 @@ private onIceCandidate(iceEvent); |
@@ -27,13 +27,11 @@ import * as tslib_1 from "tslib"; | ||
var _this = this; | ||
var stream; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
stream = this.room.getStream(); | ||
if (null !== stream) { | ||
this.stream(stream); | ||
} | ||
if (!this.remoteDesc) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.peer | ||
.setRemoteDescription(this.remoteDesc) | ||
.then(function (_) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { | ||
return [2 /*return*/, this.setLocalStream()]; | ||
}); }); }) | ||
.then(function (_) { return _this.peer.createAnswer(); }) | ||
@@ -106,6 +104,2 @@ .then(function (desc) { return _this.peer.setLocalDescription(desc); }) | ||
}; | ||
Participant.prototype.stream = function (stream) { | ||
var _this = this; | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
}; | ||
Participant.prototype.onAnswer = function (event) { | ||
@@ -115,2 +109,3 @@ var _this = this; | ||
.setRemoteDescription(new RTCSessionDescription(event.payload)) | ||
.then(function (_) { return _this.setLocalStream(); }) | ||
.catch(function (evnt) { return _this.dispatcher.dispatch('error', evnt); }); | ||
@@ -124,2 +119,9 @@ }; | ||
}; | ||
Participant.prototype.setLocalStream = function () { | ||
var _this = this; | ||
var stream = this.room.getStream(); | ||
if (stream instanceof MediaStream) { | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
} | ||
}; | ||
Participant.prototype.newDataChannel = function (dataConstraints) { | ||
@@ -126,0 +128,0 @@ var label = Math.floor((1 + Math.random()) * 1e16).toString(16).substring(1); |
@@ -18,5 +18,5 @@ import { EventHandler } from './EventHandler'; | ||
handleEvent(event: SignalingEvent): void; | ||
private stream(stream); | ||
private onAnswer(event); | ||
private onCandidate(event); | ||
private setLocalStream(); | ||
private newDataChannel(dataConstraints); | ||
@@ -23,0 +23,0 @@ private onIceCandidate(iceEvent); |
@@ -29,13 +29,11 @@ "use strict"; | ||
var _this = this; | ||
var stream; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
stream = this.room.getStream(); | ||
if (null !== stream) { | ||
this.stream(stream); | ||
} | ||
if (!this.remoteDesc) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.peer | ||
.setRemoteDescription(this.remoteDesc) | ||
.then(function (_) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { | ||
return [2 /*return*/, this.setLocalStream()]; | ||
}); }); }) | ||
.then(function (_) { return _this.peer.createAnswer(); }) | ||
@@ -108,6 +106,2 @@ .then(function (desc) { return _this.peer.setLocalDescription(desc); }) | ||
}; | ||
Participant.prototype.stream = function (stream) { | ||
var _this = this; | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
}; | ||
Participant.prototype.onAnswer = function (event) { | ||
@@ -117,2 +111,3 @@ var _this = this; | ||
.setRemoteDescription(new RTCSessionDescription(event.payload)) | ||
.then(function (_) { return _this.setLocalStream(); }) | ||
.catch(function (evnt) { return _this.dispatcher.dispatch('error', evnt); }); | ||
@@ -126,2 +121,9 @@ }; | ||
}; | ||
Participant.prototype.setLocalStream = function () { | ||
var _this = this; | ||
var stream = this.room.getStream(); | ||
if (stream instanceof MediaStream) { | ||
stream.getTracks().map(function (track) { return _this.peer.addTrack(track, stream); }); | ||
} | ||
}; | ||
Participant.prototype.newDataChannel = function (dataConstraints) { | ||
@@ -128,0 +130,0 @@ var label = Math.floor((1 + Math.random()) * 1e16).toString(16).substring(1); |
{ | ||
"name": "peer-data", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"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
446582
1444