openvidu-browser: package.json dependencies updated

pull/117/merge
pabloFuente 2018-08-31 15:07:34 +02:00
parent 9f1e6770e1
commit e456b5e350
5 changed files with 1629 additions and 549 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
{
"author": "OpenVidu",
"dependencies": {
"@types/node": "10.5.1",
"@types/node": "10.9.4",
"@types/platform": "1.3.1",
"freeice": "2.2.0",
"hark": "1.2.0",
"freeice": "2.2.2",
"hark": "1.2.3",
"platform": "1.3.5",
"uuid": "3.3.2",
"webrtc-adapter": "6.2.1",
"webrtc-adapter": "6.3.2",
"wolfy87-eventemitter": "5.2.5"
},
"description": "OpenVidu Browser",
@ -15,19 +15,18 @@
"browserify": "16.2.2",
"grunt": "1.0.3",
"grunt-autoprefixer": "3.0.4",
"grunt-cli": "1.2.0",
"grunt-cli": "1.3.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-sass": "1.0.0",
"grunt-contrib-uglify": "3.3.0",
"grunt-contrib-uglify": "3.4.0",
"grunt-contrib-watch": "1.1.0",
"grunt-string-replace": "1.3.1",
"grunt-ts": "6.0.0-beta.20",
"grunt-ts": "6.0.0-beta.21",
"tsify": "4.0.0",
"tslint": "5.10.0",
"typedoc": "0.11.1",
"typedoc-plugin-sourcefile-url": "1.0.3",
"typescript": "2.9.2",
"uglify-js": "3.4.3"
"tslint": "5.11.0",
"typedoc": "0.12.0",
"typescript": "3.0.3",
"uglify-js": "3.4.8"
},
"license": "Apache-2.0",
"main": "lib/index.js",

View File

@ -833,10 +833,21 @@ export class Session implements EventDispatcher {
* @hidden
*/
recvIceCandidate(msg): void {
const candidate = {
const candidate: RTCIceCandidate = {
candidate: msg.candidate,
component: msg.component,
foundation: msg.foundation,
ip: msg.ip,
port: msg.port,
priority: msg.priority,
protocol: msg.protocol,
relatedAddress: msg.relatedAddress,
relatedPort: msg.relatedPort,
sdpMid: msg.sdpMid,
sdpMLineIndex: msg.sdpMLineIndex,
tcpType: msg.tcpType,
usernameFragment: msg.usernameFragment,
type: msg.type,
toJSON: () => {
return { candidate: msg.candidate };
}

View File

@ -429,7 +429,9 @@ export class Stream implements EventDispatcher {
*/
disposeWebRtcPeer(): void {
if (this.webRtcPeer) {
this.webRtcPeer.dispose();
const isSenderAndCustomTrack: boolean = !!this.outboundStreamOpts &&
this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack;
this.webRtcPeer.dispose(isSenderAndCustomTrack);
}
if (this.speechEvent) {
this.speechEvent.stop();
@ -699,7 +701,15 @@ export class Stream implements EventDispatcher {
}
private remotePeerSuccessfullyEstablished(): void {
this.mediaStream = this.webRtcPeer.pc.getRemoteStreams()[0];
this.mediaStream = new MediaStream();
let receiver: RTCRtpReceiver;
for (receiver of this.webRtcPeer.pc.getReceivers()) {
if (!!receiver.track) {
this.mediaStream.addTrack(receiver.track);
}
}
console.debug('Peer remote stream', this.mediaStream);
if (!!this.mediaStream) {

View File

@ -51,13 +51,15 @@ export class WebRtcPeer {
this.id = !!configuration.id ? configuration.id : uuid.v4();
this.pc.onicecandidate = event => {
const candidate: RTCIceCandidate = event.candidate;
if (candidate) {
this.localCandidatesQueue.push(<RTCIceCandidate>{ candidate: candidate.candidate });
this.candidategatheringdone = false;
this.configuration.onicecandidate(event.candidate);
} else if (!this.candidategatheringdone) {
this.candidategatheringdone = true;
if (!!event.candidate) {
const candidate: RTCIceCandidate = event.candidate;
if (candidate) {
this.localCandidatesQueue.push(<RTCIceCandidate>{ candidate: candidate.candidate });
this.candidategatheringdone = false;
this.configuration.onicecandidate(event.candidate);
} else if (!this.candidategatheringdone) {
this.candidategatheringdone = true;
}
}
};
@ -85,23 +87,18 @@ export class WebRtcPeer {
reject('The peer connection object is in "closed" state. This is most likely due to an invocation of the dispose method before accepting in the dialogue');
}
if (!!this.configuration.mediaStream) {
this.pc.addStream(this.configuration.mediaStream);
for (const track of this.configuration.mediaStream.getTracks()) {
this.pc.addTrack(track, this.configuration.mediaStream);
}
resolve();
}
// [Hack] https://code.google.com/p/chromium/issues/detail?id=443558
if (this.configuration.mode === 'sendonly' &&
(platform.name === 'Chrome' && platform.version!.toString().substring(0, 2) === '39')) {
this.configuration.mode = 'sendrecv';
}
resolve();
});
}
/**
* This method frees the resources used by WebRtcPeer
*/
dispose() {
dispose(videoSourceIsMediaStreamTrack: boolean) {
console.debug('Disposing WebRtcPeer');
try {
if (this.pc) {
@ -111,13 +108,21 @@ export class WebRtcPeer {
this.remoteCandidatesQueue = [];
this.localCandidatesQueue = [];
this.pc.getLocalStreams().forEach(str => {
this.streamStop(str);
});
// FIXME This is not yet implemented in firefox
// if(videoStream) pc.removeStream(videoStream);
// if(audioStream) pc.removeStream(audioStream);
// Stop senders
for (const sender of this.pc.getSenders()) {
if (!videoSourceIsMediaStreamTrack) {
if (!!sender.track) {
sender.track.stop();
}
}
this.pc.removeTrack(sender);
}
// Stop receivers
for (const receiver of this.pc.getReceivers()) {
if (!!receiver.track) {
receiver.track.stop();
}
}
this.pc.close();
}
@ -143,8 +148,8 @@ export class WebRtcPeer {
}
const constraints: RTCOfferOptions = {
offerToReceiveAudio: + (this.configuration.mode !== 'sendonly' && offerAudio),
offerToReceiveVideo: + (this.configuration.mode !== 'sendonly' && offerVideo)
offerToReceiveAudio: (this.configuration.mode !== 'sendonly' && offerAudio),
offerToReceiveVideo: (this.configuration.mode !== 'sendonly' && offerVideo)
};
console.debug('RTCPeerConnection constraints: ' + JSON.stringify(constraints));
@ -244,12 +249,6 @@ export class WebRtcPeer {
});
}
private streamStop(stream: MediaStream): void {
stream.getTracks().forEach(track => {
track.stop();
stream.removeTrack(track);
});
}
}