stringimport { APlayer } from '@moefe/vue-aplayer';
console.log(APlayer.version);
APlayer.MediaMedia 对象const { media } = this.$refs.aplayer;
console.log(media.currentTime); // 获取音频当前播放时间
console.log(media.duration); // 获取音频总时间
console.log(media.paused); // 获取音频是否暂停
警告
如果你想切换到播放列表中的其他音频请使用 switch 方法,而不要直接设置它
APlayer.Audioconsole.log(this.$refs.aplayer.currentMusic);
FunctionPromise<void>this.$refs.aplayer.play();
Functionvoidthis.$refs.aplayer.pause();
Functionvoidthis.$refs.aplayer.toggle();
Functiontime numbervoidthis.$refs.aplayer.seek(100);
Functionaudio number | stringvoidthis.$refs.aplayer.switch(1); // 切换到播放列表中的第二首歌
this.$refs.aplayer.switch('东西'); // 切换到播放列表中歌曲名包含“东西”的第一首歌
Functionvoidthis.$refs.aplayer.skipBack();
Functionvoidthis.$refs.aplayer.skipForward();
Functiontext stringtime number?opacity number?Promise<void>this.$refs.aplayer.showNotice('喵喵喵');
Functionvoidthis.$refs.aplayer.showLrc();
Functionvoidthis.$refs.aplayer.hideLrc();
Functionvoidthis.$refs.aplayer.toggleLrc();
Functionvoidthis.$refs.aplayer.showList();
Functionvoidthis.$refs.aplayer.hideList();
Functionvoidthis.$refs.aplayer.toggleList();