Send answer on createSendTransport with 7s delay

This commit is contained in:
Sergiu Toma 2022-09-05 18:07:35 +03:00
parent 5373b58e99
commit ab540b276a

View File

@ -208,7 +208,7 @@ const getRtpCapabilities = () => {
const createSendTransport = () => {
setTimeout(() => {
const answer = {
origin_asset_id: ASSET_ID,
dest_asset_id: originAssetId || parseInt(urlParams.get('dest_asset_id')),
@ -225,6 +225,7 @@ const createSendTransport = () => {
JSON.stringify(answer)
);
// see server's socket.on('createWebRtcTransport', sender?, ...)
// this is a call from Producer, so sender = true
socket.emit('createWebRtcTransport', { sender: true, callId }, ({ params }) => {
@ -286,6 +287,10 @@ const createSendTransport = () => {
})
connectSendTransport()
})
}, 7000);
}
const connectSendTransport = async () => {