From 33e30339f25a73cef92fe85f413bf6c44b731e95 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Mon, 19 Dec 2022 13:12:49 +0200 Subject: [PATCH] Update --- public/bundle.js | 9 +++++---- public/index.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/bundle.js b/public/bundle.js index 28e6a0d..bc8ef92 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -20368,6 +20368,7 @@ const ASSET_NAME = urlParams.get('assetName') || null; const ASSET_TYPE = urlParams.get('assetType') || null; let callId = parseInt(urlParams.get('callId')) || null; const IS_PRODUCER = urlParams.get('producer') === 'true' ? true : false +let remoteVideo = document.getElementById('remoteVideo') console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId', callId, ' | IS_PRODUCER', IS_PRODUCER) console.log('🟩 config', config) @@ -20390,10 +20391,10 @@ remoteSoundControl.defaultMuted = true remoteSoundControl.addEventListener('click', function handleClick() { console.log('remoteSoundControl.textContent', remoteSoundControl.textContent); if (remoteSoundControl.textContent === 'Unmute') { - remoteSoundControl.muted = false + remoteVideo.muted = false remoteSoundControl.textContent = 'Mute'; } else { - remoteSoundControl.muted = true + remoteVideo.muted = true remoteSoundControl.textContent = 'Unmute'; } }); @@ -20787,9 +20788,10 @@ const connectRecvTransport = async () => { // Maybe the unit does not produce video or audio, so we must only consume what is produced if (videoParams) { + console.log('❗ Have VIDEO stream to consume'); stream.addTrack(await getVideoTrask(videoParams)) } else { - console.log('❗ Have VIDEO stream to consume'); + console.log('❗ Don\'t have AUDIO stream to consume'); } if (audioParams) { @@ -20804,7 +20806,6 @@ const connectRecvTransport = async () => { socket.emit('consumer-resume') - let remoteVideo = document.getElementById('remoteVideo') remoteVideo.srcObject = stream remoteVideo.setAttribute('autoplay', true) remoteVideo.setAttribute('muted', false) diff --git a/public/index.js b/public/index.js index e6f3423..b764412 100644 --- a/public/index.js +++ b/public/index.js @@ -10,6 +10,7 @@ const ASSET_NAME = urlParams.get('assetName') || null; const ASSET_TYPE = urlParams.get('assetType') || null; let callId = parseInt(urlParams.get('callId')) || null; const IS_PRODUCER = urlParams.get('producer') === 'true' ? true : false +let remoteVideo = document.getElementById('remoteVideo') console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId', callId, ' | IS_PRODUCER', IS_PRODUCER) console.log('🟩 config', config) @@ -32,10 +33,10 @@ remoteSoundControl.defaultMuted = true remoteSoundControl.addEventListener('click', function handleClick() { console.log('remoteSoundControl.textContent', remoteSoundControl.textContent); if (remoteSoundControl.textContent === 'Unmute') { - remoteSoundControl.muted = false + remoteVideo.muted = false remoteSoundControl.textContent = 'Mute'; } else { - remoteSoundControl.muted = true + remoteVideo.muted = true remoteSoundControl.textContent = 'Unmute'; } }); @@ -429,9 +430,10 @@ const connectRecvTransport = async () => { // Maybe the unit does not produce video or audio, so we must only consume what is produced if (videoParams) { + console.log('❗ Have VIDEO stream to consume'); stream.addTrack(await getVideoTrask(videoParams)) } else { - console.log('❗ Have VIDEO stream to consume'); + console.log('❗ Don\'t have AUDIO stream to consume'); } if (audioParams) { @@ -446,7 +448,6 @@ const connectRecvTransport = async () => { socket.emit('consumer-resume') - let remoteVideo = document.getElementById('remoteVideo') remoteVideo.srcObject = stream remoteVideo.setAttribute('autoplay', true) remoteVideo.setAttribute('muted', false)