Skip to content

Commit

Permalink
Merge pull request #19 from apivideo/fix-player-size-in-doc
Browse files Browse the repository at this point in the history
Fix player size in documentation
  • Loading branch information
olivierapivideo authored Jan 16, 2024
2 parents 013e336 + efdbbd4 commit 5a25943
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import ApiVideoPlayer from '@api.video/react-player'

// ...

<ApiVideoPlayer video={{id: "vi5fv44Hol1jFrCovyktAJS9"}} />
<ApiVideoPlayer video={{id: "vi5fv44Hol1jFrCovyktAJS9"}} style={{ height: '480px' }} />
```

## Documentation
Expand Down Expand Up @@ -105,16 +105,18 @@ Examples
```tsx
{/* default: all controls are displayed */}
<ApiVideoPlayer
video={{id: "vi5fv44Hol1jFrCovyktAJS9"}} />
video={{id: "vi5fv44Hol1jFrCovyktAJS9"}} style={{ height: '480px' }} />

{/* all controls hidden (equivalent to chromeless=true) */}
<ApiVideoPlayer
video={{id: "vi5fv44Hol1jFrCovyktAJS9"}}
style={{ height: '480px' }}
controls={[]} />

{ /* only the play button & the unmute one are displayed */}
<ApiVideoPlayer
video={{id: "vi5fv44Hol1jFrCovyktAJS9"}}
style={{ height: '480px' }}
controls={["play", "unmute"]}/>
```

Expand All @@ -128,6 +130,7 @@ Example
{ /* display the text in blue and the progress bar in red */}
<ApiVideoPlayer
video={{id: "vi5fv44Hol1jFrCovyktAJS9"}}
style={{ height: '480px' }}
theme={{
trackPlayed: "#FF0000",
text: "blue"
Expand Down Expand Up @@ -202,7 +205,8 @@ To play a [private video](https://api.video/blog/tutorials/tutorial-private-vide
// ...
<ApiVideoPlayer video={{
id: "vi5fv44Hol1jFrCovyktAJS9",
token: "e1bdf9a8-da40-421e-87f3-75b15232c531"}} />
token: "e1bdf9a8-da40-421e-87f3-75b15232c531"}}
style={{ height: '480px' }} />
```

#### Defining metadata
Expand All @@ -211,6 +215,7 @@ To play a [private video](https://api.video/blog/tutorials/tutorial-private-vide
// ...
<ApiVideoPlayer
video={{ id: "vi5fv44Hol1jFrCovyktAJS9" }}
style={{ height: '480px' }}
metadata={{"userName": "Alfred"}} />
```

Expand All @@ -222,6 +227,7 @@ const playerRef = useRef<ApiVideoPlayer>(null);
return
<ApiVideoPlayer
video={{ id: "vi5jC9kQs2I3PdmVBjgcIg45" }}
style={{ height: '480px' }}
chromeless={true}
ref={playerRef}>
<button onClick={() => playerRef.current?.play()}>play</button>
Expand Down

0 comments on commit 5a25943

Please sign in to comment.