3 Commits
Author SHA1 Message Date
DIYgod 12fc04957d new option: preload 2016-06-13 14:23:51 +08:00
DIYgod c5776b2a78 fix bugs in HTML 2016-06-13 14:06:27 +08:00
DIYgod 548faa4bf3 add related project: 163music-APlayer-you-get-docker 2016-05-15 18:32:58 +08:00
6 changed files with 18 additions and 9 deletions
+6 -3
View File
@@ -7,7 +7,7 @@
[![Travis](https://img.shields.io/travis/DIYgod/APlayer.svg?style=flat-square)](https://travis-ci.org/DIYgod/APlayer)
[![%e2%9d%a4](https://img.shields.io/badge/made%20with-%e2%9d%a4-ff69b4.svg?style=flat-square)](https://www.anotherhome.net/)
Wow, such a beautiful html5 music player
> Wow, such a beautiful html5 music player
## Introduction
@@ -58,6 +58,7 @@ var option = {
mutex: true, // Optional, pause other players when this player playing
theme: '#e6d0b2', // Optional, theme color, default: #b7daff
loop: true, // Optional, loop play music, default: true
preload: 'metadata', // Optional, the way to load music, can be 'none' 'metadata' 'auto', default: 'metadata' in Desktop, 'none' in mobile
music: { // Required, music info, see: ###With playlist
title: 'Preparation', // Required, music title
author: 'Hans Zimmer/Richard Harvey', // Required, music author
@@ -191,9 +192,11 @@ $ npm run build
## Related Projects
+ [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin)
- [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin)
+ [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer)
- [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer)
- [163music-APlayer-you-get-docker](https://github.com/YUX-IO/163music-APlayer-you-get-docker)
## LICENSE
+1
View File
@@ -5,6 +5,7 @@ var ap1 = new APlayer({
showlrc: false,
mutex: true,
theme: '#e6d0b2',
preload: 'metadata',
music: {
title: 'Preparation',
author: 'Hans Zimmer/Richard Harvey',
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "aplayer",
"version": "1.4.5",
"version": "1.4.6",
"description": "Wow, such a beautiful html5 music player",
"main": "dist/APlayer.min.js",
"scripts": {
+8 -3
View File
@@ -175,7 +175,7 @@
// fill in HTML
let eleHTML = `
<div class="aplayer-pic" ${(this.music.pic ? (`style="background-image: url("${encodeURI(this.music.pic)}");"`) : ``)}>
<div class="aplayer-pic" ${(this.music.pic ? (`style="background-image: url(${encodeURI(this.music.pic)});"`) : ``)}>
<div class="aplayer-button aplayer-play">
<i class="demo-icon aplayer-icon-play"></i>
</div>
@@ -455,7 +455,12 @@
if ((this.multiple && !this.audios[indexMusic]) || this.playIndex === -1) {
this.audio = document.createElement("audio");
this.audio.src = this.music.url;
this.audio.preload = this.isMobile ? 'none' : 'metadata';
if (this.option.preload) {
this.audio.preload = this.option.preload;
}
else {
this.audio.preload = this.isMobile ? 'none' : 'metadata';
}
// show audio time: the metadata has loaded or changed
this.audio.addEventListener('durationchange', () => {
@@ -629,7 +634,7 @@
}
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = APlayer
module.exports = APlayer;
}
else {
window.APlayer = APlayer;