Skip to content

Commit aae5401

Browse files
committed
bump 1.3.0, update demo and docs
1 parent acc3b14 commit aae5401

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
- Clean and simple UI
1616
- Playlist
1717
- Lyrics scroll
18-
- Custom theme color
18+
- Custom theme color / Self-adapting theme color
1919
- Mutex play
20-
- HLS support (upcoming)
20+
- HLS support
2121

2222
Using Vue-APlayer in your project? [Let me know!](https://github.com/SevenOutman/vue-aplayer/issues/26)
2323

docs/README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ Props are mostly the same as [APlayer's options](https://aplayer.js.org/#/home?i
5151
| mode | String | `'circulation'` | Play mode, can be 'random' 'single 'circulation'(loop) or 'order'(no loop) |
5252
| preload | String | `'auto'` | The way to load music, can be 'none' 'metadata' or 'auto' |
5353
| listMaxHeight | String | *none* | Max height of play list |
54-
| narrow | Boolean | `false` | DEPRECATED, use `mini` instead |
55-
| listmaxheight | String | *none* | DEPRECATED, use `listMaxHeight` instead |
56-
| showlrc | Boolean | `false` | DEPRECATED, use `showLrc` instead |
54+
| narrow | | | DEPRECATED, use `mini` instead |
55+
| listmaxheight | | | DEPRECATED, use `listMaxHeight` instead |
56+
| showlrc | | | DEPRECATED, use `showLrc` instead |
5757

5858
> 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.
5959
@@ -73,9 +73,6 @@ The `music` props can either be an object containing info of the song to play, o
7373
> 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.
7474
> If your browser doesn't support fetch by default, please use polyfills like [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).
7575
76-
### HLS support
77-
Simply install [hls.js](https://github.com/video-dev/hls.js) into your project. `vue-aplayer` detects `*.m3u8` sources and handles the rest.
78-
7976
### Events
8077

8178
| Name | Params | Description |
@@ -87,6 +84,23 @@ Simply install [hls.js](https://github.com/video-dev/hls.js) into your project.
8784
| ended | none | Triggered when APlayer ended playing |
8885
| error | none | Triggered when an error occurs |
8986

87+
## Advanced
88+
89+
### Self-adapting theme color
90+
Since `v1.3.0`, if you set a **Music Object**'s `theme` property to `'pic'`, Vue-APlayer will pick color from the songs cover image as theme color.
91+
Also, you can set player's `theme` prop to `'pic'`, it will apply to every song.
92+
93+
All you need to do is adding [color-thief](https://github.com/lokesh/color-thief) to your page.
94+
> Note that color-thief is **NOT module compatible**
95+
96+
```
97+
<!-- or other CDNs you prefer -->
98+
<script src="https://cdn.jsdelivr.net/npm/colorthief@2.0.2/src/color-thief.js"></script>
99+
```
100+
101+
### HLS support
102+
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.
103+
90104
### Slots
91105

92106
- `slot="display"`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-aplayer",
3-
"version": "1.2.2",
3+
"version": "1.3.0",
44
"description": "Easy-to-config music player for Vue 2.x",
55
"main": "dist/vue-aplayer.min.js",
66
"files": [

src/demo/App.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
lrc: 'https://storage.googleapis.com/gh-pages-static/another-love.lrc'
5353
}"
5454
/>
55-
<h3>Playlist / HLS support / Per-song theme</h3>
55+
<h3>Playlist / HLS support / Per-song theme (self-adapting theme)</h3>
5656
<aplayer
5757
autoplay
58-
theme="#e6d0b2"
58+
theme="pic"
5959
mode="random"
6060
:music.sync='music3'
6161
:list='list3'
@@ -93,7 +93,6 @@
9393
author: 'RADWIMPS',
9494
url: 'https://moeplayer.b0.upaiyun.com/aplayer/yourname.mp3',
9595
pic: 'https://moeplayer.b0.upaiyun.com/aplayer/yourname.jpg',
96-
theme: '#505d6b'
9796
},
9897
{
9998
title: '光るなら.m3u8',
@@ -106,7 +105,6 @@
106105
author: 'XX:me',
107106
url: 'https://moeplayer.b0.upaiyun.com/aplayer/darling.mp3',
108107
pic: 'https://moeplayer.b0.upaiyun.com/aplayer/darling.jpg',
109-
theme: '#46718b'
110108
},
111109
]
112110
}

src/demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
</head>
99
<body>
1010
<div id="app"></div>
11+
<script src="https://cdn.jsdelivr.net/npm/colorthief@2.0.2/src/color-thief.js"></script>
1112
</body>
1213
</html>

0 commit comments

Comments
 (0)