npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tauri-plugin-music-notification-api

v0.1.0

Published

A Tauri plugin for Android that provides music playback notifications with media controls.

Readme

Tauri Plugin Music Notification

A Tauri plugin for Android that provides music playback notifications with media controls.

Features

  • 🎵 Play music from URLs with media notifications
  • 🎮 Full playback controls (play, pause, resume, stop)
  • ⏭️ Next/Previous track navigation
  • ⏩ Seek to specific positions
  • 📊 Get current playback state
  • 🔔 Native Android media notification with controls
  • 🎨 Lock screen controls support

Installation

Install the plugin using your preferred package manager:

npm run tauri add tauri-plugin-music-notification-api

Add the plugin to your Cargo.toml:

[dependencies]
tauri-plugin-music-notification = "0.1.0"

Setup

Rust

Register the plugin in your Tauri app:

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_music_notification::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Permissions

Add the required permissions to your src-tauri/capabilities/default.json:

{
  "permissions": [
    "music-notification:default"
  ]
}

Android

The plugin automatically includes the required Android permissions:

  • INTERNET - For streaming audio
  • FOREGROUND_SERVICE - For background playback
  • FOREGROUND_SERVICE_MEDIA_PLAYBACK - For media playback service
  • POST_NOTIFICATIONS - For displaying notifications

Usage

JavaScript/TypeScript

import { play, pause, resume, stop, next, previous, seek, getState } from 'tauri-plugin-music-notification-api';

// Play music
await play({
  url: "https://example.com/song.mp3",
  title: "Song Title",
  artist: "Artist Name",
  album: "Album Name"
});

// Pause playback
await pause();

// Resume playback
await resume();

// Stop playback
await stop();

// Skip to next track
await next();

// Go to previous track
await previous();

// Seek to position (in milliseconds)
await seek(30000); // Seek to 30 seconds

// Get current playback state
const state = await getState();
console.log(state.isPlaying); // true/false
console.log(state.position);  // Current position in ms
console.log(state.duration);  // Total duration in ms

API Reference

play(options: PlayOptions)

Starts playing music from a URL.

Parameters:

  • url (string, required): The URL of the audio file
  • title (string, optional): Song title
  • artist (string, optional): Artist name
  • album (string, optional): Album name

Returns: Promise<{ success: boolean; message?: string }>

pause()

Pauses the current playback.

Returns: Promise<{ success: boolean }>

resume()

Resumes paused playback.

Returns: Promise<{ success: boolean }>

stop()

Stops playback and clears the notification.

Returns: Promise<{ success: boolean }>

next()

Skips to the next track (if available in playlist).

Returns: Promise<{ success: boolean }>

previous()

Goes back to the previous track (if available in playlist).

Returns: Promise<{ success: boolean }>

seek(position: number)

Seeks to a specific position in the current track.

Parameters:

  • position (number): Position in milliseconds

Returns: Promise<{ success: boolean }>

getState()

Gets the current playback state.

Returns: Promise<PlaybackState>

interface PlaybackState {
  isPlaying: boolean;
  position: number;  // in milliseconds
  duration: number;  // in milliseconds
}

Platform Support

| Platform | Supported | |----------|-----------| | Android | ✅ | | iOS | ❌ | | Windows | ❌ | | macOS | ❌ | | Linux | ❌ |

Currently, this plugin only supports Android. Desktop implementations return placeholder responses.

Example

Check out the example app for a complete implementation.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.