fix stereo for chromium. (#18)

This commit is contained in:
Miroslav Šedivý 2023-01-13 12:02:35 +01:00 committed by GitHub
parent 1434d308ba
commit 737bf7da02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,6 +233,10 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
}
const answer = await this._peer.createAnswer()
// add stereo=1 to answer sdp to enable stereo audio for chromium
answer.sdp = answer.sdp?.replace(/(stereo=1;)?useinbandfec=1/, 'useinbandfec=1;stereo=1')
this._peer.setLocalDescription(answer)
if (answer) {