Skip to content

Commit 21da479

Browse files
committed
new version build
1 parent cd00fcf commit 21da479

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ReactDOM.render(
6868

6969
### Custom Audio Example
7070

71-
It is also easy to built players **without** using SoundCloud API. You just need to pass audio source via `streamUrl` and all other necessary track meta information can be passed as custom props. Also you can choose `preloadType`, according to [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#Attributes), by default this property equal to 'auto'.
71+
It is also easy to built players **without** using SoundCloud API. You just need to pass audio source via `streamUrl` and all other necessary track meta information can be passed as custom props. Also you can choose `preloadType`, according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#Attributes, by default this property is equal to 'auto'.
7272

7373
```js
7474
import React from 'react';
@@ -102,7 +102,7 @@ class App extends React.Component {
102102
<AWSSoundPlayer
103103
streamUrl={streamUrl}
104104
trackTitle={trackTitle}
105-
preloadType='auto' />
105+
preloadType="auto" />
106106
);
107107
}
108108
}

dist/react-soundplayer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,10 +705,11 @@ function withSoundCloudAudio(WrappedComponent) {
705705
var _props = this.props,
706706
resolveUrl = _props.resolveUrl,
707707
streamUrl = _props.streamUrl,
708+
preloadType = _props.preloadType,
708709
onReady = _props.onReady;
709710

710711
if (streamUrl) {
711-
soundCloudAudio.preload(streamUrl);
712+
soundCloudAudio.preload(streamUrl, preloadType);
712713
} else if (resolveUrl) {
713714
soundCloudAudio.resolve(resolveUrl, function (data) {
714715
if (!_this2.mounted) {

dist/react-soundplayer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import AWSSoundPlayer from './players/AWSSoundPlayer';
2828
const ksmtkChronemics = 'https://soundcloud.com/kosmetism/chronemics';
2929
const ksmtkNightcall = 'https://soundcloud.com/kosmetism/nightcall';
3030
const ksmtkSoulSurvivor = 'https://soundcloud.com/kosmetism/soul-survivor';
31+
const haghorrorDerNeueKult = 'https://soundcloud.com/kosmetism/haghorror-der-neue-kult-preview';
3132
const glassCandy = 'https://soundcloud.com/johnnyjewel/glass-candy-shell-game';
3233
const ksmtkSet = 'https://soundcloud.com/kosmetism/sets/ksmtk';
3334
const data = {
@@ -334,7 +335,7 @@ const EnhancedPlayer = withSoundCloudAudio(Player)
334335
<div className="mb2">With this information in mind it is really easy to create your own custom players like on example below:</div>
335336
<CustomPlayer
336337
clientId={clientId}
337-
resolveUrl={ksmtkChronemics}
338+
resolveUrl={haghorrorDerNeueKult}
338339
onReady={() => {
339340
console.log('player url ready!');
340341
}}
@@ -412,7 +413,7 @@ class BuiltInPlayers extends React.Component {
412413
</h3>
413414
<BasicSoundPlayer
414415
clientId={clientId}
415-
resolveUrl={ksmtkSoulSurvivor}
416+
resolveUrl={ksmtkChronemics}
416417
{...this.props}
417418
/>
418419

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-soundplayer",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Create custom SoundCloud players with React",
55
"main": "index.js",
66
"directories": {
@@ -36,7 +36,7 @@
3636
"object-assign": "^4.1.1",
3737
"prop-types": "^15.6.0",
3838
"react": "^16.0.0",
39-
"soundcloud-audio": "^1.2.0"
39+
"soundcloud-audio": "^1.2.2"
4040
},
4141
"devDependencies": {
4242
"babel-cli": "^6.26.0",

src/addons/withSoundCloudAudio.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export default function withSoundCloudAudio (WrappedComponent) {
5454

5555
requestAudio() {
5656
const { soundCloudAudio } = this;
57-
const { resolveUrl, streamUrl, onReady, preloadType = 'auto' } = this.props;
57+
const {
58+
resolveUrl,
59+
streamUrl,
60+
preloadType,
61+
onReady
62+
} = this.props;
5863

5964
if (streamUrl) {
6065
soundCloudAudio.preload(streamUrl, preloadType);

0 commit comments

Comments
 (0)