You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Props are mostly the same as [APlayer's options](https://aplayer.js.org/#/home?id=options).
52
-
53
-
| Name | Type | Default | Description |
54
-
| ---- | ---- | ------- | ----------- |
55
-
| music| Object |*required*| Music info for current playing music, see [Music info](https://github.com/SevenOutman/vue-aplayer#music-info)|
56
-
| list | Array |`[]`| Music list to play and display. If list is not empty, music list panel will be shown, even if the only song in the list is identical to music prop. |
57
-
| mini | Boolean |`false`| Mini mode |
58
-
| float | Boolean |`false`| Float mode, in which you can drag the player around and leave it anywhere on your page |
59
-
| autoplay | Boolean |`false`| Whether to autoplay. If more than one mutex player are set autoplay, only the first one will play. |
60
-
| showlrc | Boolean |`false`| Whether to show lyrics or not |
61
-
| mutex | Boolean |`true`| Pause other players when this player is playing |
62
-
| theme | String |`'#b7daff'`| Theme color |
63
-
| mode | String |`'circulation'`| Play mode, can be 'random' 'single 'circulation'(loop) or 'order'(no loop) |
64
-
| preload | String |`'auto'`| The way to load music, can be 'none' 'metadata' or 'auto' |
65
-
| listMaxHeight | String |*none*| Max height of play list |
66
-
| narrow | Boolean |`false`| DEPRECATED, use `mini` instead |
67
-
| listmaxheight | String |*none*| DEPRECATED, use `listMaxHeight` instead |
68
-
69
-
> If you are using Vue@2.3.0+, you can use [`.sync` Modifier](https://vuejs.org/v2/guide/components.html#sync-Modifier) on `music` and `mode` prop.
70
-
71
-
### Music info
72
-
73
-
The `music` props can either be an object containing info of the song to play, or an array of such objects.
74
-
75
-
| Property | Default | Description |
76
-
| -------- | ------- | ----------- |
77
-
| url |*required*| music url |
78
-
| title |`'Untitled'`| music title |
79
-
| author |`'Unknown'`| music author |
80
-
| pic |*none*| music cover picture |
81
-
| lrc |*none*| lrc or url to a .lrc file, see: [LRC](https://aplayer.js.org/#/home?id=lrc)|
82
-
83
-
> vue-aplayer uses [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to load your lrc when it's a url.
84
-
> If your browser doesn't support fetch by default, please use polyfills like [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).
85
-
86
-
### Events
87
-
88
-
| Name | Params | Description |
89
-
| ---- | ------ | ----------- |
90
-
| play | none | Triggered when APlayer start play |
91
-
| pause | none | Triggered when APlayer paused |
92
-
| canplay | none | Triggered when enough data is available that APlayer can play |
93
-
| playing | none | Triggered periodically when APlayer is playing |
94
-
| ended | none | Triggered when APlayer ended playing |
95
-
| error | none | Triggered when an error occurs |
96
-
97
-
### Slots
98
-
99
-
-`slot="display"`
100
-
101
-
This slot represents the content displayed on the music info panel, which by default is the lyric scroll.
102
-
103
-
The component in this slot will receive two props: `currentMusic` and `playStat`.
Since `v1.3.0`, Vue-APlayer supports `*.m3u8` media as an optional functionality. Simply install [hls.js](https://github.com/video-dev/hls.js) into your project, and Vue-APlayer handles the rest.
0 commit comments