@lls/lls-audio 0.0.76 → 0.0.78

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": "@lls/lls-audio",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "main": "index.js",
5
5
  "devDependencies": {
6
6
  "@kadira/storybook": "2.21.0",
package/player/Play.js CHANGED
@@ -37,42 +37,10 @@ var generateStyles = function generateStyles(_ref) {
37
37
  cursor: 'pointer'
38
38
  },
39
39
  play_button: {
40
- 'height': size,
41
- 'width': size,
42
- 'display': 'block',
43
- 'overflow': 'hidden',
44
- 'position': 'relative'
45
- },
46
- triangle_1: {
47
- 'transform': 'translate(0, -100%)'
48
- },
49
- triangle_2: {
50
- 'transform': 'translate(0, 100%)'
51
- },
52
- triangle: {
53
- 'position': 'absolute',
54
- 'top': 0,
55
- 'right': -1,
56
- 'background-color': 'transparent',
57
- 'width': 0,
58
- 'height': 0,
59
- 'border-right': invert ? size + 'px solid white' : size + 'px solid ' + _colors.BLUE,
60
- 'border-top': size / 2 + 'px solid transparent',
61
- 'border-bottom': size / 2 + 'px solid transparent',
62
- 'transition': transitionDuration ? 'transform ' + transitionDuration + 's ease' : 'none'
63
- },
64
- left: {
65
- 'height': '100%',
66
- 'float': 'left',
67
- 'background-color': invert ? '' + _colors.BLUE : '#fff',
68
- 'width': '36%',
69
- 'overflow': 'hidden'
70
- },
71
- right: {
72
- 'height': '100%',
73
- 'float': 'right',
74
- 'width': '36%',
75
- 'background-color': invert ? '' + _colors.BLUE : '#fff'
40
+ outline: 'none',
41
+ border: '0px solid',
42
+ background: 'transparent',
43
+ fill: '#fff'
76
44
  }
77
45
  });
78
46
  };
@@ -91,25 +59,15 @@ var Play = function Play(_ref2) {
91
59
  props = _objectWithoutProperties(_ref2, ['pause', 'invert', 'transitionDuration', 'className', 'size']);
92
60
 
93
61
  var styles = generateStyles({ size: size, invert: invert, transitionDuration: transitionDuration });
94
- var pauseTriangle1 = pause ? {
95
- transform: 'translate(0, -50%)'
96
- } : {};
97
- var pauseTriangle2 = pause ? {
98
- transform: 'translate(0, 50%)'
99
- } : {};
100
- var pauseLine = pause ? {
101
- 'width': '50%'
102
- } : {};
62
+
103
63
  return _react2.default.createElement(
104
64
  'div',
105
65
  _extends({ className: (0, _noImportant.css)(styles.play_button_wrapper) + ' ' + (invert && (0, _noImportant.css)(styles.play_button_wrapper_invert)) + ' ' + className }, props),
106
66
  _react2.default.createElement(
107
- 'div',
108
- { className: (0, _noImportant.css)(styles.play_button) },
109
- _react2.default.createElement('div', { style: pauseLine, className: (0, _noImportant.css)(styles.left) }),
110
- _react2.default.createElement('div', { style: pauseLine, className: (0, _noImportant.css)(styles.right) }),
111
- _react2.default.createElement('div', { style: pauseTriangle1, className: (0, _noImportant.css)(styles.triangle, styles.triangle_1) }),
112
- _react2.default.createElement('div', { style: pauseTriangle2, className: (0, _noImportant.css)(styles.triangle, styles.triangle_2) })
67
+ 'svg',
68
+ { className: (0, _noImportant.css)(styles.play_button), width: '100%', height: '100%', viewBox: '0 0 36 36' },
69
+ pause && _react2.default.createElement('path', { id: 'play-icon', d: 'M11,10 L18,13.74 18,22.28 11,26 M18,13.74 L26,18 26,18 18,22.28' }),
70
+ !pause && _react2.default.createElement('path', { id: 'pause-icon', d: 'M11,10 L17,10 17,26 11,26 M20,10 L26,10 26,26 20,26' })
113
71
  )
114
72
  );
115
73
  };
package/recorder/index.js CHANGED
@@ -40,7 +40,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
40
40
 
41
41
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
42
42
 
43
- var audioContext = new _audioContext2.default();
43
+ var audioContext = _audioContext2.default ? new _audioContext2.default() : null;
44
44
 
45
45
  // make the volume a value between 0 and 100
46
46
  var formatVolume = function formatVolume(volume) {
@@ -161,6 +161,9 @@ var Recorder = function (_Component) {
161
161
  _props$onRecordComple = props.onRecordComplete,
162
162
  onRecordComplete = _props$onRecordComple === undefined ? function () {} : _props$onRecordComple;
163
163
 
164
+ if (!audioContext) {
165
+ return onNotAvailable();
166
+ }
164
167
 
165
168
  (0, _mediaDevices.shimMediaDevices)();
166
169
 
package/stories/player.js CHANGED
@@ -31,7 +31,7 @@ var PlayerExample = function (_Component) {
31
31
  var _this = _possibleConstructorReturn(this, (PlayerExample.__proto__ || Object.getPrototypeOf(PlayerExample)).call(this, props));
32
32
 
33
33
  _this.state = {
34
- url: 'https://lls-media-public-dev.s3-eu-west-1.amazonaws.com/audios_texttospeech/Emma_1182114.mp3'
34
+ url: 'http://lls-media-public.s3.amazonaws.com/upload/LeLivreScolaire/p15vcjbl4lvpl9l7g8ov8ammh1.mp3'
35
35
  };
36
36
  return _this;
37
37
  }