@@ -48,23 +48,34 @@ import poster from "./img/poster.jpg";
48
48
49
49
[ ** sandbox** ] ( https://codesandbox.io/s/sharp-poitras-qdync )
50
50
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
+
51
59
## API
52
60
53
61
### ` <VideoBg /> `
54
62
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 |
63
74
64
75
### ` <VideoBg.Source /> `
65
76
66
77
| Prop | Type | Default | Required | Description |
67
- | ---- | -------- | ------- | -------- | -------------------------------- |
78
+ | ------ | ---------- | --------- | ---------- | ---------------------------------- |
68
79
| src | ` String ` | none | yes | static file or video file source |
69
80
| type | ` String ` | none | yes | video type |
70
81
0 commit comments