🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

xaudio.js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xaudio.js

An Enhanced Web Audio Object

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

xaudio.js

A Multiple Audio Player Module

Features

  • playlist supported
  • 3 kind of play mode:single loop,list loop,random
  • skip prev and skip next
  • and more
  • just for fun, enjoy it :)

Examples

var list = [
    {
        'src' : '//xxx/song1.mp3',
    },
    {
        'src' : '//xxx/song2.mp3',
    },
    {
        'src' : '//xxx/song3.mp3',
    },
    {
        'src' : '//xxx/song4.mp3',
    },
    {
        'src' : '//xxx/song5.mp3',
    }
];

var player = new XAudio(list);

// get list length
player.listLength(); // 5
// or
player.__list.length; // 5

// play the 4th audio in the playlist
player.index(3).play();
// or
player.play(3);

// get current index
player.index(); // 3

// switch play mode [1:list,2:single,3:random]
player.mode(3);

// jump to 30%
player.progress(30);

// jump to 65s
player.currentTime(65);

// get current time
player.currentTime(); // 65

// mute
player.muted(true);

// unmute
player.muted(false);

// play next
player.next();

// and more examples is on the way

Keywords

web

FAQs

Package last updated on 15 Mar 2017

Did you know?

Socket

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