@@ -48,23 +48,34 @@ import poster from "./img/poster.jpg";
4848
4949[ ** sandbox** ] ( https://codesandbox.io/s/sharp-poitras-qdync )
5050
51+ ## FAQ
52+
53+ 1 . How to show the poster if video has finished.
54+
55+ This can be implemented with ` onEnded ` event handler. You could create an overlay and show it at the end of the video. Please have a look at this [ ** example** ] ( https://github.com/samAbeywickrama/reactjs-videobg/blob/master/examples/cra/src/showPosterOnEnd )
56+
57+
58+
5159## API
5260
5361### ` <VideoBg /> `
5462
55- | Prop | Type | Default | Required | Description |
56- | ------------ | --------- | ------- | -------- | ------------------------------------------------------- |
57- | wrapperClass | ` String ` | none | no | className name for wrapper element. |
58- | videoClass | ` String ` | none | no | className name for video element. |
59- | loop | ` Boolean ` | ` true ` | no | Video will start over again. |
60- | autoPlay | ` Boolean ` | ` true ` | no | Video will start playing as soon as it is ready. |
61- | poster | ` String ` | none | no | The image to be shown while the videos are downloading. |
62- | muted | ` Boolean ` | ` true ` | no | Should audio of the video be muted? |
63+ | Prop | Type | Default | Required | Description |
64+ | --------------| ------------| ---------| ----------| ---------------------------------------------------------|
65+ | wrapperClass | ` String ` | none | no | className name for wrapper element. |
66+ | videoClass | ` String ` | none | no | className name for video element. |
67+ | loop | ` Boolean ` | ` true ` | no | Video will start over again. |
68+ | autoPlay | ` Boolean ` | ` true ` | no | Video will start playing as soon as it is ready. |
69+ | poster | ` String ` | none | no | The image to be shown while the videos are downloading. |
70+ | muted | ` Boolean ` | ` true ` | no | Should audio of the video be muted? |
71+ | onEnded | ` Function ` | none | no | Triggers on video end |
72+ | onPlay | ` Function ` | none | no | Triggeres on play |
73+ | onPlaying | ` function ` | none | no | Triggers on each time the video loops |
6374
6475### ` <VideoBg.Source /> `
6576
6677| Prop | Type | Default | Required | Description |
67- | ---- | -------- | ------- | -------- | -------------------------------- |
78+ | ------ | ---------- | --------- | ---------- | ---------------------------------- |
6879| src | ` String ` | none | yes | static file or video file source |
6980| type | ` String ` | none | yes | video type |
7081
0 commit comments