0.3.0 • Published 2 years ago

react-niconico v0.3.0

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

react-niconico

CI npm version

Overlay text like Niconico.

Online demo: https://react-niconico.vercel.app/

Installation

Using yarn:

$ yarn add react-niconico

Using npm:

$ npm install react-niconico

Usage

import { useEffect } from "react";
import { useNiconico } from "react-niconico";

export const App = () => {
  const [ref, emitText] = useNiconico();

  const handleClick = () => {
    emitText("Hello, World!");
  };

  return (
    <div>
      <video ref={ref} src="/sample.mp4" />
      <button onClick={handleClick}>Emit comment</button>
    </div>
  );
};

Options

const [ref, emitText] = useNiconico({
  // options...
});
nametyperequireddescriptiondefault
displayMillisnumberoptionaltime to display text in milliseconds5000
fontSizenumberoptionalfont size of text (px)1/10 of height
borderWidthnumberoptionalwidth of the border4

License

MIT

0.3.0

2 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago