1
0
Fork 0
mirror of https://api.glitch.com/git/yaswvc synced 2026-01-12 05:08:11 +00:00

🐏🍪 Checkpoint

./public/main.js:5975361/514
This commit is contained in:
Glitch (peerjs-video) 2020-09-12 21:26:50 +00:00
parent 88dbb0458a
commit db1970526a

View file

@ -128,11 +128,12 @@ var app = new Vue({
}); });
this.calls.push(call); this.calls.push(call);
console.log('Call', call); console.log('Call', call);
call.peerConnection.onaddstream = (a,b) => { call.peerConnection.onaddstream = (stream) => {
console.log('stream add', a, b) console.log('stream add', stream);
// stream.
}; };
call.peerConnection.onremovestream =(a,b) => { call.peerConnection.onremovestream = (stream) => {
console.log('stream remove', a, b) console.log('stream remove', stream);
}; };
}, },
gotDevices: function gotDevices(deviceInfos) { gotDevices: function gotDevices(deviceInfos) {
@ -202,6 +203,13 @@ var app = new Vue({
// call.peerConnection.addStream(stream); // call.peerConnection.addStream(stream);
// console.log('local streams',call.peerConnection.getLocalStreams()); // console.log('local streams',call.peerConnection.getLocalStreams());
console.log(call.peerConnection, stream.getTracks()) console.log(call.peerConnection, stream.getTracks())
const target = call.peerConnection.getLocalStreams()[0];
target.getTracks().forEach((track) => {
target.removeTrack(track);
});
stream.getTracks().forEach((track) => {
target.addTrack(track);
});
}); });
} }
this.stream = stream; // make stream available to console this.stream = stream; // make stream available to console