@lls/lls-audio 0.0.36 → 0.0.37
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 +7 -1
- package/stories/player.js +19 -13
package/package.json
CHANGED
package/player/index.js
CHANGED
|
@@ -108,6 +108,7 @@ var Player = function (_Component) {
|
|
|
108
108
|
var previousPlay = _this.state.play;
|
|
109
109
|
var newPlay = newState.play;
|
|
110
110
|
var _this$props = _this.props,
|
|
111
|
+
id = _this$props.id,
|
|
111
112
|
src = _this$props.src,
|
|
112
113
|
_this$props$on = _this$props.on,
|
|
113
114
|
on = _this$props$on === undefined ? {} : _this$props$on;
|
|
@@ -116,11 +117,13 @@ var Player = function (_Component) {
|
|
|
116
117
|
|
|
117
118
|
if (!previousPlay && newPlay && on.play) {
|
|
118
119
|
on.play({
|
|
120
|
+
id: id,
|
|
119
121
|
url: src
|
|
120
122
|
});
|
|
121
123
|
}
|
|
122
124
|
if (previousPlay && !newPlay && on.pause) {
|
|
123
125
|
on.pause({
|
|
126
|
+
id: id,
|
|
124
127
|
url: src
|
|
125
128
|
});
|
|
126
129
|
}
|
|
@@ -187,7 +190,8 @@ var Player = function (_Component) {
|
|
|
187
190
|
value: function initialize(props) {
|
|
188
191
|
var _this3 = this;
|
|
189
192
|
|
|
190
|
-
var
|
|
193
|
+
var id = props.id,
|
|
194
|
+
src = props.src,
|
|
191
195
|
_props$visible = props.visible,
|
|
192
196
|
visible = _props$visible === undefined ? true : _props$visible,
|
|
193
197
|
_props$on = props.on,
|
|
@@ -195,6 +199,7 @@ var Player = function (_Component) {
|
|
|
195
199
|
|
|
196
200
|
if (on.loadStart) {
|
|
197
201
|
on.loadStart({
|
|
202
|
+
id: id,
|
|
198
203
|
url: src
|
|
199
204
|
}); // notify start of loading
|
|
200
205
|
}
|
|
@@ -206,6 +211,7 @@ var Player = function (_Component) {
|
|
|
206
211
|
// notify end of loading
|
|
207
212
|
if (on.loadSuccess) {
|
|
208
213
|
on.loadSuccess({
|
|
214
|
+
id: id,
|
|
209
215
|
url: src,
|
|
210
216
|
duration: waveform.duration
|
|
211
217
|
});
|
package/stories/player.js
CHANGED
|
@@ -48,31 +48,37 @@ var PlayerExample = function (_Component) {
|
|
|
48
48
|
|
|
49
49
|
var cb = {
|
|
50
50
|
loadStart: function loadStart(_ref) {
|
|
51
|
-
var
|
|
52
|
-
|
|
51
|
+
var id = _ref.id,
|
|
52
|
+
url = _ref.url;
|
|
53
|
+
console.log("load start", id, url);
|
|
53
54
|
},
|
|
54
55
|
loadSuccess: function loadSuccess(_ref2) {
|
|
55
|
-
var
|
|
56
|
+
var id = _ref2.id,
|
|
57
|
+
url = _ref2.url,
|
|
56
58
|
duration = _ref2.duration;
|
|
57
|
-
console.log("load success", url, duration);
|
|
59
|
+
console.log("load success", id, url, duration);
|
|
58
60
|
},
|
|
59
61
|
play: function play(_ref3) {
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
+
var id = _ref3.id,
|
|
63
|
+
url = _ref3.url;
|
|
64
|
+
console.log("play", id, url);
|
|
62
65
|
},
|
|
63
66
|
pause: function pause(_ref4) {
|
|
64
|
-
var
|
|
65
|
-
|
|
67
|
+
var id = _ref4.id,
|
|
68
|
+
url = _ref4.url;
|
|
69
|
+
console.log("pause", id, url);
|
|
66
70
|
},
|
|
67
|
-
close: function close() {
|
|
68
|
-
|
|
71
|
+
close: function close(_ref5) {
|
|
72
|
+
var id = _ref5.id,
|
|
73
|
+
url = _ref5.url;
|
|
74
|
+
console.log("close", id, url);
|
|
69
75
|
}
|
|
70
76
|
};
|
|
71
77
|
return _react2.default.createElement(
|
|
72
78
|
'div',
|
|
73
79
|
null,
|
|
74
|
-
_react2.default.createElement('input', { style: { width: 'calc(100% - 20px)', padding: 10 }, onChange: function onChange(
|
|
75
|
-
var value =
|
|
80
|
+
_react2.default.createElement('input', { style: { width: 'calc(100% - 20px)', padding: 10 }, onChange: function onChange(_ref6) {
|
|
81
|
+
var value = _ref6.target.value;
|
|
76
82
|
return _this2.setState({ url: value });
|
|
77
83
|
}, value: this.state.url }),
|
|
78
84
|
_react2.default.createElement(
|
|
@@ -89,7 +95,7 @@ var PlayerExample = function (_Component) {
|
|
|
89
95
|
'http://lls-media-public.s3.amazonaws.com/upload/LeLivreScolaire/p15vcjbl4lvpl9l7g8ov8ammh1.mp3'
|
|
90
96
|
)
|
|
91
97
|
),
|
|
92
|
-
_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 })
|
|
98
|
+
_react2.default.createElement(_player2.default, { id: 'test', title: 'Audio: un audio de la BBC', on: cb, autoPlay: autoPlay, src: this.state.url, ranges: ranges, visible: true, caption: caption })
|
|
93
99
|
);
|
|
94
100
|
}
|
|
95
101
|
}]);
|