diff --git a/dist/LICENSE b/dist/LICENSE new file mode 100644 index 00000000..1ccb8e39 --- /dev/null +++ b/dist/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Chintan Prajapati + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dist/README.md b/dist/README.md new file mode 100644 index 00000000..2e283a83 --- /dev/null +++ b/dist/README.md @@ -0,0 +1,196 @@ +

Plyr React

+

plyr-react logo

+ +

+A responsive media player that is simple, easy to use, and customizable for video, audio, YouTube, and Vimeo. +
+ tree-shakeable + side-effect free +

+ +

+ + License + + + Code quality + + + Build Size + + + Version + + + Downloads + +

+ +You can see a live demo [here](https://githubbox.com/chintan9/plyr-react/tree/master/example/react). + +> Make sure to select the version for the plyr-react in the dependencies. + +## Installation + +```bash +# NPM +npm install plyr-react + +# Yarn +yarn add plyr-react +``` + +## Usage + +### Ready to use `` component + +The simplest form of react integration with the plyr is to use the `` component, it is best for the static +videos. + +```tsx +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 +} +``` + +
+Old version 4 plyr-react +- The path for an import of css styles has been changed in version 5, if you are using the version 4, apply following change in the above code + +```diff +- import "plyr-react/plyr.css" ++ import "plyr-react/dist/plyr.css" +``` + +
+ +### Ready to use `usePlyr` hook + +If 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](https://github.com/chintan9/plyr-react/issues/732#issuecomment-1029714462) and +this [proposal](https://github.com/chintan9/plyr-react/issues/678#issue-1043113412). + +```jsx +const Plyr = React.forwardRef((props, ref) => { + const { source, options = null, ...rest } = props + const raptorRef = usePlyr(ref, { + source, + options, + }) + return