Vue-APlayer Component

1.6.1 · maintenance · verified Sun Apr 19

Vue-APlayer is an easy-to-use music player component designed for Vue 2.x applications, built upon the APlayer prototype. The current stable version, 1.6.1, is the final minor release within the 1.x series; development efforts for new features are now directed towards an upcoming Vue-APlayer 2. Consequently, the 1.x branch is in maintenance mode, receiving only bug fixes and critical patches. Its key differentiators include a clean, highly customizable user interface featuring lyrics scrolling, playlist management with shuffle and repeat controls, drag-and-place functionality, mutex play, and integrated HLS support. The library is notably lightweight (16KB gzipped) and maintains minimal external dependencies beyond its required Vue peer dependency, providing a simple and easy-to-integrate API. It supports dynamic theme colors, including self-adapting themes based on album artwork.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to globally register the Vue-APlayer component and embed it into a Vue instance with a playlist, autoplay, custom theme, and initial playlist state.

import Vue from 'vue';
import Aplayer from 'vue-aplayer';

// Register globally or locally
Vue.component('APlayer', Aplayer);

new Vue({
  el: '#app',
  template: `
    <div>
      <h1>My Music Player</h1>
      <aplayer autoplay
        :music='[
          {
            title: "secret base~君がくれたもの~",
            artist: "Silent Siren",
            src: "https://moeplayer.b0.upaiyun.com/aplayer/secretbase.mp3",
            pic: "https://moeplayer.b0.upaiyun.com/aplayer/secretbase.jpg",
            lrc: "[00:00.00]test
[00:00.50]lyrics
[00:01.00]here"
          },
          {
            title: "Another Song",
            artist: "Another Artist",
            src: "https://moeplayer.b0.upaiyun.com/aplayer/hikarunara.mp3",
            pic: "https://moeplayer.b0.upaiyun.com/aplayer/hikarunara.jpg"
          }
        ]'
        :list-folded="false"
        theme="#F06292"
      ></aplayer>
    </div>
  `
});

view raw JSON →