diff --git a/plugins/amcrest/package-lock.json b/plugins/amcrest/package-lock.json index 8ad7bc8d4..bc4427395 100644 --- a/plugins/amcrest/package-lock.json +++ b/plugins/amcrest/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/amcrest", - "version": "0.0.101", + "version": "0.0.102", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/amcrest", - "version": "0.0.101", + "version": "0.0.102", "hasInstallScript": true, "license": "Apache", "dependencies": { diff --git a/plugins/amcrest/package.json b/plugins/amcrest/package.json index d24173c25..abf8b30f6 100644 --- a/plugins/amcrest/package.json +++ b/plugins/amcrest/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/amcrest", - "version": "0.0.101", + "version": "0.0.102", "description": "Amcrest Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/amcrest/src/amcrest-api.ts b/plugins/amcrest/src/amcrest-api.ts index 8bf61aa81..a5264bd83 100644 --- a/plugins/amcrest/src/amcrest-api.ts +++ b/plugins/amcrest/src/amcrest-api.ts @@ -21,7 +21,7 @@ export enum AmcrestEvent { } export const amcrestHttpsAgent = new https.Agent({ - rejectUnauthorized: false + rejectUnauthorized: false, }); export class AmcrestCameraClient { @@ -57,6 +57,7 @@ export class AmcrestCameraClient { url, }); const stream = response.data as IncomingMessage; + stream.socket.setKeepAlive(true); let activityTimeout: NodeJS.Timeout; const resetActivityTimeout = () => { clearTimeout(activityTimeout); diff --git a/plugins/hikvision/package-lock.json b/plugins/hikvision/package-lock.json index af0bd5b41..1a875bd2e 100644 --- a/plugins/hikvision/package-lock.json +++ b/plugins/hikvision/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/hikvision", - "version": "0.0.93", + "version": "0.0.94", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/hikvision", - "version": "0.0.93", + "version": "0.0.94", "hasInstallScript": true, "license": "Apache", "dependencies": { diff --git a/plugins/hikvision/package.json b/plugins/hikvision/package.json index ed2a37a36..533cd6a99 100644 --- a/plugins/hikvision/package.json +++ b/plugins/hikvision/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/hikvision", - "version": "0.0.93", + "version": "0.0.94", "description": "HikVision Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/hikvision/src/hikvision-camera-api.ts b/plugins/hikvision/src/hikvision-camera-api.ts index ff052f3db..0598b77f8 100644 --- a/plugins/hikvision/src/hikvision-camera-api.ts +++ b/plugins/hikvision/src/hikvision-camera-api.ts @@ -1,6 +1,7 @@ import { Readable } from 'stream'; import AxiosDigestAuth from '@koush/axios-digest-auth'; import { EventEmitter } from "stream"; +import { IncomingMessage } from 'http'; function getChannel(channel: string) { return channel || '101'; @@ -117,7 +118,8 @@ export class HikVisionCameraAPI { url, responseType: 'stream', }); - const stream = response.data as Readable; + const stream = response.data as IncomingMessage; + stream.socket.setKeepAlive(true); stream.on('data', (buffer: Buffer) => { const data = buffer.toString(); diff --git a/plugins/webrtc/src/wrtc-to-rtsp.ts b/plugins/webrtc/src/wrtc-to-rtsp.ts index 4dc592534..234a7eab0 100644 --- a/plugins/webrtc/src/wrtc-to-rtsp.ts +++ b/plugins/webrtc/src/wrtc-to-rtsp.ts @@ -81,6 +81,7 @@ export async function createRTCPeerConnectionSource(options: { const pc = await peerConnection.promise; audioTransceiver = pc.addTransceiver("audio", setup.audio as any); + audioTransceiver.mid = '0'; audioTransceiver.onTrack.subscribe((track) => { track.onReceiveRtp.subscribe(rtp => { if (!gotAudio) { @@ -93,6 +94,7 @@ export async function createRTCPeerConnectionSource(options: { }); const videoTransceiver = pc.addTransceiver("video", setup.video as any); + videoTransceiver.mid = '1'; videoTransceiver.onTrack.subscribe((track) => { track.onReceiveRtp.subscribe(rtp => { if (!gotVideo) { @@ -157,8 +159,10 @@ export async function createRTCPeerConnectionSource(options: { if (type === 'offer') doSetup(setup); const pc = await peerConnection.promise; - if (setup.datachannel) + if (setup.datachannel) { pc.createDataChannel(setup.datachannel.label, setup.datachannel.dict); + pc.sctpTransport.mid = '2'; + } const gatheringPromise = pc.iceGatheringState === 'complete' ? Promise.resolve(undefined) : new Promise(resolve => pc.iceGatheringStateChange.subscribe(state => { if (state === 'complete')