Compare commits

...

5 Commits

Author SHA1 Message Date
451fff0a6b Update 2022-12-23 11:39:49 +02:00
a568e542a7 Update 2022-12-22 09:34:31 +02:00
14af825eab Update 2022-12-22 09:26:37 +02:00
f3ba6d37c2 Update 2022-12-22 09:22:23 +02:00
a4356f06be Update 2022-12-22 09:16:52 +02:00
2 changed files with 64 additions and 38 deletions

View File

@ -20811,15 +20811,28 @@ const connectRecvTransport = async () => {
if (audioParams) { if (audioParams) {
console.log('❗ Have AUDIO stream to consume'); console.log('❗ Have AUDIO stream to consume');
let audioTrack = await getAudioTrask(audioParams) let audioTrack = await getAudioTrask(audioParams)
console.log('audioTrack', audioTrack);
stream.addTrack(audioTrack) stream.addTrack(audioTrack)
} else { } else {
console.log('❗ Don\'t have AUDIO stream to consume'); console.log('❗ Don\'t have AUDIO stream to consume');
} }
console.log('----------stream', stream);
console.log('stream.getAudioTracks()', stream.getAudioTracks());
socket.emit('consumer-resume') socket.emit('consumer-resume')
remoteVideo.srcObject = stream remoteVideo.srcObject = stream
remoteVideo.setAttribute('autoplay', true) // remoteVideo.autoplay = true
remoteVideo.controls = true;
remoteVideo.muted = true;
remoteVideo.loop = true;
remoteVideo.setAttribute('playsinline', '');
remoteVideo.src = stream;
remoteVideo.volume = 1.0;
// window.localStream = stream; // A
// window.localAudio.srcObject = stream; // B
// window.localAudio.autoplay = true; // C
remoteVideo.play() remoteVideo.play()
.then(() => { .then(() => {
@ -20860,24 +20873,24 @@ const getAudioTrask = async (audioParams) => {
const audioTrack = consumerAudio.track const audioTrack = consumerAudio.track
audioTrack.applyConstraints({ // audioTrack.applyConstraints({
audio: { // audio: {
advanced: [ // advanced: [
{ // {
echoCancellation: {exact: true} // echoCancellation: {exact: true}
}, // },
{ // {
autoGainControl: {exact: true} // autoGainControl: {exact: true}
}, // },
{ // {
noiseSuppression: {exact: true} // noiseSuppression: {exact: true}
}, // },
{ // {
highpassFilter: {exact: true} // highpassFilter: {exact: true}
} // }
] // ]
} // }
}) // })
return audioTrack return audioTrack
} }

View File

@ -453,15 +453,28 @@ const connectRecvTransport = async () => {
if (audioParams) { if (audioParams) {
console.log('❗ Have AUDIO stream to consume'); console.log('❗ Have AUDIO stream to consume');
let audioTrack = await getAudioTrask(audioParams) let audioTrack = await getAudioTrask(audioParams)
console.log('audioTrack', audioTrack);
stream.addTrack(audioTrack) stream.addTrack(audioTrack)
} else { } else {
console.log('❗ Don\'t have AUDIO stream to consume'); console.log('❗ Don\'t have AUDIO stream to consume');
} }
console.log('----------stream', stream);
console.log('stream.getAudioTracks()', stream.getAudioTracks());
socket.emit('consumer-resume') socket.emit('consumer-resume')
remoteVideo.srcObject = stream remoteVideo.srcObject = stream
remoteVideo.setAttribute('autoplay', true) // remoteVideo.autoplay = true
remoteVideo.controls = true;
remoteVideo.muted = true;
remoteVideo.loop = true;
remoteVideo.setAttribute('playsinline', '');
remoteVideo.src = stream;
remoteVideo.volume = 1.0;
// window.localStream = stream; // A
// window.localAudio.srcObject = stream; // B
// window.localAudio.autoplay = true; // C
remoteVideo.play() remoteVideo.play()
.then(() => { .then(() => {
@ -502,24 +515,24 @@ const getAudioTrask = async (audioParams) => {
const audioTrack = consumerAudio.track const audioTrack = consumerAudio.track
audioTrack.applyConstraints({ // audioTrack.applyConstraints({
audio: { // audio: {
advanced: [ // advanced: [
{ // {
echoCancellation: {exact: true} // echoCancellation: {exact: true}
}, // },
{ // {
autoGainControl: {exact: true} // autoGainControl: {exact: true}
}, // },
{ // {
noiseSuppression: {exact: true} // noiseSuppression: {exact: true}
}, // },
{ // {
highpassFilter: {exact: true} // highpassFilter: {exact: true}
} // }
] // ]
} // }
}) // })
return audioTrack return audioTrack
} }