videomail-client 13.5.1 → 13.5.3

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 CHANGED
@@ -83,6 +83,7 @@ Looking at the examples in the `/src/stories` folder should give you some ideas
83
83
  - <a href="#isBuilt">`videomailClient.isBuilt()`</a>
84
84
  - <a href="#submit">`videomailClient.submit()`</a>
85
85
  - <a href="#getLogLines">`videomailClient.getLogLines()`</a>
86
+ - <a href="#setLimitSeconds">`videomailClient.setLimitSeconds()`</a>
86
87
 
87
88
  <a name="constructor"></a>
88
89
 
@@ -201,6 +202,12 @@ Calling this function will manually trigger a submission of the recorded videoma
201
202
 
202
203
  For advanced use only: returns you a collection of log lines that show what code has been covered recently. Useful if you want to debug something tricky.
203
204
 
205
+ <a name="setLimitSeconds"></a>
206
+
207
+ ### videomailClient.setLimitSeconds()
208
+
209
+ For advanced use only: sets the recording time limit in seconds. Useful if you want to dynamically change the recording duration.
210
+
204
211
  <a name="whatisstored"></a>
205
212
 
206
213
  ## What gets stored on the videomail server?
@@ -10664,7 +10664,7 @@ var __webpack_exports__ = {};
10664
10664
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10665
10665
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10666
10666
  var package_namespaceObject = {
10667
- rE: "13.5.1"
10667
+ rE: "13.5.3"
10668
10668
  };
10669
10669
  var defined = __webpack_require__("./node_modules/defined/index.js");
10670
10670
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -15925,6 +15925,9 @@ var __webpack_exports__ = {};
15925
15925
  getStartSeconds() {
15926
15926
  return this.options.video.limitSeconds;
15927
15927
  }
15928
+ setLimitSeconds(limitSeconds) {
15929
+ this.options.video.limitSeconds = limitSeconds;
15930
+ }
15928
15931
  start() {
15929
15932
  this.countdown = this.getStartSeconds();
15930
15933
  this.nearComputed = this.endNighComputed = false;
@@ -16080,6 +16083,10 @@ var __webpack_exports__ = {};
16080
16083
  checkTimer(elapsedTime) {
16081
16084
  this.recordTimer.check(elapsedTime);
16082
16085
  }
16086
+ setLimitSeconds(limitSeconds) {
16087
+ this.options.video.limitSeconds = limitSeconds;
16088
+ this.recordTimer.setLimitSeconds(limitSeconds);
16089
+ }
16083
16090
  constructor(visuals, options){
16084
16091
  super("RecorderInsides", options), recorderInsides_define_property(this, "recordNote", void 0), recorderInsides_define_property(this, "recordTimer", void 0), recorderInsides_define_property(this, "countdown", void 0), recorderInsides_define_property(this, "facingMode", void 0), recorderInsides_define_property(this, "pausedNote", void 0), recorderInsides_define_property(this, "built", false);
16085
16092
  this.recordNote = new recorder_recordNote(visuals);
@@ -16870,9 +16877,19 @@ var __webpack_exports__ = {};
16870
16877
  });
16871
16878
  } else {
16872
16879
  rawHeight = this.getVideoHeight();
16873
- if (!rawHeight || rawHeight < 1) throw error_createError({
16880
+ if (void 0 === rawHeight) throw error_createError({
16881
+ message: "Bad dimensions",
16882
+ explanation: "Raw video height from DOM element cannot be undefined.",
16883
+ options: this.options
16884
+ });
16885
+ if (0 === rawHeight) throw error_createError({
16874
16886
  message: "Bad dimensions",
16875
- explanation: "Raw video height from DOM element cannot be less than 1!",
16887
+ explanation: "Raw video height from DOM element cannot be zero.",
16888
+ options: this.options
16889
+ });
16890
+ if (rawHeight < 1) throw error_createError({
16891
+ message: "Bad dimensions",
16892
+ explanation: "Raw video height from DOM element cannot be less than 1.",
16876
16893
  options: this.options
16877
16894
  });
16878
16895
  }
@@ -18437,6 +18454,10 @@ var __webpack_exports__ = {};
18437
18454
  this.recorderInsides.startCountdown(this.recorder.record.bind(this.recorder));
18438
18455
  } else this.recorder.record();
18439
18456
  }
