homekit: fix remote detection

This commit is contained in:
Koushik Dutta
2022-04-19 09:15:06 -07:00
parent 025b669ed0
commit db0db372f5
3 changed files with 9 additions and 5 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/homekit",
"version": "0.0.244",
"version": "0.0.245",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/homekit",
"version": "0.0.244",
"version": "0.0.245",
"dependencies": {
"@koush/qrcode-terminal": "^0.12.0",
"check-disk-space": "^3.3.0",

View File

@@ -44,5 +44,5 @@
"@types/node": "^14.17.9",
"@types/url-parse": "^1.4.3"
},
"version": "0.0.244"
"version": "0.0.245"
}

View File

@@ -56,8 +56,12 @@ export async function getStreamingConfiguration(device: ScryptedDevice & VideoCa
catch (e) {
}
// Have only ever seen 20 and 60 sent here. 60 is remote stream and watch.
const isLowBandwidth = request.audio.packet_time > 20;
// Observed packet times:
// Opus (Local): 20
// Opus (Remote): 60
// AAC-ELD (Local): 30
// AAC-ELD (Remote): 60
const isLowBandwidth = request.audio.packet_time >= 60;
// watch is 448x368 and requests 320x240, everything else is > ~1280...
// future proof-ish for higher resolution watch.