npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

media-scene

0.0.4 • Public • Published

media-scene npm version

A library for playing or controlling media

dependencies

Installation

npm

$ npm i media-scene

script

<script src="//daybrush.com/scenejs/release/latest/dist/scene.js"></script>
<script src="//daybrush.com/media-scene/release/latest/dist/mediascene.js"></script>

How to use

  • scene with a total length of 8 seconds and the audio will play in 7 seconds.
  • The audio ends at 7.5 because the playSpeed is 2x.
<audio style="display: none">
    <source src="clapper.wav" type="audio/wav" />
</audio>
<script>
const clapperElement = document.querySelector("audio");
const mediaScene = new MediaScene(
    8,
    {
        "./clapper.wav": {
            7: {
                seek: [0, 1],
                playSpeed: 2,
                volume: 0.7,
            },
            options: {
                element: clapperElement,
            }
        },
    }
).play();
</script> 

install

npm i media-scene

Downloadsweekly downloads

11

version

0.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability