@lls/lls-audio 0.0.56 → 0.0.57
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 +1 -1
- package/player/index.js +6 -3
- package/player/styles/styles.js +12 -7
- package/stories/index.js +2 -0
- package/stories/player.js +4 -2
package/package.json
CHANGED
package/player/index.js
CHANGED
|
@@ -249,7 +249,9 @@ var Player = function (_Component) {
|
|
|
249
249
|
_props$preload = _props.preload,
|
|
250
250
|
preload = _props$preload === undefined ? 'auto' : _props$preload,
|
|
251
251
|
_props$caption = _props.caption,
|
|
252
|
-
caption = _props$caption === undefined ? '' : _props$caption
|
|
252
|
+
caption = _props$caption === undefined ? '' : _props$caption,
|
|
253
|
+
_props$inline = _props.inline,
|
|
254
|
+
inline = _props$inline === undefined ? false : _props$inline;
|
|
253
255
|
var _state = this.state,
|
|
254
256
|
loading = _state.loading,
|
|
255
257
|
duration = _state.duration,
|
|
@@ -267,9 +269,10 @@ var Player = function (_Component) {
|
|
|
267
269
|
_currentRange$endTime = currentRange.endTime,
|
|
268
270
|
endTime = _currentRange$endTime === undefined ? 0 : _currentRange$endTime;
|
|
269
271
|
|
|
272
|
+
var playerStyle = inline ? styles.inline : styles.fixed;
|
|
270
273
|
return _react2.default.createElement(
|
|
271
274
|
'div',
|
|
272
|
-
{ className: 'Audio_player ' + (0, _noImportant.css)(styles.player) + ' ' + className },
|
|
275
|
+
{ className: 'Audio_player ' + (0, _noImportant.css)(styles.player, playerStyle) + ' ' + className },
|
|
273
276
|
_react2.default.createElement(Title, { content: title }),
|
|
274
277
|
_react2.default.createElement(
|
|
275
278
|
Content,
|
|
@@ -329,7 +332,7 @@ var Player = function (_Component) {
|
|
|
329
332
|
),
|
|
330
333
|
_react2.default.createElement(VolumeIcon, { audioRef: this.refs.audio, volume: volume }),
|
|
331
334
|
_react2.default.createElement(VolumeRange, { audioRef: this.refs.audio, volume: volume, volumeClassNames: _volumeClassNames2.default }),
|
|
332
|
-
_react2.default.createElement(_llsIcons2.default, { className: 'Close ' + (0, _noImportant.css)(styles.close), onClick: function onClick() {
|
|
335
|
+
!inline && _react2.default.createElement(_llsIcons2.default, { className: 'Close ' + (0, _noImportant.css)(styles.close), onClick: function onClick() {
|
|
333
336
|
on.close && on.close({ url: src });
|
|
334
337
|
}, name: 'fermer' }),
|
|
335
338
|
caption && _react2.default.createElement(_Caption2.default, { caption: caption })
|
package/player/styles/styles.js
CHANGED
|
@@ -12,18 +12,23 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
12
12
|
|
|
13
13
|
exports.default = {
|
|
14
14
|
player: _defineProperty({
|
|
15
|
-
position: 'fixed',
|
|
16
15
|
boxShadow: '0 0 7px rgba(0, 0, 0, 0.32)',
|
|
17
|
-
backgroundColor: '#fff'
|
|
18
|
-
bottom: 0,
|
|
19
|
-
zIndex: 10000000,
|
|
20
|
-
width: '90%',
|
|
21
|
-
marginLeft: '50%',
|
|
22
|
-
transform: 'translate(-50%, 0)'
|
|
16
|
+
backgroundColor: '#fff'
|
|
23
17
|
}, _mediaQueries.MOBILE, {
|
|
24
18
|
flexFlow: 'row wrap',
|
|
25
19
|
paddingTop: 10
|
|
26
20
|
}),
|
|
21
|
+
fixed: {
|
|
22
|
+
position: 'fixed',
|
|
23
|
+
bottom: 0,
|
|
24
|
+
zIndex: 10000000,
|
|
25
|
+
marginLeft: '50%',
|
|
26
|
+
transform: 'translate(-50%, 0)',
|
|
27
|
+
width: '90%'
|
|
28
|
+
},
|
|
29
|
+
inline: {
|
|
30
|
+
width: '100%'
|
|
31
|
+
},
|
|
27
32
|
volume: {
|
|
28
33
|
width: 100,
|
|
29
34
|
cursor: 'pointer'
|
package/stories/index.js
CHANGED
|
@@ -24,6 +24,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
24
24
|
return _react2.default.createElement(_player2.default, null);
|
|
25
25
|
}).add('Ranges', function () {
|
|
26
26
|
return _react2.default.createElement(_playerRange2.default, null);
|
|
27
|
+
}).add('Inline', function () {
|
|
28
|
+
return _react2.default.createElement(_player2.default, { inline: true });
|
|
27
29
|
}).add('Autoplay', function () {
|
|
28
30
|
return _react2.default.createElement(_player2.default, { autoPlay: true });
|
|
29
31
|
}).add('Caption', function () {
|
package/stories/player.js
CHANGED
|
@@ -44,7 +44,9 @@ var PlayerExample = function (_Component) {
|
|
|
44
44
|
var _props = this.props,
|
|
45
45
|
ranges = _props.ranges,
|
|
46
46
|
autoPlay = _props.autoPlay,
|
|
47
|
-
caption = _props.caption
|
|
47
|
+
caption = _props.caption,
|
|
48
|
+
_props$inline = _props.inline,
|
|
49
|
+
inline = _props$inline === undefined ? false : _props$inline;
|
|
48
50
|
|
|
49
51
|
var cb = {
|
|
50
52
|
loadStart: function loadStart(_ref) {
|
|
@@ -96,7 +98,7 @@ var PlayerExample = function (_Component) {
|
|
|
96
98
|
'http://lls-media-public.s3.amazonaws.com/upload/LeLivreScolaire/p15vcjbl4lvpl9l7g8ov8ammh1.mp3'
|
|
97
99
|
)
|
|
98
100
|
),
|
|
99
|
-
_react2.default.createElement(_player2.default, { id: this.state.url, title: 'Audio: un audio de la BBC', on: cb, autoPlay: autoPlay, src: this.state.url, ranges: ranges, visible: true, caption: caption })
|
|
101
|
+
_react2.default.createElement(_player2.default, { inline: inline, id: this.state.url, title: 'Audio: un audio de la BBC', on: cb, autoPlay: autoPlay, src: this.state.url, ranges: ranges, visible: true, caption: caption })
|
|
100
102
|
);
|
|
101
103
|
}
|
|
102
104
|
}]);
|