Socket
Socket
Sign inDemoInstall

mp3.js

Package Overview
Dependencies
17
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mp3.js

Dead simple HTML5 audio player with flash fallback


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

mp3.js

Dead Simple Audio for the Web
quizlet.github.io/mp3.js

1. Get It!

Download mp3.js

2. Include mp3.js on your page

<html>
  <head>
    ...
    <script type="text/javascript" src="/path/to/mp3.js" />
  </head>
...

3. Drop some beats

var player = new AudioPlayer();

// easy playing
player.play('/hammertime.mp3');

// supports preloading
player.preload('/what-the-fox-say.mp3');

// plays audio with custom callback events
// waits 5 seconds for the file to load before triggering onError
player.play('/all-along-the-watchtower.mp3', {
  onLoad: function() { console.log('Audio Loaded!'); },
  onError: function() { console.log('Error Loading Audio!'); },
  onStop: function() { console.log('Audio Stopped Playing!'); },
  timeout: 5000
});

// stop everything at any time
player.stopAll();

// or just stop playing a single file
player.stop('/hammertime.mp3');

Keywords

FAQs

Last updated on 22 Oct 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc