Skip to content

Commit

Permalink
hikvision: fix two way audio duration
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 25, 2024
1 parent fa5b9f6 commit 6e7f291
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/hikvision/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/hikvision/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/hikvision",
"version": "0.0.137",
"version": "0.0.138",
"description": "Hikvision Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",
Expand Down
8 changes: 7 additions & 1 deletion plugins/hikvision/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class HikvisionCamera extends RtspSmartCamera implements Camera, Intercom, Reboo
const put = this.getClient().request({
url,
method: 'PUT',
responseType: 'readable',
responseType: 'text',
headers: {
'Content-Type': 'application/octet-stream',
// 'Connection': 'close',
Expand Down Expand Up @@ -440,6 +440,12 @@ class HikvisionCamera extends RtspSmartCamera implements Camera, Intercom, Reboo
forwarder.killPromise.finally(() => {
this.console.log('audio finished');
passthrough.end();
setTimeout(() => {
this.stopIntercom();
}, 1000);
});

put.finally(() => {
this.stopIntercom();
});

Expand Down

0 comments on commit 6e7f291

Please sign in to comment.