Git Product home page Git Product logo

react-fixed-device's Introduction

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

Property type Description Default Example
src string (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"
poster string Poster image - "./poster.png"
loop boolean Determine if video is on repeat false true
autoPlay boolean Auto play or not false true
control boolean Determine if user can stop/play it false true
color string Color of device frame "#fff" "#ababab"
size "sm" "md" "lg" Size of device "md" "sm"
position "bottomRight" "bottomLeft" "center" Default position of device "bottomRight" "center"
draggable boolean Determine if device is draggable false true
onVideoEnd ()=> void Invoked 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

react-fixed-device's People

Contributors

hirotake111 avatar

Stargazers

masx200 avatar

Watchers

 avatar

react-fixed-device's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.