视频连线
This commit is contained in:
@@ -55,7 +55,7 @@ export async function createWebRtcTransport(params: {
|
||||
enableUdp: true,
|
||||
enableTcp: true,
|
||||
preferUdp: true,
|
||||
initialAvailableOutgoingBitrate: 1_000_000,
|
||||
initialAvailableOutgoingBitrate: 4_000_000,
|
||||
appData: {
|
||||
userId: params.userId,
|
||||
direction: params.direction,
|
||||
@@ -63,6 +63,17 @@ export async function createWebRtcTransport(params: {
|
||||
},
|
||||
});
|
||||
|
||||
if (params.direction === 'send') {
|
||||
try {
|
||||
await transport.setMaxIncomingBitrate(4_000_000);
|
||||
} catch (err) {
|
||||
log.warn(
|
||||
{ transportId: transport.id, err: err instanceof Error ? err.message : String(err) },
|
||||
'set max incoming bitrate failed',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
transport.observer.once('close', () => {
|
||||
transportMap.delete(transport.id);
|
||||
log.info(
|
||||
|
||||
Reference in New Issue
Block a user