@lls/lls-audio 0.0.34 → 0.0.35
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 +2 -2
- package/player/Audio.js +1 -1
- package/player/index.js +187 -108
- package/player/styles/styles.js +30 -6
- package/stories/player.js +22 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lls/lls-audio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@kadira/storybook": "^2.21.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"node": ">=0.12.0"
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|
|
39
|
-
"url": "github.com/lelivrescolaire/
|
|
39
|
+
"url": "github.com/lelivrescolaire/lls-audio"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"start": "npm run storybook",
|
package/player/Audio.js
CHANGED
|
@@ -121,7 +121,7 @@ var Player = function (_Component) {
|
|
|
121
121
|
_this.setStateWithCallback = function (state) {
|
|
122
122
|
var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
123
123
|
return _this.setState(state, function () {
|
|
124
|
-
_this.props.onChange(state);
|
|
124
|
+
_this.props.onChange(_this.state);
|
|
125
125
|
cb ? cb() : false;
|
|
126
126
|
});
|
|
127
127
|
};
|
package/player/index.js
CHANGED
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
|
-
|
|
9
7
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
8
|
|
|
11
9
|
var _react = require('react');
|
|
@@ -106,6 +104,30 @@ var Player = function (_Component) {
|
|
|
106
104
|
return _this.refs.audio.setRange(range);
|
|
107
105
|
};
|
|
108
106
|
|
|
107
|
+
_this.audioStateChange = function (newState) {
|
|
108
|
+
var previousPlay = _this.state.play;
|
|
109
|
+
var newPlay = newState.play;
|
|
110
|
+
var _this$props = _this.props,
|
|
111
|
+
src = _this$props.src,
|
|
112
|
+
_this$props$on = _this$props.on,
|
|
113
|
+
on = _this$props$on === undefined ? {} : _this$props$on;
|
|
114
|
+
|
|
115
|
+
// Trigger onPause & onPlay callbacks if necessary
|
|
116
|
+
|
|
117
|
+
if (!previousPlay && newPlay && on.play) {
|
|
118
|
+
on.play({
|
|
119
|
+
url: src
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (previousPlay && !newPlay && on.pause) {
|
|
123
|
+
on.pause({
|
|
124
|
+
url: src
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
_this.setState(newState);
|
|
129
|
+
};
|
|
130
|
+
|
|
109
131
|
_this.state = {
|
|
110
132
|
waveform: false,
|
|
111
133
|
loading: true,
|
|
@@ -113,6 +135,7 @@ var Player = function (_Component) {
|
|
|
113
135
|
};
|
|
114
136
|
_this.setContainerWidth = (0, _utils.debounce)(_this.setContainerWidth.bind(_this), 500);
|
|
115
137
|
_this.onKeyPress = _this.onKeyPress.bind(_this);
|
|
138
|
+
_this.audioStateChange = _this.audioStateChange.bind(_this);
|
|
116
139
|
return _this;
|
|
117
140
|
}
|
|
118
141
|
|
|
@@ -166,27 +189,40 @@ var Player = function (_Component) {
|
|
|
166
189
|
|
|
167
190
|
var src = props.src,
|
|
168
191
|
_props$visible = props.visible,
|
|
169
|
-
visible = _props$visible === undefined ? true : _props$visible
|
|
170
|
-
|
|
192
|
+
visible = _props$visible === undefined ? true : _props$visible,
|
|
193
|
+
_props$on = props.on,
|
|
194
|
+
on = _props$on === undefined ? {} : _props$on;
|
|
195
|
+
|
|
196
|
+
if (on.loadStart) {
|
|
197
|
+
on.loadStart({
|
|
198
|
+
url: src
|
|
199
|
+
}); // notify start of loading
|
|
200
|
+
}
|
|
171
201
|
(0, _audio.getWaveform)(src).then(function (waveform) {
|
|
172
202
|
_this3.setState({
|
|
173
203
|
waveform: waveform,
|
|
174
204
|
loading: false
|
|
175
205
|
});
|
|
206
|
+
// notify end of loading
|
|
207
|
+
if (on.loadSuccess) {
|
|
208
|
+
on.loadSuccess({
|
|
209
|
+
url: src,
|
|
210
|
+
duration: waveform.duration
|
|
211
|
+
});
|
|
212
|
+
}
|
|
176
213
|
});
|
|
177
214
|
}
|
|
178
215
|
}, {
|
|
179
216
|
key: 'render',
|
|
180
217
|
value: function render() {
|
|
181
|
-
var _this4 = this;
|
|
182
|
-
|
|
183
218
|
var _props = this.props,
|
|
219
|
+
title = _props.title,
|
|
184
220
|
_props$autoPlay = _props.autoPlay,
|
|
185
221
|
autoPlay = _props$autoPlay === undefined ? false : _props$autoPlay,
|
|
186
222
|
src = _props.src,
|
|
187
223
|
className = _props.className,
|
|
188
|
-
_props$
|
|
189
|
-
|
|
224
|
+
_props$on2 = _props.on,
|
|
225
|
+
on = _props$on2 === undefined ? {} : _props$on2,
|
|
190
226
|
_props$ranges = _props.ranges,
|
|
191
227
|
ranges = _props$ranges === undefined ? [] : _props$ranges,
|
|
192
228
|
_props$displayRange = _props.displayRange,
|
|
@@ -220,67 +256,70 @@ var Player = function (_Component) {
|
|
|
220
256
|
return _react2.default.createElement(
|
|
221
257
|
'div',
|
|
222
258
|
{ className: 'Audio_player ' + (0, _noImportant.css)(styles.player) + ' ' + className },
|
|
223
|
-
_react2.default.createElement(
|
|
224
|
-
_react2.default.createElement(_Audio2.default, { autoPlay: autoPlay, onChange: function onChange(state) {
|
|
225
|
-
return _this4.setState(_extends({}, state));
|
|
226
|
-
}, ref: 'audio', src: src, preload: preload }),
|
|
227
|
-
_react2.default.createElement(SpeedWrapper, { speed: speed, audioRef: this.refs.audio }),
|
|
228
|
-
_react2.default.createElement(LoopWrapper, { loop: loop, audioRef: this.refs.audio }),
|
|
229
|
-
displayRange ? _react2.default.createElement(_Range2.default, {
|
|
230
|
-
setRange: this.setRange,
|
|
231
|
-
onClickAddRange: onClickAddRange,
|
|
232
|
-
onClickDeleteRange: onClickDeleteRange,
|
|
233
|
-
ranges: ranges,
|
|
234
|
-
startTime: startTime,
|
|
235
|
-
endTime: endTime
|
|
236
|
-
}) : null,
|
|
259
|
+
_react2.default.createElement(Title, { content: title }),
|
|
237
260
|
_react2.default.createElement(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
_react2.default.createElement(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
261
|
+
Content,
|
|
262
|
+
null,
|
|
263
|
+
_react2.default.createElement(PlayWrapper, { play: play, audioRef: this.refs.audio }),
|
|
264
|
+
_react2.default.createElement(_Audio2.default, { autoPlay: autoPlay, onChange: this.audioStateChange, ref: 'audio', src: src, preload: preload }),
|
|
265
|
+
_react2.default.createElement(SpeedWrapper, { speed: speed, audioRef: this.refs.audio }),
|
|
266
|
+
_react2.default.createElement(LoopWrapper, { loop: loop, audioRef: this.refs.audio }),
|
|
267
|
+
displayRange && _react2.default.createElement(_Range2.default, {
|
|
268
|
+
setRange: this.setRange,
|
|
269
|
+
onClickAddRange: onClickAddRange,
|
|
270
|
+
onClickDeleteRange: onClickDeleteRange,
|
|
271
|
+
ranges: ranges,
|
|
272
|
+
startTime: startTime,
|
|
273
|
+
endTime: endTime
|
|
274
|
+
}),
|
|
245
275
|
_react2.default.createElement(
|
|
246
276
|
'div',
|
|
247
|
-
{ className: (0, _noImportant.css)(styles.
|
|
248
|
-
_react2.default.createElement(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
277
|
+
{ className: (0, _noImportant.css)(styles.waveAndTimes) },
|
|
278
|
+
_react2.default.createElement(
|
|
279
|
+
'div',
|
|
280
|
+
{ className: (0, _noImportant.css)(styles.time, styles.currentTime) },
|
|
281
|
+
(0, _utils.timeConvert)(currentTime)
|
|
282
|
+
),
|
|
283
|
+
_react2.default.createElement(
|
|
284
|
+
'div',
|
|
285
|
+
{ className: (0, _noImportant.css)(styles.timeline), ref: 'container' },
|
|
286
|
+
loading ? _react2.default.createElement(Loader, null) : _react2.default.createElement(WaveTimeline, {
|
|
287
|
+
audioRef: this.refs.audio,
|
|
288
|
+
currentTime: currentTime,
|
|
289
|
+
containerWidth: containerWidth,
|
|
290
|
+
startTime: startTime,
|
|
291
|
+
endTime: endTime,
|
|
292
|
+
loading: loading,
|
|
293
|
+
waveform: waveform,
|
|
294
|
+
fallbackTimelineClassNames: _fallbackTimelineClassNames2.default,
|
|
295
|
+
timeConvert: _utils.timeConvert,
|
|
296
|
+
duration: duration,
|
|
297
|
+
timelineClassNames: _timelineClassNames2.default
|
|
298
|
+
}),
|
|
299
|
+
_react2.default.createElement(Timeline, {
|
|
300
|
+
fallbackRangelineClassNames: _fallbackRangelineClassNames2.default,
|
|
301
|
+
timeConvert: _utils.timeConvert,
|
|
302
|
+
duration: duration,
|
|
303
|
+
audioRef: this.refs.audio,
|
|
304
|
+
currentTime: currentTime,
|
|
305
|
+
startTime: startTime,
|
|
306
|
+
endTime: endTime,
|
|
307
|
+
timeLineBottom: _timeLineBottom2.default
|
|
308
|
+
})
|
|
309
|
+
),
|
|
310
|
+
_react2.default.createElement(
|
|
311
|
+
'div',
|
|
312
|
+
{ className: (0, _noImportant.css)(styles.time, styles.totalTime) },
|
|
313
|
+
(0, _utils.timeConvert)(duration - currentTime)
|
|
314
|
+
)
|
|
271
315
|
),
|
|
272
|
-
_react2.default.createElement(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
_react2.default.createElement(VolumeRange, { audioRef: this.refs.audio, volume: volume, volumeClassNames: _volumeClassNames2.default }),
|
|
280
|
-
_react2.default.createElement(_llsIcons2.default, { className: 'Close ' + (0, _noImportant.css)(styles.close), onClick: function onClick() {
|
|
281
|
-
return onClose();
|
|
282
|
-
}, name: 'fermer' }),
|
|
283
|
-
caption ? _react2.default.createElement(_Caption2.default, { caption: caption }) : null
|
|
316
|
+
_react2.default.createElement(VolumeIcon, { audioRef: this.refs.audio, volume: volume }),
|
|
317
|
+
_react2.default.createElement(VolumeRange, { audioRef: this.refs.audio, volume: volume, volumeClassNames: _volumeClassNames2.default }),
|
|
318
|
+
_react2.default.createElement(_llsIcons2.default, { className: 'Close ' + (0, _noImportant.css)(styles.close), onClick: function onClick() {
|
|
319
|
+
if (on.close) on.close({ url: src });
|
|
320
|
+
}, name: 'fermer' }),
|
|
321
|
+
caption && _react2.default.createElement(_Caption2.default, { caption: caption })
|
|
322
|
+
)
|
|
284
323
|
);
|
|
285
324
|
}
|
|
286
325
|
}]);
|
|
@@ -290,9 +329,49 @@ var Player = function (_Component) {
|
|
|
290
329
|
|
|
291
330
|
/**** PLAYER COMPONENTS ****/
|
|
292
331
|
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
|
|
332
|
+
var Loader = function Loader() {
|
|
333
|
+
return _react2.default.createElement(
|
|
334
|
+
'div',
|
|
335
|
+
{ className: (0, _noImportant.css)(styles.loader) },
|
|
336
|
+
_react2.default.createElement(
|
|
337
|
+
'span',
|
|
338
|
+
{ className: (0, _noImportant.css)(styles.loaderText) },
|
|
339
|
+
'chargement en cours'
|
|
340
|
+
),
|
|
341
|
+
_react2.default.createElement(
|
|
342
|
+
'span',
|
|
343
|
+
{ className: (0, _noImportant.css)(styles.loaderOne) },
|
|
344
|
+
'.'
|
|
345
|
+
),
|
|
346
|
+
_react2.default.createElement(
|
|
347
|
+
'span',
|
|
348
|
+
{ className: (0, _noImportant.css)(styles.loaderTwo) },
|
|
349
|
+
'.'
|
|
350
|
+
),
|
|
351
|
+
_react2.default.createElement(
|
|
352
|
+
'span',
|
|
353
|
+
{ className: (0, _noImportant.css)(styles.loaderThree) },
|
|
354
|
+
'.'
|
|
355
|
+
)
|
|
356
|
+
);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
var Title = function Title(_ref) {
|
|
360
|
+
var content = _ref.content;
|
|
361
|
+
return _react2.default.createElement('div', { className: (0, _noImportant.css)(styles.title), dangerouslySetInnerHTML: { __html: content } });
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
var Content = function Content(_ref2) {
|
|
365
|
+
var children = _ref2.children;
|
|
366
|
+
return _react2.default.createElement(
|
|
367
|
+
'div',
|
|
368
|
+
{ className: (0, _noImportant.css)(styles.content) },
|
|
369
|
+
children
|
|
370
|
+
);
|
|
371
|
+
};
|
|
372
|
+
var PlayWrapper = function PlayWrapper(_ref3) {
|
|
373
|
+
var play = _ref3.play,
|
|
374
|
+
audioRef = _ref3.audioRef;
|
|
296
375
|
return _react2.default.createElement(
|
|
297
376
|
'div',
|
|
298
377
|
{ className: (0, _noImportant.css)(styles.play_and_stop), onClick: function onClick() {
|
|
@@ -302,9 +381,9 @@ var PlayWrapper = function PlayWrapper(_ref) {
|
|
|
302
381
|
);
|
|
303
382
|
};
|
|
304
383
|
|
|
305
|
-
var SpeedWrapper = function SpeedWrapper(
|
|
306
|
-
var speed =
|
|
307
|
-
audioRef =
|
|
384
|
+
var SpeedWrapper = function SpeedWrapper(_ref4) {
|
|
385
|
+
var speed = _ref4.speed,
|
|
386
|
+
audioRef = _ref4.audioRef;
|
|
308
387
|
return _react2.default.createElement(
|
|
309
388
|
'div',
|
|
310
389
|
{ className: 'Speed_menu ' + (0, _noImportant.css)(styles.speed_menu) },
|
|
@@ -314,9 +393,9 @@ var SpeedWrapper = function SpeedWrapper(_ref2) {
|
|
|
314
393
|
);
|
|
315
394
|
};
|
|
316
395
|
|
|
317
|
-
var LoopWrapper = function LoopWrapper(
|
|
318
|
-
var loop =
|
|
319
|
-
audioRef =
|
|
396
|
+
var LoopWrapper = function LoopWrapper(_ref5) {
|
|
397
|
+
var loop = _ref5.loop,
|
|
398
|
+
audioRef = _ref5.audioRef;
|
|
320
399
|
return _react2.default.createElement(
|
|
321
400
|
'div',
|
|
322
401
|
{ onClick: function onClick() {
|
|
@@ -326,18 +405,18 @@ var LoopWrapper = function LoopWrapper(_ref3) {
|
|
|
326
405
|
);
|
|
327
406
|
};
|
|
328
407
|
|
|
329
|
-
var WaveTimeline = function WaveTimeline(
|
|
330
|
-
var currentTime =
|
|
331
|
-
containerWidth =
|
|
332
|
-
startTime =
|
|
333
|
-
endTime =
|
|
334
|
-
loading =
|
|
335
|
-
waveform =
|
|
336
|
-
fallbackTimelineClassNames =
|
|
337
|
-
timeConvert =
|
|
338
|
-
duration =
|
|
339
|
-
audioRef =
|
|
340
|
-
timelineClassNames =
|
|
408
|
+
var WaveTimeline = function WaveTimeline(_ref6) {
|
|
409
|
+
var currentTime = _ref6.currentTime,
|
|
410
|
+
containerWidth = _ref6.containerWidth,
|
|
411
|
+
startTime = _ref6.startTime,
|
|
412
|
+
endTime = _ref6.endTime,
|
|
413
|
+
loading = _ref6.loading,
|
|
414
|
+
waveform = _ref6.waveform,
|
|
415
|
+
fallbackTimelineClassNames = _ref6.fallbackTimelineClassNames,
|
|
416
|
+
timeConvert = _ref6.timeConvert,
|
|
417
|
+
duration = _ref6.duration,
|
|
418
|
+
audioRef = _ref6.audioRef,
|
|
419
|
+
timelineClassNames = _ref6.timelineClassNames;
|
|
341
420
|
return _react2.default.createElement(
|
|
342
421
|
'div',
|
|
343
422
|
{ className: (0, _noImportant.css)(styles.wavetimeline) },
|
|
@@ -354,9 +433,9 @@ var WaveTimeline = function WaveTimeline(_ref4) {
|
|
|
354
433
|
formatLabel: timeConvert,
|
|
355
434
|
maxValue: Math.round(duration) || 1,
|
|
356
435
|
minValue: 0,
|
|
357
|
-
onChange: function onChange(c,
|
|
358
|
-
var min =
|
|
359
|
-
max =
|
|
436
|
+
onChange: function onChange(c, _ref7) {
|
|
437
|
+
var min = _ref7.min,
|
|
438
|
+
max = _ref7.max;
|
|
360
439
|
return audioRef.setRange({ startTime: min, endTime: max });
|
|
361
440
|
},
|
|
362
441
|
value: { min: startTime, max: endTime }
|
|
@@ -374,15 +453,15 @@ var WaveTimeline = function WaveTimeline(_ref4) {
|
|
|
374
453
|
);
|
|
375
454
|
};
|
|
376
455
|
|
|
377
|
-
var Timeline = function Timeline(
|
|
378
|
-
var fallbackRangelineClassNames =
|
|
379
|
-
timeConvert =
|
|
380
|
-
duration =
|
|
381
|
-
audioRef =
|
|
382
|
-
currentTime =
|
|
383
|
-
startTime =
|
|
384
|
-
endTime =
|
|
385
|
-
timeLineBottom =
|
|
456
|
+
var Timeline = function Timeline(_ref8) {
|
|
457
|
+
var fallbackRangelineClassNames = _ref8.fallbackRangelineClassNames,
|
|
458
|
+
timeConvert = _ref8.timeConvert,
|
|
459
|
+
duration = _ref8.duration,
|
|
460
|
+
audioRef = _ref8.audioRef,
|
|
461
|
+
currentTime = _ref8.currentTime,
|
|
462
|
+
startTime = _ref8.startTime,
|
|
463
|
+
endTime = _ref8.endTime,
|
|
464
|
+
timeLineBottom = _ref8.timeLineBottom;
|
|
386
465
|
return _react2.default.createElement(
|
|
387
466
|
'div',
|
|
388
467
|
{ className: (0, _noImportant.css)(styles.fallback) },
|
|
@@ -391,9 +470,9 @@ var Timeline = function Timeline(_ref6) {
|
|
|
391
470
|
formatLabel: timeConvert,
|
|
392
471
|
maxValue: Math.round(duration) || 1,
|
|
393
472
|
minValue: 0,
|
|
394
|
-
onChange: function onChange(c,
|
|
395
|
-
var min =
|
|
396
|
-
max =
|
|
473
|
+
onChange: function onChange(c, _ref9) {
|
|
474
|
+
var min = _ref9.min,
|
|
475
|
+
max = _ref9.max;
|
|
397
476
|
return audioRef.setRange({ startTime: min, endTime: max });
|
|
398
477
|
},
|
|
399
478
|
value: { min: startTime, max: endTime }
|
|
@@ -410,9 +489,9 @@ var Timeline = function Timeline(_ref6) {
|
|
|
410
489
|
);
|
|
411
490
|
};
|
|
412
491
|
|
|
413
|
-
var VolumeIcon = function VolumeIcon(
|
|
414
|
-
var audioRef =
|
|
415
|
-
volume =
|
|
492
|
+
var VolumeIcon = function VolumeIcon(_ref10) {
|
|
493
|
+
var audioRef = _ref10.audioRef,
|
|
494
|
+
volume = _ref10.volume;
|
|
416
495
|
return _react2.default.createElement(
|
|
417
496
|
'div',
|
|
418
497
|
{ className: (0, _noImportant.css)(styles.iconAudio), onClick: function onClick() {
|
|
@@ -422,10 +501,10 @@ var VolumeIcon = function VolumeIcon(_ref8) {
|
|
|
422
501
|
);
|
|
423
502
|
};
|
|
424
503
|
|
|
425
|
-
var VolumeRange = function VolumeRange(
|
|
426
|
-
var volumeClassNames =
|
|
427
|
-
volume =
|
|
428
|
-
audioRef =
|
|
504
|
+
var VolumeRange = function VolumeRange(_ref11) {
|
|
505
|
+
var volumeClassNames = _ref11.volumeClassNames,
|
|
506
|
+
volume = _ref11.volume,
|
|
507
|
+
audioRef = _ref11.audioRef;
|
|
429
508
|
return _react2.default.createElement(
|
|
430
509
|
'div',
|
|
431
510
|
{ className: 'Volume ' + (0, _noImportant.css)(styles.volume) },
|
package/player/styles/styles.js
CHANGED
|
@@ -15,13 +15,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
15
15
|
exports.default = {
|
|
16
16
|
player: _defineProperty({
|
|
17
17
|
position: 'fixed',
|
|
18
|
-
display: 'flex',
|
|
19
|
-
alignItems: 'center',
|
|
20
|
-
justifyContent: 'center',
|
|
21
18
|
boxShadow: '0 0 7px rgba(0, 0, 0, 0.32)',
|
|
22
19
|
backgroundColor: '#fff',
|
|
23
20
|
bottom: 0,
|
|
24
|
-
height:
|
|
21
|
+
height: 156,
|
|
25
22
|
zIndex: 10000000,
|
|
26
23
|
width: '90%',
|
|
27
24
|
marginLeft: '50%',
|
|
@@ -63,6 +60,21 @@ exports.default = {
|
|
|
63
60
|
order: 2,
|
|
64
61
|
margin: '0px 28px'
|
|
65
62
|
}),
|
|
63
|
+
content: {
|
|
64
|
+
display: 'flex',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
justifyContent: 'center',
|
|
67
|
+
marginTop: 20,
|
|
68
|
+
height: 85
|
|
69
|
+
},
|
|
70
|
+
title: {
|
|
71
|
+
color: '#474f6f',
|
|
72
|
+
fontSize: '10px',
|
|
73
|
+
fontWeight: 'bold',
|
|
74
|
+
lineHeight: '36px',
|
|
75
|
+
paddingLeft: '15px',
|
|
76
|
+
borderBottom: '1px solid #e6e6e7'
|
|
77
|
+
},
|
|
66
78
|
play_and_stop: (_play_and_stop = {
|
|
67
79
|
height: '100%',
|
|
68
80
|
width: 40
|
|
@@ -76,10 +88,22 @@ exports.default = {
|
|
|
76
88
|
wavetimeline: _defineProperty({}, _mediaQueries.MOBILE, {
|
|
77
89
|
display: 'none'
|
|
78
90
|
}),
|
|
91
|
+
loader: {
|
|
92
|
+
height: 60,
|
|
93
|
+
color: '#00b3df',
|
|
94
|
+
fontSize: 10,
|
|
95
|
+
fontWeight: 'bold',
|
|
96
|
+
lineHeight: '60px',
|
|
97
|
+
textAlign: 'center'
|
|
98
|
+
},
|
|
99
|
+
loaderText: {
|
|
100
|
+
textTransform: 'uppercase'
|
|
101
|
+
},
|
|
102
|
+
loaderOne: {},
|
|
103
|
+
loaderTwo: {},
|
|
104
|
+
loaderThree: {},
|
|
79
105
|
timeline: _defineProperty({
|
|
80
|
-
//width: 'calc(100% - 520px)',
|
|
81
106
|
width: '100%',
|
|
82
|
-
height: 60,
|
|
83
107
|
margin: '0px 20px',
|
|
84
108
|
position: 'relative',
|
|
85
109
|
display: 'flex',
|
package/stories/player.js
CHANGED
|
@@ -46,11 +46,30 @@ var PlayerExample = function (_Component) {
|
|
|
46
46
|
autoPlay = _props.autoPlay,
|
|
47
47
|
caption = _props.caption;
|
|
48
48
|
|
|
49
|
+
var cb = {
|
|
50
|
+
loadStart: function loadStart(_ref) {
|
|
51
|
+
var url = _ref.url;
|
|
52
|
+
console.log("load start");
|
|
53
|
+
},
|
|
54
|
+
loadSuccess: function loadSuccess(_ref2) {
|
|
55
|
+
var url = _ref2.url,
|
|
56
|
+
duration = _ref2.duration;
|
|
57
|
+
console.log("load success", url, duration);
|
|
58
|
+
},
|
|
59
|
+
play: function play(_ref3) {
|
|
60
|
+
var url = _ref3.url;
|
|
61
|
+
console.log("play", url);
|
|
62
|
+
},
|
|
63
|
+
pause: function pause(_ref4) {
|
|
64
|
+
var url = _ref4.url;
|
|
65
|
+
console.log("pause", url);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
49
68
|
return _react2.default.createElement(
|
|
50
69
|
'div',
|
|
51
70
|
null,
|
|
52
|
-
_react2.default.createElement('input', { style: { width: 'calc(100% - 20px)', padding: 10 }, onChange: function onChange(
|
|
53
|
-
var value =
|
|
71
|
+
_react2.default.createElement('input', { style: { width: 'calc(100% - 20px)', padding: 10 }, onChange: function onChange(_ref5) {
|
|
72
|
+
var value = _ref5.target.value;
|
|
54
73
|
return _this2.setState({ url: value });
|
|
55
74
|
}, value: this.state.url }),
|
|
56
75
|
_react2.default.createElement(
|
|
@@ -67,7 +86,7 @@ var PlayerExample = function (_Component) {
|
|
|
67
86
|
'http://lls-media-public.s3.amazonaws.com/upload/LeLivreScolaire/p15vcjbl4lvpl9l7g8ov8ammh1.mp3'
|
|
68
87
|
)
|
|
69
88
|
),
|
|
70
|
-
_react2.default.createElement(_player2.default, { autoPlay: autoPlay, src: this.state.url, ranges: ranges, visible: true, caption: caption })
|
|
89
|
+
_react2.default.createElement(_player2.default, { title: 'Audio: un audio de la BBC', on: cb, autoPlay: autoPlay, src: this.state.url, ranges: ranges, visible: true, caption: caption })
|
|
71
90
|
);
|
|
72
91
|
}
|
|
73
92
|
}]);
|