beele / homebridge-unifi-protect-camera-motion

Camera & Motion sensor support for Unifi Protect cameras in Homekit via Homebridge
Apache License 2.0
103 stars 12 forks source link

Can't view live stream when tapping camera #87

Closed Calimerorulez closed 2 years ago

Calimerorulez commented 3 years ago

Hi,

When I tap a camera in Homekit, the plugin generates the following error/warning:

[6/10/2021, 12:53:59 PM] [Unifi protect cameras & motion sensors] Motion checking setup done!
(node:21188) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'alias' of undefined
    at Function.generateStreamingUrlForBestMatchingResolution (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi/unifi.js:193:21)
    at UnifiStreamingDelegate.startStream (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/streaming/unifi-streaming-delegate.js:101:44)
    at UnifiStreamingDelegate.handleStreamRequest (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/streaming/unifi-streaming-delegate.js:82:22)
    at RTPStreamManagement._handleStartStream (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/camera/RTPStreamManagement.ts:816:19)
    at RTPStreamManagement._handleSelectedStreamConfigurationWrite (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/camera/RTPStreamManagement.ts:647:14)
    at SelectedRTPStreamConfiguration.emit (events.js:376:20)
    at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1632:16
    at new Promise (<anonymous>)
    at SelectedRTPStreamConfiguration.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1630:14)
    at step (/usr/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21188) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:21188) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The camera view isn't updated, and only shows a spinning wheel. When I go back to the main Homekit view, the camera is updated normally, every 10 seconds again.

Using Protect 1.19.0-beta.10, node v14.17.0, npm v6.14.13, latest Homebridge, and latest plugin version.

jinie commented 3 years ago

The latest version has some kind of dependency of Mqtt, so if you're not using mqtt it will fail. Downgrade to the previous version and it works fine. I'm using 0.4.3.

maloo0 commented 3 years ago

Same issue here. Downgrade to 0.4.3 didn‘t help unfortunately.

The stream is not working on iPhones. But on iPad it‘s working. Don‘t know why. Does anyone have an idea?

beele commented 2 years ago

should be fixed with 0.4.6