Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Plyr | 23,414 | 277 | 145 | 3 days ago | 153 | April 20, 2022 | 806 | mit | JavaScript | |
A simple HTML5, YouTube and Vimeo player | ||||||||||
React Player | 7,523 | 1,080 | 517 | 10 days ago | 147 | September 16, 2022 | 199 | mit | JavaScript | |
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion | ||||||||||
Lightgallery | 5,730 | 122 | 26 | 24 days ago | 107 | September 19, 2022 | 50 | other | TypeScript | |
A customizable, modular, responsive, lightbox gallery plugin. | ||||||||||
Lightgallery.js | 5,223 | 54 | 25 | 8 months ago | 15 | October 29, 2020 | 2 | other | JavaScript | |
Full featured JavaScript image & video gallery. No dependencies | ||||||||||
Lite Youtube Embed | 4,548 | 2 | a month ago | 8 | March 17, 2021 | 35 | other | JavaScript | ||
A faster youtube embed. | ||||||||||
Alltube | 2,798 | 3 | 6 days ago | 54 | March 08, 2022 | 43 | gpl-3.0 | PHP | ||
Web GUI for youtube-dl | ||||||||||
Vime | 2,444 | 11 | 21 days ago | 81 | September 13, 2022 | 153 | mit | TypeScript | ||
Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion... | ||||||||||
Jarallax | 1,248 | 102 | 25 | 10 days ago | 30 | March 30, 2022 | 18 | mit | JavaScript | |
Parallax scrolling for modern browsers | ||||||||||
Jquery.mb.ytplayer | 1,231 | 17 | 10 months ago | 24 | December 04, 2020 | 36 | JavaScript | |||
use a custom yutube player for a video as background on jQuery framework | ||||||||||
Richtextview | 1,124 | 1 | 2 months ago | 53 | January 25, 2022 | 37 | apache-2.0 | Swift | ||
iOS Text View (UIView) that Properly Displays LaTeX, HTML, Markdown, and YouTube/Vimeo Links |
A responsive media player that is simple, easy to use, and customizable for video, audio, YouTube, and Vimeo.
You can see a live demo here.
Make sure to select the version for the plyr-react in the dependencies.
# NPM
npm install plyr-react
# Yarn
yarn add plyr-react
<Plyr />
componentThe simplest form of react integration with the plyr is to use the <Plyr />
component, it is best for the static
videos.
import Plyr from "plyr-react"
import "plyr-react/plyr.css"
const plyrProps = {
source: undefined, // https://github.com/sampotts/plyr#the-source-setter
options: undefined, // https://github.com/sampotts/plyr#options
// Direct props for inner video tag (mdn.io/video)
}
function MyPlyrVideo() {
return <Plyr {...plyrProps} />
}
- import "plyr-react/plyr.css"
+ import "plyr-react/dist/plyr.css"
usePlyr
hookIf you need the full control over all if possible integration one can imagine, usePlyr is your hook. Here is a simple
and exact Plyr component made with the usePlyr
hook. Are curios about how it works follow
this thread and
this proposal.
const Plyr = React.forwardRef((props, ref) => {
const { source, options = null, ...rest } = props
const raptorRef = usePlyr(ref, {
source,
options,
})
return <video ref={raptorRef} className="plyr-react plyr" {...rest} />
})
// Function base component
const MyComponent = () => {
const ref = useRef()
useEffect(() => {
console.log("internal plyr instance:", ref.current.plyr)
})
return <Plyr ref={ref} />
}
// Class base component
class MyComponent extends Component {
constructor(props) {
super(props)
this.player = createRef()
}
componentDidMount() {
console.log("internal plyr instance", this.player.current.plyr)
}
render() {
return <Plyr ref={(player) => (this.player.current = player)} />
}
}
Currently the exported APIs contains a latest instance of plyr.
In other words, the passing ref will have access to the player in the structure shown below.
return <Plyr ref={ref} />
// ref can get access to latest plyr instance with `ref.current.plyr`
ref = { current: { plyr } }
// so you can make your player fullscreen 🎉
ref.current.plyr.fullscreen.enter()
You can fork these examples
Basic HLS integration Codesandbox
Check out the examples directory for the useHls integration guide.
<video
ref={usePlyr(ref, {
...useHls(hlsSource, options),
source,
})}
className="plyr-react plyr"
/>
Demo: https://react-fpmwns.stackblitz.io
We are open to all new contribution, feel free to
read CONTRIBUTING
and CODE OF CONDUCT section, make new issue to
discuss about the problem
, and improve/fix/enhance the source code with your PRs. There is a ready to code Gitpod, you
can jump into it
from
If you like the project and want to support my work, give star ⭐ or fork it.