funkymed-flod-module-player

1.0.0 • Public • Published

ES6 version of Flod's Module Player

Original

Updated version of Flod's module player by Christian Corti Neoart Costa Rica.

Original version released the 2012/04/30.

ES6 version

Cyril Pereira updated Flod to be compatible with ES6.

How to use it ?

Install

yarn add funkymed-flod-module-player --save

or

npm install funkymed-flod-module-player

Use

Load a module

import FlodPlayer from "funkymed-flod-module-player/src/FlodPlayer";
import ajaxLoader from "funkymed-flod-module-player/src/ajaxLoader";

function onModuleProgress(e) {
  if (e.lengthComputable) {
    const percentage = Math.round((e.loaded / e.total) * 100);
    console.log(percentage);
  }
}

let player = null;
function onModuleLoaded(bytes) {
  if (player) {
    player.stop();
  }
  player = FlodPlayer.load(bytes);
  player.loopSong = true;
  player.play();
}

ajaxLoader("mymod.xm", onModuleLoaded, onModuleProgress);

More

const title = player.title; // the title of the module
player.stop(); //stop the module
const analyser = player.analyser; // audio context analyser

Readme

Keywords

none

Package Sidebar

Install

npm i funkymed-flod-module-player

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

150 kB

Total Files

12

Last publish

Collaborators

  • funkymed