3.5.9 • Published 11 months ago

@masa-dev/react-signage v3.5.9

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

React Signage

This is a react library for signage.

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

See the demo site for example.

Support browser

This library supports Chrome.

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.
         To use IndexedDB cache, set 'useDbCache' parameter.
        </p>
        <Signage
            play={play}
            fullScreen={fullScreen}
            items={items}
            useDbCache={true}
        />

        <p>Preloader (Optional, but recommended for Safari). Preload media files into IndexedDB.</p>
        <Cacher
            items={cacheItems}
            renderProgress={({ progress, queue }) => <div>
                {progress
                    ? <>
                        loading...
                        {Math.round(progress.progress * 100)}%
                        <br />
                        {progress.src}
                    </>
                    : 'done'
                }
            </div>}
        />
    </>
}

License

MIT

3.5.9

11 months ago

3.5.8

11 months ago

3.5.7

11 months ago

3.5.6

11 months ago

3.5.5

11 months ago

3.5.4

11 months ago

3.5.3

11 months ago

3.5.2

11 months ago

3.5.1

11 months ago

3.5.0

11 months ago

3.4.4

11 months ago

3.4.3

11 months ago

3.4.2

11 months ago

3.4.1

11 months ago

3.4.0

11 months ago

3.3.0

11 months ago

3.2.0

11 months ago

3.1.7

11 months ago

3.1.6

11 months ago

3.1.5

11 months ago

3.1.4

11 months ago

3.1.3

11 months ago

3.1.2

11 months ago

3.1.1

11 months ago

3.1.0

11 months ago

3.0.1

11 months ago

3.0.0

11 months ago

2.4.0

11 months ago

2.3.5

11 months ago

2.3.4

11 months ago

2.3.3

11 months ago

2.3.2

11 months ago

2.3.1

11 months ago

2.3.0

11 months ago

2.2.5

11 months ago

2.2.4

11 months ago

2.2.3

11 months ago

2.2.2

11 months ago

2.2.1

11 months ago

2.2.0

11 months ago

2.1.0

11 months ago

2.0.3

11 months ago

2.0.2

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.3.4

11 months ago

1.3.3

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.2.5

11 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.2.0

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.0

12 months ago

0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago