diff --git a/common/src/rtsp-server.ts b/common/src/rtsp-server.ts index 2d33c77ea..af3b70bcb 100644 --- a/common/src/rtsp-server.ts +++ b/common/src/rtsp-server.ts @@ -56,7 +56,7 @@ export function createRtspParser(): RtspStreamParser { } function parseHeaders(headers: string[]): Headers { - const ret = {}; + const ret: any = {}; for (const header of headers.slice(1)) { const index = header.indexOf(':'); let value = ''; @@ -148,7 +148,7 @@ export class RtspClient extends RtspBase { } async setup(channel: number, path?: string) { - const headers = { + const headers: any = { Transport: `RTP/AVP/TCP;unicast;interleaved=${channel}-${channel + 1}`, }; if (this.session) @@ -160,7 +160,7 @@ export class RtspClient extends RtspBase { } async play() { - const headers = { + const headers: any = { Range: 'npt=0.000-', }; if (this.session) @@ -353,12 +353,13 @@ export class RtspServer { let [method, url] = headers[0].split(' ', 2); method = method.toLowerCase(); const requestHeaders = parseHeaders(headers); - if (!this[method]) { + const thisAny = this as any; + if (!thisAny[method]) { this.respond(400, 'Bad Request', requestHeaders, {}); return; } - await this[method](url, requestHeaders); + await thisAny[method](url, requestHeaders); return method !== 'play' && method !== 'record' && method !== 'teardown'; } diff --git a/common/tsconfig.json b/common/tsconfig.json new file mode 100644 index 000000000..cd66ca1ca --- /dev/null +++ b/common/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "esnext", + "noImplicitAny": true, + "outDir": "./dist", + "esModuleInterop": true, + // skip error: Interface 'WebGL2RenderingContext' incorrectly extends interface 'WebGL2RenderingContextBase'. + // https://github.com/tensorflow/tfjs/issues/4201 + "skipLibCheck": true, + "sourceMap": true + }, + "include": [ + "src/**/*" + ], +} \ No newline at end of file