@masa-dev/react-signage

1.2.4 • Public • Published

React Signage

This is a react library for signage.

  • Auto slide image and video with cross fade.
  • Can toggle fullscreen.
  • If the browser does not support the Fullscreen API, use a pseudo fullscreen display.

Install

npm i @masa-dev/react-signage

Minimum usage

import { Signage } from '@masa-dev/react-signage'
import { useState } from 'react'

export default function App() {
    const [play, setPlay] = useState(false)
    const [fullScreen, setFullScreen] = useState(false)

    const items: SignageItem[] = [
        {
            type: 'image',
            src: '/img1.jpg',
            second: 3,
        },
        {
            type: 'video',
            src: '/video1.mp4'
        }]

    return <>

        <p>Use buttons to get user interaction for playing videos.</p>
        <button onClick={() => setPlay(!play)}>{play ? 'Stop' : 'Play'}</button>
        <button onClick={() => setFullScreen(!fullScreen)}>
            {
                fullScreen
                    ? 'Inline'
                    : document.fullscreenEnabled ? 'FullScreen' : 'Pseudo FullScreen'
            }
        </button>

        <p>Component. If not fullscreen, slideshow is shown below.</p>
        <Signage
            play={play}
            fullScreen={fullScreen}
            items={items}
        />
    </>
}

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.452latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.452
1.2.347
1.2.259
1.2.163
1.2.055
1.1.261
1.1.163
1.1.057
1.0.064
0.1.765
0.1.662
0.1.554
0.1.460
0.1.359
0.1.267
0.1.169
0.1.068

Package Sidebar

Install

npm i @masa-dev/react-signage

Weekly Downloads

1,025

Version

1.2.4

License

MIT

Unpacked Size

13.4 kB

Total Files

25

Last publish

Collaborators

  • masa-dev