Compare commits

...

4 Commits

3 changed files with 425 additions and 722 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
module.exports = { module.exports = {
hubAddress: 'https://hub.dev.linx.safemobile.com/', hubAddress: 'https://hub.dev.linx.safemobile.com/',
mediasoupAddress: 'https://video.safemobile.org/mediasoup', mediasoupAddress: 'https://video.safemobile.org',
// mediasoupAddress: 'http://localhost:3000/mediasoup',
} }

View File

@ -12,6 +12,8 @@ let callId = parseInt(urlParams.get('callId')) || null;
const IS_PRODUCER = urlParams.get('producer') === 'true' ? true : false const IS_PRODUCER = urlParams.get('producer') === 'true' ? true : false
console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId', callId, ' | IS_PRODUCER', IS_PRODUCER) console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId', callId, ' | IS_PRODUCER', IS_PRODUCER)
console.log('🟩 config', config)
let socket let socket
hub = io(config.hubAddress) hub = io(config.hubAddress)
@ -35,6 +37,7 @@ const connectToMediasoup = () => {
} }
if (IS_PRODUCER === true) { if (IS_PRODUCER === true) {
setTimeout(() => {
hub.on('connect', async () => { hub.on('connect', async () => {
console.log(`[HUB] ${config.hubAddress} | connected: ${hub.connected}`) console.log(`[HUB] ${config.hubAddress} | connected: ${hub.connected}`)
connectToMediasoup() connectToMediasoup()
@ -68,6 +71,7 @@ if (IS_PRODUCER === true) {
} }
}) })
}) })
}, 2000);
hub.on('connect_error', (error) => { hub.on('connect_error', (error) => {
console.log('connect_error', error); console.log('connect_error', error);
@ -135,7 +139,7 @@ const streamSuccess = (stream) => {
const getLocalStream = () => { const getLocalStream = () => {
console.log('[getLocalStream]'); console.log('[getLocalStream]');
navigator.mediaDevices.getUserMedia({ navigator.mediaDevices.getUserMedia({
audio: false, audio: true,
video: { video: {
width: { width: {
min: 640, min: 640,