mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Fix video not showing in Chrome
This commit is contained in:
parent
a009cca866
commit
3a654b99cb
@ -1022,20 +1022,22 @@ function patchRtcCodecs() {
|
|||||||
RTCRtpTransceiver.prototype.setCodecPreferences = function(codecs) {
|
RTCRtpTransceiver.prototype.setCodecPreferences = function(codecs) {
|
||||||
// Use the same codecs as desktop
|
// Use the same codecs as desktop
|
||||||
const newCodecs = codecs.slice();
|
const newCodecs = codecs.slice();
|
||||||
|
let pos = 0;
|
||||||
newCodecs.forEach((codec, i) => {
|
newCodecs.forEach((codec, i) => {
|
||||||
// Find high quality codecs
|
// Find high quality codecs
|
||||||
if (codec.sdpFmtpLine && codec.sdpFmtpLine.includes('profile-level-id=4d')) {
|
if (codec.sdpFmtpLine && codec.sdpFmtpLine.includes('profile-level-id=4d')) {
|
||||||
// Move it to the top of the array
|
// Move it to the top of the array
|
||||||
newCodecs.splice(i, 1);
|
newCodecs.splice(i, 1);
|
||||||
newCodecs.unshift(codec);
|
newCodecs.splice(pos, 0, codec);
|
||||||
|
++pos;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.orgSetCodecPreferences(newCodecs);
|
this.orgSetCodecPreferences.apply(this, [newCodecs]);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
this.orgSetCodecPreferences(codecs);
|
this.orgSetCodecPreferences.apply(this, [codecs]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user