Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

audio_x

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio_x - npm Package Compare versions

Comparing version 1.0.5-3 to 1.0.5

2

package.json
{
"name": "audio_x",
"version": "1.0.5-3",
"version": "1.0.5",
"description": "The audio player for the gen-x",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -42,3 +42,3 @@ ## audio_x

- Ads Support
- Queue Support and etc.
- ~~Queue Support~~ [✓] Done.

@@ -248,2 +248,53 @@ ### Installation

### Adding and Handling Queue
// Audio_x allows you to play audio in queue.
```
// To add a queue
const tracks = [track_1, track_2, ...other_tracks]
audio.addQueue(tracks, "DEFAULT");
NOTE: addQueue takes two parameters one is tracks array and second is playback type i.e "DEFAULT" | "REVERSE" | "SHUFFLE"
if no playbackType is passed audio_x will play it as DEFAULT
// To Play the Queue from the beginning, call addMediaAndPlay like below.
audio.addMediaAndPlay();
// if you are fetching something dynamically to play audio, such as source of the audio you can do it like below.
audio.addMediaAndPlay(null, async (currentTrack: MediaTrack) => {
const res = await fetch('url);
currentTrack.source = res.data.url;
});
// This will make sure that the above function gets called before every audio that plays in a queue.
```
```
// To add a single track to queue
audio.addToQueue(track);
```
```
// To clear Queue
audio.clearQueue();
```
```
// To play Next in Queue
audio.playNext();
```
```
// To play Previous in Queue
audio.playPrevious();
```
### Author

@@ -250,0 +301,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc