videomail-client 15.9.1 → 15.10.1
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/README.md +4 -5
- package/dist/cjs/index.cjs +36 -6
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +25 -6
- package/dist/esm/types/Videomail.d.ts +1 -0
- package/dist/esm/wrappers/visuals/recorder.d.ts +5 -0
- package/dist/esm/wrappers/visuals.d.ts +4 -0
- package/dist/umd/index.js +25 -5
- package/package.json +3 -3
- package/dist/esm/types/identifier.d.ts +0 -1
package/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/binarykitchen/videomail-client/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
[![npm][npm-image]][npm-url]
|
|
6
|
-
[![downloads][downloads-image]][downloads-url]
|
|
7
|
-
[](https://app.netlify.com/sites/videomail-client/deploys)
|
|
5
|
+
[![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [](https://app.netlify.com/sites/videomail-client/deploys)
|
|
8
6
|
|
|
9
7
|
[npm-image]: https://img.shields.io/npm/v/videomail-client.svg?style=flat
|
|
10
8
|
[npm-url]: https://npmjs.org/package/videomail-client
|
|
@@ -255,6 +253,8 @@ Updates the recording time limit for subsequent recording activity.
|
|
|
255
253
|
|
|
256
254
|
The `SUBMITTED` event includes a `videomail` object. The exact response can evolve, but its shape follows the exported `Videomail` type. A shortened example is shown below:
|
|
257
255
|
|
|
256
|
+
For new recordings, submitted `width` and `height` describe the captured canvas frames, not the browser viewport or the resized preview. These dimensions survive stopping the camera and are replaced when recording again.
|
|
257
|
+
|
|
258
258
|
```json
|
|
259
259
|
{
|
|
260
260
|
"subject": "some subject",
|
|
@@ -344,8 +344,7 @@ See [Can I Use: Media Capture from DOM Elements](https://caniuse.com/stream) and
|
|
|
344
344
|
|
|
345
345
|
## Add-ons
|
|
346
346
|
|
|
347
|
-
There is also a Videomail WordPress add-on:
|
|
348
|
-
<https://wordpress.org/plugins/videomail-for-ninja-forms/>
|
|
347
|
+
There is also a Videomail WordPress add-on: <https://wordpress.org/plugins/videomail-for-ninja-forms/>
|
|
349
348
|
|
|
350
349
|
It extends the Ninja Forms form builder with a webcam input and submission integration.
|
|
351
350
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -10972,7 +10972,7 @@ var __webpack_exports__ = {};
|
|
|
10972
10972
|
var client = __webpack_require__("Q");
|
|
10973
10973
|
var client_default = /*#__PURE__*/ __webpack_require__.n(client);
|
|
10974
10974
|
var package_namespaceObject = {
|
|
10975
|
-
rE: "15.
|
|
10975
|
+
rE: "15.10.1"
|
|
10976
10976
|
};
|
|
10977
10977
|
function isAudioEnabled(options) {
|
|
10978
10978
|
return Boolean(options.audio.enabled);
|
|
@@ -19594,6 +19594,19 @@ var __webpack_exports__ = {};
|
|
|
19594
19594
|
else obj[key] = value;
|
|
19595
19595
|
return obj;
|
|
19596
19596
|
}
|
|
19597
|
+
function recorder_object_spread(target) {
|
|
19598
|
+
for(var i = 1; i < arguments.length; i++){
|
|
19599
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
19600
|
+
var ownKeys = Object.keys(source);
|
|
19601
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
19602
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19603
|
+
}));
|
|
19604
|
+
ownKeys.forEach(function(key) {
|
|
19605
|
+
recorder_define_property(target, key, source[key]);
|
|
19606
|
+
});
|
|
19607
|
+
}
|
|
19608
|
+
return target;
|
|
19609
|
+
}
|
|
19597
19610
|
const PIPE_SYMBOL = "°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸ ";
|
|
19598
19611
|
class Recorder extends util_Despot {
|
|
19599
19612
|
writeStream(buffer, opts) {
|
|
@@ -20367,6 +20380,7 @@ var __webpack_exports__ = {};
|
|
|
20367
20380
|
}
|
|
20368
20381
|
back(cb) {
|
|
20369
20382
|
this.emit("GOING_BACK");
|
|
20383
|
+
this.recordingDimensions = void 0;
|
|
20370
20384
|
this.unloaded = false;
|
|
20371
20385
|
this.show();
|
|
20372
20386
|
this.writeCommand("back", void 0, cb);
|
|
@@ -20377,6 +20391,7 @@ var __webpack_exports__ = {};
|
|
|
20377
20391
|
this.clearUserMediaTimeout();
|
|
20378
20392
|
this.userMediaLoading = false;
|
|
20379
20393
|
null == (_this_userMedia = this.userMedia) || _this_userMedia.stop();
|
|
20394
|
+
this.recordingDimensions = void 0;
|
|
20380
20395
|
this.userMediaLoaded = this.key = this.canvas = this.ctx = void 0;
|
|
20381
20396
|
this.loadUserMedia();
|
|
20382
20397
|
}
|
|
@@ -20388,6 +20403,7 @@ var __webpack_exports__ = {};
|
|
|
20388
20403
|
const prettyCause = cause ? `, cause: ${cause}` : "";
|
|
20389
20404
|
this.options.logger.debug(`Recorder: unload()${prettyCause}`);
|
|
20390
20405
|
this.reset();
|
|
20406
|
+
this.recordingDimensions = void 0;
|
|
20391
20407
|
this.clearUserMediaTimeout();
|
|
20392
20408
|
this.clearConnectionTimeout();
|
|
20393
20409
|
this.clearReconnectTimeout();
|
|
@@ -20530,6 +20546,7 @@ var __webpack_exports__ = {};
|
|
|
20530
20546
|
}
|
|
20531
20547
|
return;
|
|
20532
20548
|
}
|
|
20549
|
+
this.recordingDimensions = void 0;
|
|
20533
20550
|
try {
|
|
20534
20551
|
if (!this.userMedia) throw new Error("No user media defined, unable to create canvas");
|
|
20535
20552
|
this.canvas = this.userMedia.createCanvas();
|
|
@@ -20564,6 +20581,10 @@ var __webpack_exports__ = {};
|
|
|
20564
20581
|
});
|
|
20565
20582
|
return;
|
|
20566
20583
|
}
|
|
20584
|
+
this.recordingDimensions = {
|
|
20585
|
+
width: this.canvas.width,
|
|
20586
|
+
height: this.canvas.height
|
|
20587
|
+
};
|
|
20567
20588
|
this.frame = new canvas_to_buffer_modern_r(this.canvas, this.options.image.types, this.options.image.quality);
|
|
20568
20589
|
this.options.logger.debug("Recorder: record()");
|
|
20569
20590
|
this.userMedia.record();
|
|
@@ -20732,6 +20753,9 @@ var __webpack_exports__ = {};
|
|
|
20732
20753
|
};
|
|
20733
20754
|
return dimension;
|
|
20734
20755
|
}
|
|
20756
|
+
getRecordingDimensions() {
|
|
20757
|
+
return this.recordingDimensions && recorder_object_spread({}, this.recordingDimensions);
|
|
20758
|
+
}
|
|
20735
20759
|
getRecorderHeight(responsive, useBoundingClientRect) {
|
|
20736
20760
|
let recorderHeight;
|
|
20737
20761
|
if (this.recorderElement && useBoundingClientRect) {
|
|
@@ -20816,7 +20840,7 @@ var __webpack_exports__ = {};
|
|
|
20816
20840
|
return this.userMediaLoaded;
|
|
20817
20841
|
}
|
|
20818
20842
|
constructor(visuals, replay, options){
|
|
20819
|
-
super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "reconnectTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "stopTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "reconnecting", false), recorder_define_property(this, "reconnectAttempts", 0), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "lastSocketError", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
|
|
20843
|
+
super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "reconnectTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "stopTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "recordingDimensions", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "reconnecting", false), recorder_define_property(this, "reconnectAttempts", 0), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "lastSocketError", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
|
|
20820
20844
|
this.visuals = visuals;
|
|
20821
20845
|
this.replay = replay;
|
|
20822
20846
|
this.facingMode = options.video.facingMode;
|
|
@@ -21285,6 +21309,9 @@ var __webpack_exports__ = {};
|
|
|
21285
21309
|
getRecordingStats() {
|
|
21286
21310
|
return this.recorder.getRecordingStats();
|
|
21287
21311
|
}
|
|
21312
|
+
getRecordingDimensions() {
|
|
21313
|
+
return this.recorder.getRecordingDimensions();
|
|
21314
|
+
}
|
|
21288
21315
|
getAudioSampleRate() {
|
|
21289
21316
|
return this.recorder.getAudioSampleRate();
|
|
21290
21317
|
}
|
|
@@ -21577,10 +21604,13 @@ var __webpack_exports__ = {};
|
|
|
21577
21604
|
if (!videomailFormData) throw new Error("No videomail form data defined");
|
|
21578
21605
|
if (method === FormMethod.POST) {
|
|
21579
21606
|
videomailFormData.recordingStats = this.visuals.getRecordingStats();
|
|
21580
|
-
const
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21607
|
+
const dimensions = this.visuals.getRecordingDimensions();
|
|
21608
|
+
if (!dimensions) throw error_createError({
|
|
21609
|
+
message: "Recorded frame dimensions are missing.",
|
|
21610
|
+
options: this.options
|
|
21611
|
+
});
|
|
21612
|
+
videomailFormData.width = dimensions.width;
|
|
21613
|
+
videomailFormData.height = dimensions.height;
|
|
21584
21614
|
return yield this.resource.post(videomailFormData);
|
|
21585
21615
|
} else if (method === FormMethod.PUT) return yield this.resource.put(videomailFormData);
|
|
21586
21616
|
throw error_createError({
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -8,12 +8,12 @@ export type { EmailAddress, EmailAddresses } from "./types/EmailAddress.js";
|
|
|
8
8
|
export type { FullVideomailErrorData, VideomailErrorData } from "./types/error.js";
|
|
9
9
|
export type { VideomailEvents } from "./types/events/index.js";
|
|
10
10
|
export type * from "./types/events/params.js";
|
|
11
|
-
export type { VideomailIdentifier } from "./types/identifier.js";
|
|
12
11
|
export type { PartialVideomailClientOptions, VideomailClientOptions, } from "./types/options.js";
|
|
13
12
|
export type { ReactionKey, ReactionLabel, ReactionPrettyByUserKey, ReactionsByUserKey, ReactionsPrettyByUserKey, ReactionType, } from "./types/reaction.js";
|
|
14
13
|
export { Reactions } from "./types/reaction.js";
|
|
15
14
|
export type { RecordingStats } from "./types/RecordingStats.js";
|
|
16
15
|
export type { VideomailThread } from "./types/thread.js";
|
|
17
16
|
export type { PartialVideomail, Videomail } from "./types/Videomail.js";
|
|
17
|
+
export type { VideomailIdentifierType } from "./types/Videomail.js";
|
|
18
18
|
export type { VideoTypeType } from "./types/VideoType.js";
|
|
19
19
|
export { VideoType };
|
package/dist/esm/index.js
CHANGED
|
@@ -3620,7 +3620,7 @@ const constants = {
|
|
|
3620
3620
|
}
|
|
3621
3621
|
};
|
|
3622
3622
|
var package_namespaceObject = {
|
|
3623
|
-
rE: "15.
|
|
3623
|
+
rE: "15.10.1"
|
|
3624
3624
|
};
|
|
3625
3625
|
function isAudioEnabled(options) {
|
|
3626
3626
|
return Boolean(options.audio.enabled);
|
|
@@ -7387,6 +7387,7 @@ class Recorder extends util_Despot {
|
|
|
7387
7387
|
}
|
|
7388
7388
|
back(cb) {
|
|
7389
7389
|
this.emit("GOING_BACK");
|
|
7390
|
+
this.recordingDimensions = void 0;
|
|
7390
7391
|
this.unloaded = false;
|
|
7391
7392
|
this.show();
|
|
7392
7393
|
this.writeCommand("back", void 0, cb);
|
|
@@ -7396,6 +7397,7 @@ class Recorder extends util_Despot {
|
|
|
7396
7397
|
this.clearUserMediaTimeout();
|
|
7397
7398
|
this.userMediaLoading = false;
|
|
7398
7399
|
this.userMedia?.stop();
|
|
7400
|
+
this.recordingDimensions = void 0;
|
|
7399
7401
|
this.userMediaLoaded = this.key = this.canvas = this.ctx = void 0;
|
|
7400
7402
|
this.loadUserMedia();
|
|
7401
7403
|
}
|
|
@@ -7407,6 +7409,7 @@ class Recorder extends util_Despot {
|
|
|
7407
7409
|
const prettyCause = cause ? `, cause: ${cause}` : "";
|
|
7408
7410
|
this.options.logger.debug(`Recorder: unload()${prettyCause}`);
|
|
7409
7411
|
this.reset();
|
|
7412
|
+
this.recordingDimensions = void 0;
|
|
7410
7413
|
this.clearUserMediaTimeout();
|
|
7411
7414
|
this.clearConnectionTimeout();
|
|
7412
7415
|
this.clearReconnectTimeout();
|
|
@@ -7544,6 +7547,7 @@ class Recorder extends util_Despot {
|
|
|
7544
7547
|
}
|
|
7545
7548
|
return;
|
|
7546
7549
|
}
|
|
7550
|
+
this.recordingDimensions = void 0;
|
|
7547
7551
|
try {
|
|
7548
7552
|
if (!this.userMedia) throw new Error("No user media defined, unable to create canvas");
|
|
7549
7553
|
this.canvas = this.userMedia.createCanvas();
|
|
@@ -7578,6 +7582,10 @@ class Recorder extends util_Despot {
|
|
|
7578
7582
|
});
|
|
7579
7583
|
return;
|
|
7580
7584
|
}
|
|
7585
|
+
this.recordingDimensions = {
|
|
7586
|
+
width: this.canvas.width,
|
|
7587
|
+
height: this.canvas.height
|
|
7588
|
+
};
|
|
7581
7589
|
this.frame = new canvas_to_buffer(this.canvas, this.options.image.types, this.options.image.quality);
|
|
7582
7590
|
this.options.logger.debug("Recorder: record()");
|
|
7583
7591
|
this.userMedia.record();
|
|
@@ -7742,6 +7750,11 @@ class Recorder extends util_Despot {
|
|
|
7742
7750
|
};
|
|
7743
7751
|
return dimension;
|
|
7744
7752
|
}
|
|
7753
|
+
getRecordingDimensions() {
|
|
7754
|
+
return this.recordingDimensions && {
|
|
7755
|
+
...this.recordingDimensions
|
|
7756
|
+
};
|
|
7757
|
+
}
|
|
7745
7758
|
getRecorderHeight(responsive, useBoundingClientRect) {
|
|
7746
7759
|
let recorderHeight;
|
|
7747
7760
|
if (this.recorderElement && useBoundingClientRect) {
|
|
@@ -7826,7 +7839,7 @@ class Recorder extends util_Despot {
|
|
|
7826
7839
|
return this.userMediaLoaded;
|
|
7827
7840
|
}
|
|
7828
7841
|
constructor(visuals, replay, options){
|
|
7829
|
-
super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "reconnectTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "stopTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "reconnecting", false), recorder_define_property(this, "reconnectAttempts", 0), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "lastSocketError", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
|
|
7842
|
+
super("Recorder", options), recorder_define_property(this, "visuals", void 0), recorder_define_property(this, "replay", void 0), recorder_define_property(this, "loop", void 0), recorder_define_property(this, "originalAnimationFrameObject", void 0), recorder_define_property(this, "samplesCount", 0), recorder_define_property(this, "framesCount", 0), recorder_define_property(this, "recordingStats", void 0), recorder_define_property(this, "confirmedFrameNumber", 0), recorder_define_property(this, "confirmedSampleNumber", 0), recorder_define_property(this, "recorderElement", void 0), recorder_define_property(this, "userMedia", void 0), recorder_define_property(this, "userMediaTimeout", void 0), recorder_define_property(this, "retryTimeout", void 0), recorder_define_property(this, "reconnectTimeout", void 0), recorder_define_property(this, "connectionTimeout", void 0), recorder_define_property(this, "stopTimeout", void 0), recorder_define_property(this, "frameProgress", void 0), recorder_define_property(this, "sampleProgress", void 0), recorder_define_property(this, "canvas", void 0), recorder_define_property(this, "recordingDimensions", void 0), recorder_define_property(this, "ctx", void 0), recorder_define_property(this, "userMediaLoaded", void 0), recorder_define_property(this, "userMediaLoading", false), recorder_define_property(this, "submitting", false), recorder_define_property(this, "unloaded", void 0), recorder_define_property(this, "stopTime", void 0), recorder_define_property(this, "stream", void 0), recorder_define_property(this, "connecting", false), recorder_define_property(this, "connected", false), recorder_define_property(this, "connectionFailed", false), recorder_define_property(this, "reconnecting", false), recorder_define_property(this, "reconnectAttempts", 0), recorder_define_property(this, "blocking", false), recorder_define_property(this, "built", false), recorder_define_property(this, "key", void 0), recorder_define_property(this, "waitingTime", void 0), recorder_define_property(this, "connectingStartedAt", void 0), recorder_define_property(this, "lastCloseEvent", void 0), recorder_define_property(this, "lastSocketError", void 0), recorder_define_property(this, "pingInterval", void 0), recorder_define_property(this, "frame", void 0), recorder_define_property(this, "recordingBuffer", void 0), recorder_define_property(this, "facingMode", void 0);
|
|
7830
7843
|
this.visuals = visuals;
|
|
7831
7844
|
this.replay = replay;
|
|
7832
7845
|
this.facingMode = options.video.facingMode;
|
|
@@ -8274,6 +8287,9 @@ class Visuals extends util_Despot {
|
|
|
8274
8287
|
getRecordingStats() {
|
|
8275
8288
|
return this.recorder.getRecordingStats();
|
|
8276
8289
|
}
|
|
8290
|
+
getRecordingDimensions() {
|
|
8291
|
+
return this.recorder.getRecordingDimensions();
|
|
8292
|
+
}
|
|
8277
8293
|
getAudioSampleRate() {
|
|
8278
8294
|
return this.recorder.getAudioSampleRate();
|
|
8279
8295
|
}
|
|
@@ -8533,10 +8549,13 @@ class Container extends util_Despot {
|
|
|
8533
8549
|
if (!videomailFormData) throw new Error("No videomail form data defined");
|
|
8534
8550
|
if (method === FormMethod.POST) {
|
|
8535
8551
|
videomailFormData.recordingStats = this.visuals.getRecordingStats();
|
|
8536
|
-
const
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8552
|
+
const dimensions = this.visuals.getRecordingDimensions();
|
|
8553
|
+
if (!dimensions) throw error_createError({
|
|
8554
|
+
message: "Recorded frame dimensions are missing.",
|
|
8555
|
+
options: this.options
|
|
8556
|
+
});
|
|
8557
|
+
videomailFormData.width = dimensions.width;
|
|
8558
|
+
videomailFormData.height = dimensions.height;
|
|
8540
8559
|
return await this.resource.post(videomailFormData);
|
|
8541
8560
|
} else if (method === FormMethod.PUT) return await this.resource.put(videomailFormData);
|
|
8542
8561
|
throw error_createError({
|
|
@@ -6,6 +6,7 @@ import { ReactionsByUserKey, ReactionsPrettyByUserKey } from "./reaction.js";
|
|
|
6
6
|
import { RecordingStats } from "./RecordingStats.js";
|
|
7
7
|
import { UserKey } from "./user.js";
|
|
8
8
|
import VideoFormat from "./VideoFormat.js";
|
|
9
|
+
export type VideomailIdentifierType = "snapshot" | "thread";
|
|
9
10
|
export interface Videomail {
|
|
10
11
|
url: string;
|
|
11
12
|
subject?: string;
|
|
@@ -31,6 +31,7 @@ declare class Recorder extends Despot {
|
|
|
31
31
|
private frameProgress?;
|
|
32
32
|
private sampleProgress?;
|
|
33
33
|
private canvas?;
|
|
34
|
+
private recordingDimensions?;
|
|
34
35
|
private ctx?;
|
|
35
36
|
private userMediaLoaded?;
|
|
36
37
|
private userMediaLoading;
|
|
@@ -119,6 +120,10 @@ declare class Recorder extends Despot {
|
|
|
119
120
|
hide(): void;
|
|
120
121
|
isUnloaded(): boolean | undefined;
|
|
121
122
|
getRecorderWidth(responsive: boolean): Dimension | undefined;
|
|
123
|
+
getRecordingDimensions(): {
|
|
124
|
+
height: number;
|
|
125
|
+
width: number;
|
|
126
|
+
} | undefined;
|
|
122
127
|
getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
|
|
123
128
|
getRatio(): number | undefined;
|
|
124
129
|
calculateWidth(responsive: boolean): Dimension;
|
|
@@ -43,6 +43,10 @@ declare class Visuals extends Despot {
|
|
|
43
43
|
getRecorder(): Recorder;
|
|
44
44
|
validate(): boolean;
|
|
45
45
|
getRecordingStats(): import("../index.js").RecordingStats | undefined;
|
|
46
|
+
getRecordingDimensions(): {
|
|
47
|
+
height: number;
|
|
48
|
+
width: number;
|
|
49
|
+
} | undefined;
|
|
46
50
|
getAudioSampleRate(): number | undefined;
|
|
47
51
|
isPaused(): boolean | undefined;
|
|
48
52
|
error(err: VideomailError): void;
|
package/dist/umd/index.js
CHANGED
|
@@ -10978,7 +10978,7 @@
|
|
|
10978
10978
|
var client = __webpack_require__("Q");
|
|
10979
10979
|
var client_default = /*#__PURE__*/ __webpack_require__.n(client);
|
|
10980
10980
|
var package_namespaceObject = {
|
|
10981
|
-
rE: "15.
|
|
10981
|
+
rE: "15.10.1"
|
|
10982
10982
|
};
|
|
10983
10983
|
function isAudioEnabled(options) {
|
|
10984
10984
|
return Boolean(options.audio.enabled);
|
|
@@ -19348,6 +19348,7 @@
|
|
|
19348
19348
|
frameProgress;
|
|
19349
19349
|
sampleProgress;
|
|
19350
19350
|
canvas;
|
|
19351
|
+
recordingDimensions;
|
|
19351
19352
|
ctx;
|
|
19352
19353
|
userMediaLoaded;
|
|
19353
19354
|
userMediaLoading = false;
|
|
@@ -20139,6 +20140,7 @@
|
|
|
20139
20140
|
}
|
|
20140
20141
|
back(cb) {
|
|
20141
20142
|
this.emit("GOING_BACK");
|
|
20143
|
+
this.recordingDimensions = void 0;
|
|
20142
20144
|
this.unloaded = false;
|
|
20143
20145
|
this.show();
|
|
20144
20146
|
this.writeCommand("back", void 0, cb);
|
|
@@ -20148,6 +20150,7 @@
|
|
|
20148
20150
|
this.clearUserMediaTimeout();
|
|
20149
20151
|
this.userMediaLoading = false;
|
|
20150
20152
|
this.userMedia?.stop();
|
|
20153
|
+
this.recordingDimensions = void 0;
|
|
20151
20154
|
this.userMediaLoaded = this.key = this.canvas = this.ctx = void 0;
|
|
20152
20155
|
this.loadUserMedia();
|
|
20153
20156
|
}
|
|
@@ -20159,6 +20162,7 @@
|
|
|
20159
20162
|
const prettyCause = cause ? `, cause: ${cause}` : "";
|
|
20160
20163
|
this.options.logger.debug(`Recorder: unload()${prettyCause}`);
|
|
20161
20164
|
this.reset();
|
|
20165
|
+
this.recordingDimensions = void 0;
|
|
20162
20166
|
this.clearUserMediaTimeout();
|
|
20163
20167
|
this.clearConnectionTimeout();
|
|
20164
20168
|
this.clearReconnectTimeout();
|
|
@@ -20296,6 +20300,7 @@
|
|
|
20296
20300
|
}
|
|
20297
20301
|
return;
|
|
20298
20302
|
}
|
|
20303
|
+
this.recordingDimensions = void 0;
|
|
20299
20304
|
try {
|
|
20300
20305
|
if (!this.userMedia) throw new Error("No user media defined, unable to create canvas");
|
|
20301
20306
|
this.canvas = this.userMedia.createCanvas();
|
|
@@ -20330,6 +20335,10 @@
|
|
|
20330
20335
|
});
|
|
20331
20336
|
return;
|
|
20332
20337
|
}
|
|
20338
|
+
this.recordingDimensions = {
|
|
20339
|
+
width: this.canvas.width,
|
|
20340
|
+
height: this.canvas.height
|
|
20341
|
+
};
|
|
20333
20342
|
this.frame = new canvas_to_buffer_modern_r(this.canvas, this.options.image.types, this.options.image.quality);
|
|
20334
20343
|
this.options.logger.debug("Recorder: record()");
|
|
20335
20344
|
this.userMedia.record();
|
|
@@ -20494,6 +20503,11 @@
|
|
|
20494
20503
|
};
|
|
20495
20504
|
return dimension;
|
|
20496
20505
|
}
|
|
20506
|
+
getRecordingDimensions() {
|
|
20507
|
+
return this.recordingDimensions && {
|
|
20508
|
+
...this.recordingDimensions
|
|
20509
|
+
};
|
|
20510
|
+
}
|
|
20497
20511
|
getRecorderHeight(responsive, useBoundingClientRect) {
|
|
20498
20512
|
let recorderHeight;
|
|
20499
20513
|
if (this.recorderElement && useBoundingClientRect) {
|
|
@@ -21021,6 +21035,9 @@
|
|
|
21021
21035
|
getRecordingStats() {
|
|
21022
21036
|
return this.recorder.getRecordingStats();
|
|
21023
21037
|
}
|
|
21038
|
+
getRecordingDimensions() {
|
|
21039
|
+
return this.recorder.getRecordingDimensions();
|
|
21040
|
+
}
|
|
21024
21041
|
getAudioSampleRate() {
|
|
21025
21042
|
return this.recorder.getAudioSampleRate();
|
|
21026
21043
|
}
|
|
@@ -21298,10 +21315,13 @@
|
|
|
21298
21315
|
if (!videomailFormData) throw new Error("No videomail form data defined");
|
|
21299
21316
|
if (method === FormMethod.POST) {
|
|
21300
21317
|
videomailFormData.recordingStats = this.visuals.getRecordingStats();
|
|
21301
|
-
const
|
|
21302
|
-
|
|
21303
|
-
|
|
21304
|
-
|
|
21318
|
+
const dimensions = this.visuals.getRecordingDimensions();
|
|
21319
|
+
if (!dimensions) throw error_createError({
|
|
21320
|
+
message: "Recorded frame dimensions are missing.",
|
|
21321
|
+
options: this.options
|
|
21322
|
+
});
|
|
21323
|
+
videomailFormData.width = dimensions.width;
|
|
21324
|
+
videomailFormData.height = dimensions.height;
|
|
21305
21325
|
return await this.resource.post(videomailFormData);
|
|
21306
21326
|
} else if (method === FormMethod.PUT) return await this.resource.put(videomailFormData);
|
|
21307
21327
|
throw error_createError({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "videomail-client",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.10.1",
|
|
4
4
|
"description": "A wicked npm package to record videos directly in the browser, for Deaf and Sign Language!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webcam",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"scripts": {
|
|
44
|
-
"audit": "audit-ci --config audit-ci.
|
|
44
|
+
"audit": "audit-ci --config audit-ci.jsonc",
|
|
45
45
|
"build:prod": "cross-env NODE_ENV=production rslib build",
|
|
46
46
|
"build:prod:doc": "cross-env RSDOCTOR=true npm run build:prod",
|
|
47
47
|
"build:storybook": "storybook build",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"prettier-plugin-jsdoc": "1.8.1",
|
|
121
121
|
"prettier-plugin-packagejson": "3.0.2",
|
|
122
122
|
"prettier-plugin-sh": "0.20.2",
|
|
123
|
-
"release-it": "21.1.
|
|
123
|
+
"release-it": "21.1.1",
|
|
124
124
|
"storybook": "10.6.1",
|
|
125
125
|
"storybook-html-rsbuild": "3.6.0",
|
|
126
126
|
"type-fest": "5.10.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type VideomailIdentifier = "snapshot" | "thread";
|