We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
[email protected]
If Resolution OR RateControl is missing, node-onvif will crash. this fixed this. See also #37
The error message is Cannot read property width of undefined
Cannot read property width of undefined
Here is the diff that solved my problem:
diff --git a/node_modules/node-onvif/lib/modules/device.js b/node_modules/node-onvif/lib/modules/device.js index 65ddf42..087d142 100644 --- a/node_modules/node-onvif/lib/modules/device.js +++ b/node_modules/node-onvif/lib/modules/device.js @@ -528,12 +528,12 @@ OnvifDevice.prototype._mediaGetProfiles = function () { 'token': p['VideoEncoderConfiguration']['$']['token'], 'name': p['VideoEncoderConfiguration']['Name'], 'resolution': { - 'width': parseInt(p['VideoEncoderConfiguration']['Resolution']['Width'], 10), - 'height': parseInt(p['VideoEncoderConfiguration']['Resolution']['Height'], 10), + 'width': parseInt((p['VideoEncoderConfiguration']['Resolution'] || {})['Width'], 10), + 'height': parseInt((p['VideoEncoderConfiguration']['Resolution'] || {})['Height'], 10), }, 'quality': parseInt(p['VideoEncoderConfiguration']['Quality'], 10), - 'framerate': parseInt(p['VideoEncoderConfiguration']['RateControl']['FrameRateLimit'], 10), - 'bitrate': parseInt(p['VideoEncoderConfiguration']['RateControl']['BitrateLimit'], 10), + 'framerate': parseInt((p['VideoEncoderConfiguration']['RateControl'] || {})['FrameRateLimit'], 10), + 'bitrate': parseInt((p['VideoEncoderConfiguration']['RateControl'] || {})['BitrateLimit'], 10), 'encoding': p['VideoEncoderConfiguration']['Encoding'] }; }
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.If Resolution OR RateControl is missing, node-onvif will crash. this fixed this. See also #37
The error message is
Cannot read property width of undefined
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: