mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Fix no audio when the stream drops (#259)
This commit is contained in:
parent
9786c7c8ee
commit
11f3513b0c
@ -10819,6 +10819,7 @@ if (getPref(Preferences.AUDIO_ENABLE_VOLUME_CONTROL)) {
|
||||
window.AudioContext = function() {
|
||||
const ctx = new OrgAudioContext();
|
||||
STREAM_AUDIO_CONTEXT = ctx;
|
||||
STREAM_AUDIO_GAIN_NODE = null;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
@ -10866,6 +10867,13 @@ RTCPeerConnection.prototype.createDataChannel = function() {
|
||||
const OrgRTCPeerConnection = window.RTCPeerConnection;
|
||||
window.RTCPeerConnection = function() {
|
||||
STREAM_WEBRTC = new OrgRTCPeerConnection();
|
||||
|
||||
STREAM_WEBRTC.addEventListener('connectionstatechange', e => {
|
||||
if (STREAM_WEBRTC.connectionState === 'connecting') {
|
||||
STREAM_AUDIO_GAIN_NODE = null;
|
||||
}
|
||||
console.log('connectionState', STREAM_WEBRTC.connectionState);
|
||||
});
|
||||
return STREAM_WEBRTC;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user