Giter Site home page Giter Site logo

libsonginfo's Introduction

LibSongInfo

一个 BetterNCM 插件,用于向其他插件提供获取原生正在播放音乐的信息。

简便使用方法

为保障加载插件顺序,请先在 manifest.jsonloadAfter 数组中加入本依赖 ID libsonginfo

获取正在播放的音乐信息:

loadedPlugins.libsonginfo.getPlaying(); // 调用获取
console.log(loadedPlugins.libsonginfo.trackPlaying); // 直接获取属性

监听播放中的音乐的变更,回调内可以再次调用上方的 getPlaying()trackPlaying 来获取最新的音乐信息。

loadedPlugins.libsonginfo.addEventListener("playing-updated", () => {});

简便函数

获取正在播放的音乐 ID,如果为 0 则为未找到:

loadedPlugins.libsonginfo.getMusicId();

获取当前播放状态,返回 1 则为正在播放,返回 2 则为暂停中:

loadedPlugins.libsonginfo.playState();

更多 API 请参阅源代码

libsonginfo's People

Contributors

steve-xmh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.