Skip to content

Commit b0084f7

Browse files
committed
docs: fix src instead of url prop
1 parent a187b55 commit b0084f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ import React from 'react'
3636
import ReactPlayer from 'react-player'
3737

3838
// Render a YouTube video player
39-
<ReactPlayer url='https://www.youtube.com/watch?v=LXb3EKWsInQ' />
39+
<ReactPlayer src='https://www.youtube.com/watch?v=LXb3EKWsInQ' />
4040
```
4141

42-
If your build system supports `import()` statements and code splitting enable this to lazy load the appropriate player for the `url` you pass in. This adds several `reactPlayer` chunks to your output, but reduces your main bundle size.
42+
If your build system supports `import()` statements and code splitting enable this to lazy load the appropriate player for the `src` you pass in. This adds several `reactPlayer` chunks to your output, but reduces your main bundle size.
4343

4444
Demo page: [`https://cookpete.github.io/react-player`](https://cookpete.github.io/react-player)
4545

@@ -103,7 +103,7 @@ There is a single `config` prop to override settings for each type of player:
103103

104104
```jsx
105105
<ReactPlayer
106-
url={url}
106+
src={src}
107107
config={{
108108
youtube: {
109109
color: 'white',
@@ -126,7 +126,7 @@ Key | Options
126126

127127
Method | Description
128128
------ | -----------
129-
`ReactPlayer.canPlay(url)` | Determine if a URL can be played. This does *not* detect media that is unplayable due to privacy settings, streaming permissions, etc. In that case, the `onError` prop will be invoked after attempting to play. Any URL that does not match any patterns will fall back to a native HTML5 media player.
129+
`ReactPlayer.canPlay(src)` | Determine if a URL can be played. This does *not* detect media that is unplayable due to privacy settings, streaming permissions, etc. In that case, the `onError` prop will be invoked after attempting to play. Any URL that does not match any patterns will fall back to a native HTML5 media player.
130130
`ReactPlayer.addCustomPlayer(CustomPlayer)` | Add a custom player. See [Adding custom players](#adding-custom-players)
131131
`ReactPlayer.removeCustomPlayers()` | Remove any players that have been added using `addCustomPlayer()`
132132

@@ -157,7 +157,7 @@ Set `width` to `100%`, `height` to `auto` and add an `aspectRatio` like `16 / 9`
157157

158158
```js
159159
<ReactPlayer
160-
url="https://www.youtube.com/watch?v=LXb3EKWsInQ"
160+
src="https://www.youtube.com/watch?v=LXb3EKWsInQ"
161161
style={{ width: '100%', height: 'auto', aspectRatio: '16/9' }}
162162
/>
163163
```

0 commit comments

Comments
 (0)