piixishstream 1.0.2 → 1.0.4

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.
@@ -75,7 +75,7 @@ export class WebRtcConnWrapper {
75
75
  const { clockRate } = rtpConfig;
76
76
  if (this.mediaConnection.daveReady)
77
77
  frame = this.mediaConnection.daveSession.encryptOpus(frame);
78
- this._audioTrack?.sendMessageBinary(frame);
78
+ try { this._audioTrack?.sendMessageBinary(frame); } catch (e) { /* ignore SRTP/WebRTC drop errors */ }
79
79
  rtpConfig.timestamp += Math.round((frametime * clockRate) / 1000);
80
80
  }
81
81
  sendVideoFrame(frame, frametime) {
@@ -118,7 +118,7 @@ export class WebRtcConnWrapper {
118
118
  }
119
119
  frame = this.mediaConnection.daveSession.encrypt(1 /* MediaType.VIDEO */, daveCodec, frame);
120
120
  }
121
- this._videoTrack?.sendMessageBinary(frame);
121
+ try { this._videoTrack?.sendMessageBinary(frame); } catch (e) { /* ignore SRTP/WebRTC drop errors */ }
122
122
  rtpConfig.timestamp += Math.round((frametime * clockRate) / 1000);
123
123
  }
124
124
  setPacketizer(videoCodec) {
@@ -186,7 +186,7 @@ export function prepareStream(input, options = {}, cancelSignal) {
186
186
  // realtime control mechanism
187
187
  let currentVolume = 1;
188
188
  let zmqClientPromise;
189
- if (includeAudio && !isBun() && !isDeno()) {
189
+ if (includeAudio && !isBun() && !isDeno() && process.env.ENABLE_ZMQ === "true") {
190
190
  function randomInclusive(start, end) {
191
191
  return Math.floor(Math.random() * (end - start + 1)) + start;
192
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piixishstream",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Experiment for making video streaming work for discord selfbots",
5
5
  "main": "./dist/index.js",
6
6
  "exports": "./dist/index.js",
@@ -80,4 +80,4 @@
80
80
  "node-datachannel"
81
81
  ]
82
82
  }
83
- }
83
+ }
@@ -108,7 +108,7 @@ export class WebRtcConnWrapper {
108
108
  const { clockRate } = rtpConfig;
109
109
  if (this.mediaConnection.daveReady)
110
110
  frame = this.mediaConnection.daveSession!.encryptOpus(frame);
111
- this._audioTrack?.sendMessageBinary(frame);
111
+ try { this._audioTrack?.sendMessageBinary(frame); } catch (e) { /* ignore SRTP/WebRTC drop errors */ }
112
112
  rtpConfig.timestamp += Math.round((frametime * clockRate) / 1000);
113
113
  }
114
114
 
@@ -154,7 +154,7 @@ export class WebRtcConnWrapper {
154
154
  frame,
155
155
  );
156
156
  }
157
- this._videoTrack?.sendMessageBinary(frame);
157
+ try { this._videoTrack?.sendMessageBinary(frame); } catch (e) { /* ignore SRTP/WebRTC drop errors */ }
158
158
  rtpConfig.timestamp += Math.round((frametime * clockRate) / 1000);
159
159
  }
160
160
 
@@ -344,7 +344,7 @@ export function prepareStream(
344
344
  // realtime control mechanism
345
345
  let currentVolume = 1;
346
346
  let zmqClientPromise: Promise<Request> | undefined;
347
- if (includeAudio && !isBun() && !isDeno()) {
347
+ if (includeAudio && !isBun() && !isDeno() && process.env.ENABLE_ZMQ === "true") {
348
348
  function randomInclusive(start: number, end: number) {
349
349
  return Math.floor(Math.random() * (end - start + 1)) + start;
350
350
  }