Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone player #5

Closed
pistacchio opened this issue Oct 5, 2015 · 1 comment
Closed

Standalone player #5

pistacchio opened this issue Oct 5, 2015 · 1 comment

Comments

@pistacchio
Copy link

Hi,
I'm trying to use the library as a standalone player, without the UI part.
Since it's not documented, all I'm trying to do is:

var player = new Modplayer();
player.load('chiptune.mod');
player.onReady = function () {
    player.play();
}

It starts playing but after a short while (a couple of seconds) the song gets stuck in a loop (like repeating the same bar) and in the console I see this error:

Uncaught TypeError: Cannot read property 'player' of undefined

being thrown over and over.

@electronoora
Copy link
Owner

Hi,

Are you trying to play XM format modules? Support for them is not yet complete and there are several bugs - some of which downright crash the player.

I tried your code with a 4-channel Protracker module and this small test seems to work fine for me, at least;

<html><head>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/player.js"></script>
<script type="text/javascript" src="js/st3.js"></script>
<script type="text/javascript" src="js/pt.js"></script>
<script type="text/javascript" src="js/ft2.js"></script>
<script type="text/javascript">
  var player = new Modplayer();
  player.load('mods/mod.tf');
  player.onReady = function () {
    player.play();
  }
</script>
</head><body></body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants