videomail-client 9.2.3 → 9.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "9.2.3",
3
+ "version": "9.2.5",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -17267,7 +17267,7 @@ function wrappy (fn, cb) {
17267
17267
  },{}],116:[function(_dereq_,module,exports){
17268
17268
  module.exports={
17269
17269
  "name": "videomail-client",
17270
- "version": "9.2.3",
17270
+ "version": "9.2.5",
17271
17271
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
17272
17272
  "keywords": [
17273
17273
  "webcam",
@@ -17471,9 +17471,6 @@ var VideomailClient = function VideomailClient(options) {
17471
17471
  if (!container.isBuilt()) {
17472
17472
  container.build(true, replayParentElement);
17473
17473
  }
17474
- if (!container.hasElement()) {
17475
- throw new Error("Unable to replay video without a container nor parent element.");
17476
- }
17477
17474
  if (videomail) {
17478
17475
  videomail = container.addPlayerDimensions(videomail);
17479
17476
  }
@@ -19749,11 +19746,6 @@ var Container = function Container(options) {
19749
19746
  var built;
19750
19747
  var form;
19751
19748
  validateOptions();
19752
- function prependDefaultCss() {
19753
- (0, _insertCss.default)(_mainMinCss.default, {
19754
- prepend: true
19755
- });
19756
- }
19757
19749
 
19758
19750
  // since https://github.com/binarykitchen/videomail-client/issues/87
19759
19751
  function findParentFormElement() {
@@ -19892,7 +19884,7 @@ var Container = function Container(options) {
19892
19884
  function correctDimensions() {
19893
19885
  if (options.video.stretch) {
19894
19886
  removeDimensions();
19895
- } else {
19887
+ } else if (containerElement) {
19896
19888
  var width = visuals.getRecorderWidth(true);
19897
19889
  if (width < 1) {
19898
19890
  throw _videomailError.default.create("Recorder width cannot be less than 1!", options);
@@ -19902,6 +19894,9 @@ var Container = function Container(options) {
19902
19894
  }
19903
19895
  }
19904
19896
  function removeDimensions() {
19897
+ if (!containerElement) {
19898
+ return;
19899
+ }
19905
19900
  containerElement.style.width = "auto";
19906
19901
  }
19907
19902
  function unloadChildren(e) {
@@ -20032,38 +20027,33 @@ var Container = function Container(options) {
20032
20027
  this.hasElement = function () {
20033
20028
  return Boolean(containerElement);
20034
20029
  };
20030
+ function prependDefaultCss() {
20031
+ (0, _insertCss.default)(_mainMinCss.default, {
20032
+ prepend: true
20033
+ });
20034
+ }
20035
20035
  this.build = function () {
20036
20036
  var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
20037
20037
  var replayParentElement = arguments.length > 1 ? arguments[1] : undefined;
20038
20038
  debug("Container: build (playerOnly = ".concat(playerOnly).concat(replayParentElement ? ", replayParentElement=\"".concat(replayParentElement, "\"") : "", ")"));
20039
20039
  try {
20040
- containerElement = document.getElementById(options.selectors.containerId);
20040
+ options.insertCss && prependDefaultCss();
20041
20041
 
20042
- /*
20043
- * Only build when a container element hast been found,
20044
- * otherwise be silent and do nothing
20045
- */
20046
- if (containerElement) {
20047
- options.insertCss && prependDefaultCss();
20048
- !built && initEvents(playerOnly);
20049
- correctDimensions();
20042
+ // Note, it can be undefined when e.g. just replaying a videomail
20043
+ containerElement = document.getElementById(options.selectors.containerId);
20044
+ !built && initEvents(playerOnly);
20045
+ correctDimensions();
20050
20046
 
20051
- // Building form also applies for when `playerOnly` because of
20052
- // correcting mode on Videomail. This function will skip if there is no form. Easy.
20053
- self.buildForm();
20054
- buildChildren(playerOnly, replayParentElement);
20055
- if (!hasError) {
20056
- debug("Container: built.");
20057
- built = true;
20058
- self.emit(_events.default.BUILT);
20059
- } else {
20060
- debug("Container: building failed due to an error.");
20061
- }
20047
+ // Building form also applies for when `playerOnly` because of
20048
+ // correcting mode on Videomail. This function will skip if there is no form. Easy.
20049
+ self.buildForm();
20050
+ buildChildren(playerOnly, replayParentElement);
20051
+ if (!hasError) {
20052
+ debug("Container: built.");
20053
+ built = true;
20054
+ self.emit(_events.default.BUILT);
20062
20055
  } else {
20063
- /*
20064
- * Commented out since it does too much noise on videomail's view page which is fine
20065
- * debug('Container: no container element with ID ' + options.selectors.containerId + ' found. Do nothing.')
20066
- */
20056
+ debug("Container: building failed due to an error.");
20067
20057
  }
20068
20058
  } catch (exc) {
20069
20059
  self.emit(_events.default.ERROR, exc);