Update server

This commit is contained in:
Sergiu Toma 2022-11-23 00:54:03 +02:00
parent 3c23c6791d
commit a97ec24148
2 changed files with 20 additions and 50 deletions

View File

@ -20446,7 +20446,7 @@ setTimeout(() => {
connectToMediasoup() connectToMediasoup()
} }
}, 2000); }, 1600);
let device let device
@ -20457,28 +20457,18 @@ let producerVideo
let producerAudio let producerAudio
let consumer let consumer
let originAssetId let originAssetId
// let originAssetName = 'Adi'
// let originAssetTypeName = 'linx'
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions // https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce // https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
let videoParams = { let videoParams = {
// mediasoup params codec : device.rtpCapabilities.codecs
.find((codec) => codec.mimeType.toLowerCase() === 'video/vp9'),
encodings: [ encodings: [
{ { scaleResolutionDownBy: 4, maxBitrate: 500000 },
maxBitrate: 100000, { scaleResolutionDownBy: 2, maxBitrate: 1000000 },
scalabilityMode: 'S1T3', { scaleResolutionDownBy: 1, maxBitrate: 5000000 },
}, { scalabilityMode: 'S3T3_KEY' }
{
maxBitrate: 300000,
scalabilityMode: 'S1T3',
},
{
maxBitrate: 900000,
scalabilityMode: 'S1T3',
},
], ],
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerCodecOptions
codecOptions: { codecOptions: {
videoGoogleStartBitrate: 1000 videoGoogleStartBitrate: 1000
} }
@ -20517,14 +20507,9 @@ const getLocalStream = () => {
navigator.mediaDevices.getUserMedia({ navigator.mediaDevices.getUserMedia({
audio: true, audio: true,
video: { video: {
width: { qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
min: 640, vga : { width: { ideal: 640 }, height: { ideal: 480 } },
max: 1920, hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
},
height: {
min: 400,
max: 1080,
}
} }
}) })
.then(streamSuccess) .then(streamSuccess)

View File

@ -88,7 +88,7 @@ setTimeout(() => {
connectToMediasoup() connectToMediasoup()
} }
}, 2000); }, 1600);
let device let device
@ -99,28 +99,18 @@ let producerVideo
let producerAudio let producerAudio
let consumer let consumer
let originAssetId let originAssetId
// let originAssetName = 'Adi'
// let originAssetTypeName = 'linx'
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions // https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce // https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
let videoParams = { let videoParams = {
// mediasoup params codec : device.rtpCapabilities.codecs
.find((codec) => codec.mimeType.toLowerCase() === 'video/vp9'),
encodings: [ encodings: [
{ { scaleResolutionDownBy: 4, maxBitrate: 500000 },
maxBitrate: 100000, { scaleResolutionDownBy: 2, maxBitrate: 1000000 },
scalabilityMode: 'S1T3', { scaleResolutionDownBy: 1, maxBitrate: 5000000 },
}, { scalabilityMode: 'S3T3_KEY' }
{
maxBitrate: 300000,
scalabilityMode: 'S1T3',
},
{
maxBitrate: 900000,
scalabilityMode: 'S1T3',
},
], ],
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerCodecOptions
codecOptions: { codecOptions: {
videoGoogleStartBitrate: 1000 videoGoogleStartBitrate: 1000
} }
@ -159,14 +149,9 @@ const getLocalStream = () => {
navigator.mediaDevices.getUserMedia({ navigator.mediaDevices.getUserMedia({
audio: true, audio: true,
video: { video: {
width: { qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
min: 640, vga : { width: { ideal: 640 }, height: { ideal: 480 } },
max: 1920, hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
},
height: {
min: 400,
max: 1080,
}
} }
}) })
.then(streamSuccess) .then(streamSuccess)