18457
+ setLimitSeconds(limitSeconds) {
18458
+ this.options.video.limitSeconds = limitSeconds;
18459
+ this.recorderInsides.setLimitSeconds(limitSeconds);
18460
+ }
18440
18461
  getElement() {
18441
18462
  return this.visualsElement;
18442
18463
  }
@@ -18982,6 +19003,10 @@ var __webpack_exports__ = {};
18982
19003
  recordAgain() {
18983
19004
  this.visuals.recordAgain();
18984
19005
  }
19006
+ setLimitSeconds(limitSeconds) {
19007
+ this.options.video.limitSeconds = limitSeconds;
19008
+ this.visuals.setLimitSeconds(limitSeconds);
19009
+ }
18985
19010
  constructor(options){
18986
19011
  super("Container", options), container_define_property(this, "visibility", document_visibility_default()()), container_define_property(this, "htmlElement", document.querySelector("html")), container_define_property(this, "visuals", void 0), container_define_property(this, "buttons", void 0), container_define_property(this, "resource", void 0), container_define_property(this, "form", void 0), container_define_property(this, "hasError", false), container_define_property(this, "submitted", false), container_define_property(this, "lastValidation", false), container_define_property(this, "containerElement", void 0), container_define_property(this, "built", false);
18987
19012
  this.visuals = new wrappers_visuals(this, options);
@@ -19053,6 +19078,12 @@ var __webpack_exports__ = {};
19053
19078
  this.unload(true);
19054
19079
  this.container.startOver(params);
19055
19080
  }
