0.0.1 • Published 5 years ago
media-player-react v0.0.1
media-player-react
react 媒体组件
Usage
npm install media-player-react --save
# or
yarn add media-player-react
import React, { Component } from 'react'
import {MediaPlayer} from 'media-player-react'
class App extends Component {
render () {
return <MediaPlayer url='http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'/>
}
}
Props
Prop | Description | Default |
---|---|---|
url | The url of a video or song to play | |
<!-- playing | Set to true or false to pause or play the media | false |
loop | Set to true or false to loop the media | false |
controls | Set to true or false to display native player controls ◦ Vimeo, Twitch and Wistia player will always display controls | false |
light | Set to true to show just the video thumbnail, which loads the full player on click ◦ Pass in an image URL to override the preview image | false |
volume | Set the volume of the player, between 0 and 1 ◦ null uses default volume on all players #357 | null |
muted | Mutes the player ◦ Only works if volume is set | false |
playbackRate | Set the playback rate of the player ◦ Only supported by YouTube, Wistia, and file paths | 1 |
width | Set the width of the player | 640px |
height | Set the height of the player | 360px |
style | Add inline styles to the root element | {} |
progressInterval | The time between onProgress callbacks, in milliseconds | 1000 |
playsinline | Applies the playsinline attribute where supported | false |
pip | Set to true or false to enable or disable picture-in-picture mode | false |
wrapper | Element or component to use as the container element | div |
config | Override options for the various players, see config prop --> |
0.0.1
5 years ago