1.0.2 • Published 2 years ago

react-ambient-player v1.0.2

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

React Ambient Player

npm version npm downloads

Screenshot

Video player backlight changing according to video content

Installation

npm install react-ambient-player

Usage

import React from "react";
import AmbientPlayer from "react-ambient-player";

const App = () => {
  return (
    <AmbientPlayer
      videoProps={{
        width: 640,
        height: 360,
      }}
      sources={[
        {
          src: "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm",
          type: "video/webm",
        },
        {
          src: "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
          type: "video/mp4",
        },
      ]}
    />
  );
};

export default App;

Props

NameTypeDefaultDescription
sourcesArray<{ src: string; type: string; }>undefinedArray of sources to be used by the video element.
intervalnumber5000Frame extraction interval in milliseconds.
videoPropsVideoHTMLAttributes<HTMLVideoElement>undefinedProps to be passed to the video element.

License

MIT

Author