Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an API to get information about the currently playing audio?如何获取当前正在播放的音频的信息? #778

Open
felixwann opened this issue Jun 15, 2023 · 1 comment

Comments

@felixwann
Copy link

English:

Song title, artist, lyrics, and other attribute values ​​in the audio array object?
For example: Suppose there is a button on the page, when I click the button, I can get the current playing information through this API.

中文

如何获取当前正在播放的音频的信息?标题、艺人、歌词、以及audio数组对象里的其他信息?
例如:假设页面上有一个按钮,当我点击这个按钮时,获取当前播放的信息。

@felixwann
Copy link
Author

自问自答,偶然间发现的

const ap = new APlayer(options);

ap.on('play', function (e) {
  console.log(e);
  console.log(ap.list.audios[ap.list.index]);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant