ring-client-api 11.0.1 → 11.0.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [11.0.2-beta.0](https://github.com/dgreif/ring/compare/v11.0.1...v11.0.2-beta.0) (2022-05-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* handle pcmu audio streams for incoming audio ([06f6ff1](https://github.com/dgreif/ring/commit/06f6ff10ce7c8f2b05b1a12b8f244daa200fa9ab)), closes [#930](https://github.com/dgreif/ring/issues/930)
|
|
11
|
+
|
|
5
12
|
### [11.0.1](https://github.com/dgreif/ring/compare/v11.0.0...v11.0.1) (2022-05-17)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -31,6 +31,12 @@ class WeriftPeerConnection {
|
|
|
31
31
|
clockRate: 48000,
|
|
32
32
|
channels: 2,
|
|
33
33
|
}),
|
|
34
|
+
new werift_1.RTCRtpCodecParameters({
|
|
35
|
+
mimeType: 'audio/PCMU',
|
|
36
|
+
clockRate: 8000,
|
|
37
|
+
channels: 1,
|
|
38
|
+
payloadType: 0,
|
|
39
|
+
}),
|
|
34
40
|
],
|
|
35
41
|
video: [
|
|
36
42
|
new werift_1.RTCRtpCodecParameters({
|
|
@@ -15,6 +15,7 @@ export declare class StreamingSession extends Subscribed {
|
|
|
15
15
|
private readonly camera;
|
|
16
16
|
private connection;
|
|
17
17
|
readonly onCallEnded: ReplaySubject<void>;
|
|
18
|
+
private readonly onUsingOpus;
|
|
18
19
|
readonly onVideoRtp: Subject<RtpPacket>;
|
|
19
20
|
readonly onAudioRtp: Subject<RtpPacket>;
|
|
20
21
|
private readonly audioSplitter;
|
|
@@ -21,6 +21,7 @@ class StreamingSession extends subscribed_1.Subscribed {
|
|
|
21
21
|
this.camera = camera;
|
|
22
22
|
this.connection = connection;
|
|
23
23
|
this.onCallEnded = new rxjs_1.ReplaySubject(1);
|
|
24
|
+
this.onUsingOpus = new rxjs_1.ReplaySubject(1);
|
|
24
25
|
this.onVideoRtp = new rxjs_1.Subject();
|
|
25
26
|
this.onAudioRtp = new rxjs_1.Subject();
|
|
26
27
|
this.audioSplitter = new camera_utils_1.RtpSplitter();
|
|
@@ -30,7 +31,9 @@ class StreamingSession extends subscribed_1.Subscribed {
|
|
|
30
31
|
this.bindToConnection(connection);
|
|
31
32
|
}
|
|
32
33
|
bindToConnection(connection) {
|
|
33
|
-
this.addSubscriptions(connection.onAudioRtp.subscribe(this.onAudioRtp), connection.onVideoRtp.subscribe(this.onVideoRtp))
|
|
34
|
+
this.addSubscriptions(connection.onAudioRtp.subscribe(this.onAudioRtp), connection.onVideoRtp.subscribe(this.onVideoRtp), connection.onCallAnswered.subscribe((sdp) => {
|
|
35
|
+
this.onUsingOpus.next(sdp.toLocaleLowerCase().includes(' opus/'));
|
|
36
|
+
}));
|
|
34
37
|
}
|
|
35
38
|
async activate() {
|
|
36
39
|
if (this.activated) {
|
|
@@ -51,18 +54,18 @@ class StreamingSession extends subscribed_1.Subscribed {
|
|
|
51
54
|
return ports[0];
|
|
52
55
|
}
|
|
53
56
|
async startTranscoding(ffmpegOptions) {
|
|
54
|
-
const videoPort = await this.reservePort(1), audioPort = await this.reservePort(1), transcodeVideoStream = ffmpegOptions.video !== false, ffmpegInputArguments = [
|
|
57
|
+
const videoPort = await this.reservePort(1), audioPort = await this.reservePort(1), transcodeVideoStream = ffmpegOptions.video !== false, ringSdp = await (0, rxjs_1.firstValueFrom)(this.connection.onCallAnswered), usingOpus = await (0, rxjs_1.firstValueFrom)(this.onUsingOpus), ffmpegInputArguments = [
|
|
55
58
|
'-hide_banner',
|
|
56
59
|
'-protocol_whitelist',
|
|
57
60
|
'pipe,udp,rtp,file,crypto',
|
|
58
|
-
|
|
59
|
-
'libopus',
|
|
61
|
+
// Ring will answer with either opus or pcmu
|
|
62
|
+
...(usingOpus ? ['-acodec', 'libopus'] : []),
|
|
60
63
|
'-f',
|
|
61
64
|
'sdp',
|
|
62
65
|
...(ffmpegOptions.input || []),
|
|
63
66
|
'-i',
|
|
64
67
|
'pipe:',
|
|
65
|
-
],
|
|
68
|
+
], inputSdp = getCleanSdp(ringSdp, transcodeVideoStream)
|
|
66
69
|
.replace(/m=audio \d+/, `m=audio ${audioPort}`)
|
|
67
70
|
.replace(/m=video \d+/, `m=video ${videoPort}`), ff = new camera_utils_1.FfmpegProcess({
|
|
68
71
|
ffmpegArgs: ffmpegInputArguments.concat(...(ffmpegOptions.audio || ['-acodec', 'aac']), ...(transcodeVideoStream
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ring-client-api",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.2-beta.0",
|
|
4
4
|
"description": "Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting",
|
|
5
5
|
"main": "lib/api/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"lint": "eslint '**/*.ts' --fix",
|
|
16
16
|
"build": "rm -rf lib && tsc --declaration",
|
|
17
17
|
"build-quick": "rm -rf lib && esbuild ./{api,examples,homebridge}/*.ts ./api/streaming/*.ts --target=es2017 --format=cjs --outdir=lib",
|
|
18
|
-
"example": "node -r @swc-node/register ./
|
|
19
|
-
"api-example": "node -r @swc-node/register ./
|
|
20
|
-
"record-example": "node -r @swc-node/register ./
|
|
21
|
-
"return-audio-example": "node -r @swc-node/register ./
|
|
22
|
-
"stream-example": "node -r @swc-node/register ./
|
|
23
|
-
"browser-example": "node -r @swc-node/register ./
|
|
18
|
+
"example": "node -r @swc-node/register ./examples/example.ts",
|
|
19
|
+
"api-example": "node -r @swc-node/register ./examples/api-example.ts",
|
|
20
|
+
"record-example": "node -r @swc-node/register ./examples/record-example.ts",
|
|
21
|
+
"return-audio-example": "node -r @swc-node/register ./examples/return-audio-example.ts",
|
|
22
|
+
"stream-example": "node -r @swc-node/register ./examples/stream-example.ts",
|
|
23
|
+
"browser-example": "node -r @swc-node/register ./examples/browser-example.ts",
|
|
24
24
|
"auth-cli": "npm run build-quick && ./ring-auth-cli.js",
|
|
25
25
|
"device-data-cli": "npm run build-quick && ./ring-device-data-cli.js",
|
|
26
26
|
"hb": "npm run build-quick && ./build/package-homebridge.sh && homebridge -P ./release-homebridge -U ./.homebridge",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@eneris/push-receiver": "^3.0.1",
|
|
59
59
|
"@homebridge/camera-utils": "^2.1.0",
|
|
60
60
|
"@homebridge/plugin-ui-utils": "^0.0.19",
|
|
61
|
-
"werift": "^0.15.
|
|
61
|
+
"werift": "^0.15.1",
|
|
62
62
|
"@types/socket.io-client": "1.4.36",
|
|
63
63
|
"colors": "^1.4.0",
|
|
64
64
|
"debug": "^4.3.4",
|