1.0.11 • Published 2 years ago

react-fixed-device v1.0.11

Weekly downloads
-
License
MIT*
Repository
github
Last release
2 years ago

react-fixed-device

A custom device-shaped component that will play video file

  • Simple usage
  • Currently React TypeScript only

demo

Installation

npm i react-fixed-device
# or
yarn add react-fixed-device

Usage

// import component
import Device from "react-fixed-device"

// put Device component on top of window
export const App() {
    return (
        <>
          <Device src="your.mp4" autoPlay control {...otherPorps} />
          <YourComponents/>
        </>
    )
}

API

PropertytypeDescriptionDefaultExample
srcstring(Required) Path to mp4 file-"./video.mp4"
type"default" "notch" "glass"Type of device"default""glass"
mode"portrait" "landscape"Portrait mode or Landscape mode"portrait""landscape"
posterstringPoster image-"./poster.png"
loopbooleanDetermine if video is on repeatfalsetrue
autoPlaybooleanAuto play or notfalsetrue
controlbooleanDetermine if user can stop/play itfalsetrue
colorstringColor of device frame"#fff""#ababab"
size"sm" "md" "lg"Size of device"md""sm"
position"bottomRight" "bottomLeft" "center"Default position of device"bottomRight""center"
draggablebooleanDetermine if device is draggablefalsetrue
onVideoEnd()=> voidInvoked when video stopped--
  • if you set type "glass", color prop will not be honored.
  • if you set loop true, onVideEnd will not be performed.

Development notes

cd node_modules/react-dom && yarn link
cd ../react-dom/ && yarn link

cd ../../example && yarn link react && yarn react-dom

License

MIT

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.0

2 years ago