peer-data
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -8,3 +8,3 @@ // Generated by dts-bundle v0.7.3 | ||
constructor(servers?: RTCConfiguration, dataConstraints?: RTCDataChannelInit); | ||
connect(id: string): Room; | ||
connect(id: string, stream?: MediaStream): Room; | ||
} | ||
@@ -11,0 +11,0 @@ |
@@ -5,5 +5,5 @@ import { Room } from './Room'; | ||
constructor(servers?: RTCConfiguration, dataConstraints?: RTCDataChannelInit); | ||
connect(id: string): Room; | ||
connect(id: string, stream?: MediaStream): Room; | ||
private onEvent(event); | ||
private onDisconnected(event); | ||
} |
@@ -20,7 +20,8 @@ import { SignalingEventType } from './SignalingEventType'; | ||
} | ||
App.prototype.connect = function (id) { | ||
App.prototype.connect = function (id, stream) { | ||
if (stream === void 0) { stream = null; } | ||
if (this.rooms.has(id)) { | ||
return this.rooms.get(id); | ||
} | ||
var room = new Room(id); | ||
var room = new Room(id, stream); | ||
this.rooms.set(id, room); | ||
@@ -27,0 +28,0 @@ return room; |
@@ -33,5 +33,3 @@ import * as tslib_1 from "tslib"; | ||
.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.setLocalStream(); }) | ||
.then(function (_) { return _this.peer.createAnswer(); }) | ||
@@ -118,7 +116,13 @@ .then(function (desc) { return _this.peer.setLocalDescription(desc); }) | ||
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); }); | ||
} | ||
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*/]; | ||
}); | ||
}); | ||
}; | ||
@@ -125,0 +129,0 @@ Participant.prototype.newDataChannel = function (dataConstraints) { |
@@ -5,5 +5,5 @@ import { Room } from './Room'; | ||
constructor(servers?: RTCConfiguration, dataConstraints?: RTCDataChannelInit); | ||
connect(id: string): Room; | ||
connect(id: string, stream?: MediaStream): Room; | ||
private onEvent(event); | ||
private onDisconnected(event); | ||
} |
@@ -22,7 +22,8 @@ "use strict"; | ||
} | ||
App.prototype.connect = function (id) { | ||
App.prototype.connect = function (id, stream) { | ||
if (stream === void 0) { stream = null; } | ||
if (this.rooms.has(id)) { | ||
return this.rooms.get(id); | ||
} | ||
var room = new Room_1.Room(id); | ||
var room = new Room_1.Room(id, stream); | ||
this.rooms.set(id, room); | ||
@@ -29,0 +30,0 @@ return room; |
@@ -35,5 +35,3 @@ "use strict"; | ||
.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.setLocalStream(); }) | ||
.then(function (_) { return _this.peer.createAnswer(); }) | ||
@@ -120,7 +118,13 @@ .then(function (desc) { return _this.peer.setLocalDescription(desc); }) | ||
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); }); | ||
} | ||
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*/]; | ||
}); | ||
}); | ||
}; | ||
@@ -127,0 +131,0 @@ Participant.prototype.newDataChannel = function (dataConstraints) { |
{ | ||
"name": "peer-data", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"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
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
447115
1454