videomail-client 9.3.4 → 9.4.0

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.3.4",
3
+ "version": "9.4.0",
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.0",
16911
16911
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
16912
16912
  "keywords": [
16913
16913
  "webcam",
@@ -22903,6 +22903,9 @@ var Replay = function Replay(parentElement, options) {
22903
22903
  if (videomail.webm) {
22904
22904
  this.setWebMSource(videomail.webm);
22905
22905
  }
22906
+ if (videomail.vtt) {
22907
+ setTrackSource(videomail.vtt);
22908
+ }
22906
22909
  if (videomail.poster) {
22907
22910
  replayElement.setAttribute("poster", videomail.poster);
22908
22911
  }
@@ -23042,6 +23045,31 @@ var Replay = function Replay(parentElement, options) {
23042
23045
  }
23043
23046
  return source;
23044
23047
  };
23048
+ function setTrackSource(src) {
23049
+ if (!replayElement) {
23050
+ return;
23051
+ }
23052
+ var tracks = replayElement.getElementsByTagName("track");
23053
+ var firstTrack = tracks && tracks[0];
23054
+ if (firstTrack) {
23055
+ if (src) {
23056
+ firstTrack.setAttribute("src", src);
23057
+ } else {
23058
+ // Remove when no captions available
23059
+ replayElement.removeChild(firstTrack);
23060
+ }
23061
+ } else {
23062
+ // Insert one then
23063
+ var track = (0, _hyperscript.default)("track", {
23064
+ src: src,
23065
+ // It's captions, not subtitles. Because for subtitles you must define the language, see
23066
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track
23067
+ kind: "captions",
23068
+ default: true
23069
+ });
23070
+ replayElement.appendChild(track);
23071
+ }
23072
+ }
23045
23073
  function setVideoSource(type, src, bustCache) {
23046
23074
  var source = self.getVideoSource(type);
23047
23075
  if (src && bustCache) {