19081
+ setLimitSeconds(limitSeconds) {
19082
+ if (this.options.video.limitSeconds === limitSeconds) return void this.options.logger.debug(`Client: setLimitSeconds called but limitSeconds is already ${limitSeconds}, doing nothing.`);
19083
+ this.options.video.limitSeconds = limitSeconds;
19084
+ this.options.logger.debug(`Client: setLimitSeconds (limitSeconds = ${limitSeconds})`);
19085
+ this.container.setLimitSeconds(limitSeconds);
19086
+ }
19056
19087
  unload(startingOver = false) {
19057
19088
  this.container.unload({
19058
19089
  startingOver
@@ -17,6 +17,7 @@ declare class VideomailClient extends Despot {
17
17
  build(): HTMLElement | null | undefined;
18
18
  show(params?: ShowParams): HTMLElement;
19
19
  startOver(params?: StartOverParams): void;
20
+ setLimitSeconds(limitSeconds: number): void;
20
21
  unload(startingOver?: boolean): void;
21
22
  replay(videomail: Videomail, replayParentElementId?: string): HTMLVideoElement;
22
23
  hide(): void;
package/dist/esm/index.js CHANGED
@@ -3606,7 +3606,7 @@ const constants = {
3606
3606
  }
3607
3607
  };
3608
3608
  var package_namespaceObject = {
3609
- rE: "13.5.1"
3609
+ rE: "13.5.3"
3610
3610
  };
3611
3611
  function canPlayType_canPlayType(video, type) {
3612
3612
  const canPlayType = video.canPlayType(`video/${type}`);
@@ -5388,6 +5388,9 @@ class RecordTimer {
5388
5388
  getStartSeconds() {
5389
5389
  return this.options.video.limitSeconds;
5390
5390
  }
5391
+ setLimitSeconds(limitSeconds) {
5392
+ this.options.video.limitSeconds = limitSeconds;
5393
+ }
5391
5394
  start() {
5392
5395
  this.countdown = this.getStartSeconds();
5393
5396
  this.nearComputed = this.endNighComputed = false;
@@ -5522,6 +5525,10 @@ class RecorderInsides extends util_Despot {
5522
5525
  checkTimer(elapsedTime) {
5523
5526
  this.recordTimer.check(elapsedTime);
5524
5527
  }
5528
+ setLimitSeconds(limitSeconds) {
5529
+ this.options.video.limitSeconds = limitSeconds;
5530
+ this.recordTimer.setLimitSeconds(limitSeconds);
5531
+ }
5525
5532
  }
5526
5533
  const recorderInsides = RecorderInsides;
5527
5534
  const NOTIFIER_MESSAGE_ID = "notifierMessage";
@@ -6199,9 +6206,19 @@ class UserMedia extends util_Despot {
6199
6206
  });
6200
6207
  } else {
6201
6208
  rawHeight = this.getVideoHeight();
6202
- if (!rawHeight || rawHeight < 1) throw error_createError({
6209
+ if (void 0 === rawHeight) throw error_createError({
6210
+ message: "Bad dimensions",
6211
+ explanation: "Raw video height from DOM element cannot be undefined.",
6212
+ options: this.options
6213
+ });
6214
+ if (0 === rawHeight) throw error_createError({
6203
6215
  message: "Bad dimensions",
6204
- explanation: "Raw video height from DOM element cannot be less than 1!",
6216
+ explanation: "Raw video height from DOM element cannot be zero.",
6217
+ options: this.options
6218
+ });
6219
+ if (rawHeight < 1) throw error_createError({
6220
+ message: "Bad dimensions",
6221
+ explanation: "Raw video height from DOM element cannot be less than 1.",
6205
6222
  options: this.options
6206
6223
  });
6207
6224
  }
@@ -7738,6 +7755,10 @@ class Visuals extends util_Despot {
7738
7755
  this.recorderInsides.startCountdown(this.recorder.record.bind(this.recorder));
7739
7756
  } else this.recorder.record();
7740
7757
  }
7758
+ setLimitSeconds(limitSeconds) {
7759
+ this.options.video.limitSeconds = limitSeconds;
7760
+ this.recorderInsides.setLimitSeconds(limitSeconds);
7761
+ }
7741
7762
  getElement() {
7742
7763
  return this.visualsElement;
7743
7764
  }
@@ -8236,6 +8257,10 @@ class Container extends util_Despot {
8236
8257
  recordAgain() {
8237
8258
  this.visuals.recordAgain();
8238
8259
  }
8260
+ setLimitSeconds(limitSeconds) {
8261
+ this.options.video.limitSeconds = limitSeconds;
8262
+ this.visuals.setLimitSeconds(limitSeconds);
8263
+ }
8239
8264
  }
8240
8265
  const wrappers_container = Container;
8241
8266
  class VideomailClient extends util_Despot {
@@ -8274,6 +8299,12 @@ class VideomailClient extends util_Despot {
8274
8299
  this.unload(true);
8275
8300
  this.container.startOver(params);
8276
8301
  }
8302
+ setLimitSeconds(limitSeconds) {
8303
+ if (this.options.video.limitSeconds === limitSeconds) return void this.options.logger.debug(`Client: setLimitSeconds called but limitSeconds is already ${limitSeconds}, doing nothing.`);
8304
+ this.options.video.limitSeconds = limitSeconds;
8305
+ this.options.logger.debug(`Client: setLimitSeconds (limitSeconds = ${limitSeconds})`);
8306
+ this.container.setLimitSeconds(limitSeconds);
8307
+ }
8277
8308
  unload(startingOver = false) {
8278
8309
  this.container.unload({
8279
8310
  startingOver
@@ -82,5 +82,6 @@ declare class Container extends Despot {
82
82
  resume(): void;
83
83
  stop(): void;
84
84
  recordAgain(): void;
85
+ setLimitSeconds(limitSeconds: number): void;
85
86
  }
86
87
  export default Container;
@@ -22,6 +22,7 @@ declare class RecordTimer {
22
22
  private show;
23
23
  private getSecondsRecorded;
24
24
  private getStartSeconds;
25
+ setLimitSeconds(limitSeconds: number): void;
25
26
  start(): void;
26
27
  pause(): void;
27
28
  resume(): void;
@@ -24,5 +24,6 @@ declare class RecorderInsides extends Despot {
24
24
  resumeCountdown(): void;
25
25
  isCountingDown(): boolean | undefined;
26
26
  checkTimer(elapsedTime: number): void;
27
+ setLimitSeconds(limitSeconds: number): void;
27
28
  }
28
29
  export default RecorderInsides;
@@ -68,6 +68,7 @@ declare class Visuals extends Despot {
68
68
  isUserMediaLoaded(): boolean | undefined;
69
69
  isConnected(): boolean;
70
70
  record(): void;
71
+ setLimitSeconds(limitSeconds: number): void;
71
72
  getElement(): HTMLElement | null | undefined;
72
73
  }
73
74
  export default Visuals;
package/dist/umd/index.js CHANGED
@@ -10670,7 +10670,7 @@
10670
10670
  var client = __webpack_require__("./node_modules/superagent/lib/client.js");
10671
10671
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10672
10672
  var package_namespaceObject = {
10673
- rE: "13.5.1"
10673
+ rE: "13.5.3"
10674
10674
  };
10675
10675
  var defined = __webpack_require__("./node_modules/defined/index.js");
10676
10676
  var defined_default = /*#__PURE__*/ __webpack_require__.n(defined);
@@ -15727,6 +15727,9 @@
15727
15727
  getStartSeconds() {
15728
15728
  return this.options.video.limitSeconds;
15729
15729
  }
15730
+ setLimitSeconds(limitSeconds) {
15731
+ this.options.video.limitSeconds = limitSeconds;
15732
+ }
15730
15733
  start() {
15731
15734
  this.countdown = this.getStartSeconds();
15732
15735
  this.nearComputed = this.endNighComputed = false;
@@ -15861,6 +15864,10 @@
15861
15864
  checkTimer(elapsedTime) {
15862
15865
  this.recordTimer.check(elapsedTime);
15863
15866
  }
15867
+ setLimitSeconds(limitSeconds) {
15868
+ this.options.video.limitSeconds = limitSeconds;
15869
+ this.recordTimer.setLimitSeconds(limitSeconds);
15870
+ }
15864
15871
  }
15865
15872
  const recorderInsides = RecorderInsides;
15866
15873
  const NOTIFIER_MESSAGE_ID = "notifierMessage";
@@ -16614,9 +16621,19 @@
16614
16621
  });
16615
16622
  } else {
16616
16623
  rawHeight = this.getVideoHeight();
16617
- if (!rawHeight || rawHeight < 1) throw error_createError({
16624
+ if (void 0 === rawHeight) throw error_createError({
16625
+ message: "Bad dimensions",
16626
+ explanation: "Raw video height from DOM element cannot be undefined.",
16627
+ options: this.options
16628
+ });
16629
+ if (0 === rawHeight) throw error_createError({
16618
16630
  message: "Bad dimensions",
16619
- explanation: "Raw video height from DOM element cannot be less than 1!",
16631
+ explanation: "Raw video height from DOM element cannot be zero.",
16632
+ options: this.options
16633
+ });
16634
+ if (rawHeight < 1) throw error_createError({
16635
+ message: "Bad dimensions",
16636
+ explanation: "Raw video height from DOM element cannot be less than 1.",
16620
16637
  options: this.options
16621
16638
  });
16622
16639
  }
@@ -18153,6 +18170,10 @@
18153
18170
  this.recorderInsides.startCountdown(this.recorder.record.bind(this.recorder));
18154
18171
  } else this.recorder.record();
18155
18172
  }
18173
+ setLimitSeconds(limitSeconds) {
18174
+ this.options.video.limitSeconds = limitSeconds;
18175
+ this.recorderInsides.setLimitSeconds(limitSeconds);
18176
+ }
18156
18177
  getElement() {
18157
18178
  return this.visualsElement;
18158
18179
  }
@@ -18651,6 +18672,10 @@
18651
18672
  recordAgain() {
18652
18673
  this.visuals.recordAgain();
18653
18674
  }
18675
+ setLimitSeconds(limitSeconds) {
18676
+ this.options.video.limitSeconds = limitSeconds;
18677
+ this.visuals.setLimitSeconds(limitSeconds);
18678
+ }
18654
18679
  }
18655
18680
  const wrappers_container = Container;
18656
18681
  class VideomailClient extends util_Despot {
@@ -18689,6 +18714,12 @@
18689
18714
  this.unload(true);
18690
18715
  this.container.startOver(params);
18691
18716
  }
18717
+ setLimitSeconds(limitSeconds) {
18718
+ if (this.options.video.limitSeconds === limitSeconds) return void this.options.logger.debug(`Client: setLimitSeconds called but limitSeconds is already ${limitSeconds}, doing nothing.`);
18719
+ this.options.video.limitSeconds = limitSeconds;
18720
+ this.options.logger.debug(`Client: setLimitSeconds (limitSeconds = ${limitSeconds})`);
18721
+ this.container.setLimitSeconds(limitSeconds);
18722
+ }
18692
18723
  unload(startingOver = false) {
18693
18724
  this.container.unload({
18694
18725
  startingOver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "13.5.1",
3
+ "version": "13.5.3",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",