0.1.3 • Published 5 years ago
material-ui-video v0.1.3
Usage
npm install material-ui-video # or yarn add material-ui-video
import React from 'react'
import MaterialUIVideo from 'material-ui-video'
// Relative URL - render a video in same origin
<MaterialUIVideo url='/video.mp4' />
// Absolute URL - render a video from external source
<MaterialUIVideo url='http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4' />
Props
Prop | Description | Default |
---|---|---|
src | The url of a video to play ◦ Can be a relative or absolute url | |
forward | Set to true or falsy to show forward button | undefined |
backward | Set to true or falsy to show backward button | undefined |
autoplay | Set to true or falsy to set autoplay on video | undefined |
loop | Set to true or falsy to set loop on video | undefined |
width | Set the width of the player | 100% of parent container |
fadeSettings | Object with fadeInTime and fadeOutTime (number, seconds) to fadein and fadeout video | undefined |
Callback props
Callback props take a function that gets fired on various player events:
Prop | Description |
---|---|
onForwardClick | Called when forward button is clicked |
onBackwardClick | Called when backward button is clicked |
onEnded | Called when video ended |
Please note:
This module works only with React (>=17.0.0) and Material UI (@material-ui/core: >=4.0.0, @material-ui/icons: >=4.0.0). It will not install them as sub-dependencies.