videomail-client 9.3.4 → 9.4.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.
@@ -13,6 +13,7 @@
13
13
  "browserstack",
14
14
  "bytediff",
15
15
  "classlist",
16
+ "crossorigin",
16
17
  "cssnano",
17
18
  "deepmerge",
18
19
  "derequire",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "9.3.4",
3
+ "version": "9.4.1",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -16907,7 +16907,7 @@ function wrappy (fn, cb) {
16907
16907
  },{}],112:[function(_dereq_,module,exports){
16908
16908
  module.exports={
16909
16909
  "name": "videomail-client",
16910
- "version": "9.3.4",
16910
+ "version": "9.4.1",
16911
16911
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
16912
16912
  "keywords": [
16913
16913
  "webcam",
@@ -21924,15 +21924,7 @@ var Recorder = function Recorder(visuals, replay) {
21924
21924
  connecting = connected = false;
21925
21925
  if (err) {
21926
21926
  self.emit(_events.default.ERROR, err || "Unhandled websocket error");
21927
- } else {
21928
- // COMMENTED OUT TEMPORARILY, PROBABLY OLD CODE TOO
21929
- // UPON CLOSE IT SHOULD TRY TO RECONNECT INSTEAD OF DISCONNECT.
21930
-
21931
- // self.emit(Events.DISCONNECTED);
21932
- // // prevents from https://github.com/binarykitchen/videomail.io/issues/297 happening
21933
- // cancelAnimationFrame();
21934
-
21935
- // New: try to reconnect
21927
+ } else if (userMediaLoaded) {
21936
21928
  initSocket();
21937
21929
  }
21938
21930
  });
@@ -22903,6 +22895,9 @@ var Replay = function Replay(parentElement, options) {
22903
22895
  if (videomail.webm) {
22904
22896
  this.setWebMSource(videomail.webm);
22905
22897
  }
22898
+ if (videomail.vtt) {
22899
+ setTrackSource(videomail.vtt);
22900
+ }
22906
22901
  if (videomail.poster) {
22907
22902
  replayElement.setAttribute("poster", videomail.poster);
22908
22903
  }
@@ -23042,6 +23037,35 @@ var Replay = function Replay(parentElement, options) {
23042
23037
  }
23043
23038
  return source;
23044
23039
  };
23040
+ function setTrackSource(src) {
23041
+ if (!replayElement) {
23042
+ return;
23043
+ }
23044
+ var tracks = replayElement.getElementsByTagName("track");
23045
+ var firstTrack = tracks && tracks[0];
23046
+ if (firstTrack) {
23047
+ if (src) {
23048
+ firstTrack.setAttribute("src", src);
23049
+ } else {
23050
+ // Remove when no captions available
23051
+ replayElement.removeChild(firstTrack);
23052
+ }
23053
+ } else {
23054
+ // Insert one then
23055
+ var track = (0, _hyperscript.default)("track", {
23056
+ src: src,
23057
+ // It's captions, not subtitles. Because for subtitles you must define the language, see
23058
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track
23059
+ kind: "captions",
23060
+ default: true
23061
+ });
23062
+ replayElement.appendChild(track);
23063
+
23064
+ // Because the local videomail server for development uses a different port, see
23065
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track
23066
+ replayElement.setAttribute("crossorigin", "anonymous");
23067
+ }
23068
+ }
23045
23069
  function setVideoSource(type, src, bustCache) {
23046
23070
  var source = self.getVideoSource(type);
23047
23071
  if (src && bustCache) {