diff --git a/README.md b/README.md index 6ac79c18..dd7c0537 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -react-player -============ +ReactPlayer +=========== A react component for playing media from YouTube, SoundCloud and Vimeo, as well as supported media files. @@ -48,9 +48,6 @@ playing | Set to `true` or `false` to pause or play the media volume | Sets the volume of the appropriate player width | Sets the width of the player height | Sets the height of the player -soundcloudConfig | An object containing configuration for the SoundCloud player. Includes `clientId`, which can be used to override the default `client_id` -vimeoConfig | An object containing configuration for the Vimeo player. Includes `iframeParams`, which maps to the [parameters accepted by the Vimeo iframe player](https://developer.vimeo.com/player/embedding#universal-parameters) -youtubeConfig | An object containing configuration for the YouTube player. Includes `playerVars`, which maps to the [parameters accepted by the YouTube iframe player](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5) onProgress | Callback containing `played` and `loaded` progress as a fraction eg `{ played: 0.12, loaded: 0.34 }` onPlay | Called when media starts or resumes playing after pausing or buffering onPause | Called when media is paused @@ -58,6 +55,16 @@ onBuffer | Called when media starts buffering onEnded | Called when media finishes playing onError | Called when an error occurs whilst attempting to play media +#### Config props + +These props allow you to override the parameters for the various players + +Prop | Description +---- | ----------- +soundcloudConfig | An object containing configuration for the SoundCloud player. Includes `clientId`, which can be used to override the default `client_id` +vimeoConfig | An object containing configuration for the Vimeo player. Includes `iframeParams`, which maps to the [parameters accepted by the Vimeo iframe player](https://developer.vimeo.com/player/embedding#universal-parameters) +youtubeConfig | An object containing configuration for the YouTube player. Includes `playerVars`, which maps to the [parameters accepted by the YouTube iframe player](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5) + ### Methods There is a static method `ReactPlayer.canPlay(url)` to determine if a URL can be played by the media player. Note that this does *not* detect media that is unplayable due to streaming permissions etc. In that case, `onError` will occur after attemping to play. @@ -89,4 +96,6 @@ npm run test ### Thanks -* Big thanks to [gaearon](https://github.com/gaearon) for his [react-hot-boilerplate](https://github.com/gaearon/react-hot-boilerplate), which this repo is roughly based on. +* [gaearon](https://github.com/gaearon) for his [react-hot-boilerplate](https://github.com/gaearon/react-hot-boilerplate), which this repo is roughly based on. +* [Simon Smith](http://simonsmith.io) for his [intro to react testing with shallow rendering](http://simonsmith.io/unit-testing-react-components-without-a-dom/) +* [Fauntleroy](https://github.com/Fauntleroy) for his contributions