[
  {
    "path": ".eslintignore",
    "content": "dist\ndemo\ndocs"
  },
  {
    "path": ".eslintrc",
    "content": "{\n    \"extends\": [\"eslint:recommended\", \"plugin:prettier/recommended\"],\n    \"plugins\": [\"prettier\"],\n    \"parserOptions\": {\n        \"ecmaVersion\": 2018,\n        \"sourceType\": \"module\"\n    },\n    \"env\": {\n        \"es6\": true,\n        \"browser\": true,\n        \"node\": true,\n    },\n    \"rules\": {\n        \"block-scoped-var\": 1,\n        \"curly\": 1,\n        \"eqeqeq\": 1,\n        \"no-global-assign\": 1,\n        \"no-implicit-globals\": 1,\n        \"no-labels\": 1,\n        \"no-multi-str\": 1,\n        \"comma-spacing\": 1,\n        \"comma-style\": 1,\n        \"func-call-spacing\": 1,\n        \"keyword-spacing\": 1,\n        \"linebreak-style\": 1,\n        \"no-multiple-empty-lines\": 1,\n        \"space-infix-ops\": 1,\n        \"arrow-spacing\": 1,\n        \"no-var\": 1,\n        \"prefer-const\": 1,\n        \"no-unsafe-negation\": 1,\n        \"array-callback-return\": 1,\n        \"dot-notation\": 1,\n        \"no-eval\": 1,\n        \"no-extend-native\": 1,\n        \"no-extra-label\": 1,\n        \"semi\": 1,\n        \"space-before-blocks\": 1,\n        \"space-in-parens\": 1,\n        \"space-unary-ops\": 1,\n        \"spaced-comment\": 1,\n        \"arrow-body-style\": 1,\n        \"arrow-parens\": 1,\n        \"no-restricted-imports\": 1,\n        \"no-duplicate-imports\": 1,\n        \"no-useless-computed-key\": 1,\n        \"no-useless-rename\": 1,\n        \"rest-spread-spacing\": 1,\n        \"no-trailing-spaces\": 1,\n        \"no-control-regex\": 0,\n        \"prettier/prettier\": 0,\n        \"no-await-in-loop\": 1,\n        \"require-atomic-updates\": 0,\n        \"no-prototype-builtins\": 0\n    }\n}\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "中文用户请注意：请尽量用**英文**描述你的 issue，这样能够让尽可能多的人帮到你。\n\nIf you want to report a bug, please provide the following information:\n\n-   The steps to reproduce.\n-   A minimal demo of the problem via https://jsfiddle.net or http://codepen.io/pen if possible.\n-   Which versions of APlayer, and which browser / OS are affected by this issue?\n"
  },
  {
    "path": ".gitignore",
    "content": ".idea\nnode_modules\ndemo2\nnpm-debug.log"
  },
  {
    "path": ".prettierignore",
    "content": "dist\ndemo\ndocs"
  },
  {
    "path": ".prettierrc",
    "content": "{\n    \"printWidth\": 233,\n    \"tabWidth\": 4,\n    \"singleQuote\": true,\n    \"trailingComma\": \"es5\",\n    \"arrowParens\": \"always\"\n}\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\n\nnode_js:\n  - lts/*\n\nscript:\n  - npm run build\n\ncache:\n  yarn: true\n  directories:\n    - node_modules"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) DIYgod <diy.d.god@gmail.com> (https://www.anotherhome.net/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n<img src=\"https://i.imgur.com/LnPvZvO.png\" alt=\"ADPlayer\" width=\"100\">\n</p>\n<h1 align=\"center\">APlayer</h1>\n\n> Wow, such a lovely HTML5 music player\n\n[![npm](https://img.shields.io/npm/v/aplayer.svg?style=flat-square)](https://www.npmjs.com/package/aplayer)\n[![npm](https://img.shields.io/npm/l/aplayer.svg?style=flat-square)](https://github.com/MoePlayer/APlayer/blob/master/LICENSE)\n[![npm](https://img.shields.io/npm/dt/aplayer.svg?style=flat-square)](https://www.npmjs.com/package/aplayer)\n[![size](https://badge-size.herokuapp.com/MoePlayer/APlayer/master/dist/APlayer.min.js?compression=gzip&style=flat-square)](https://github.com/MoePlayer/APlayer/tree/master/dist)\n[![Travis](https://img.shields.io/travis/MoePlayer/APlayer.svg?style=flat-square)](https://travis-ci.org/MoePlayer/APlayer)\n[![devDependency Status](https://img.shields.io/david/dev/MoePlayer/aplayer.svg?style=flat-square)](https://david-dm.org/MoePlayer/APlayer#info=devDependencies)\n[![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?style=flat-square)](https://github.com/MoePlayer/APlayer#donate)\n\n## Introduction\n\n![image](https://i.imgur.com/JDrJXCr.png)\n\nAPlayer is a lovely HTML5 music player.\n\n**APlayer supports:**\n\n-   Media formats - MP4 H.264 (AAC or MP3) - WAVE PCM - Ogg Theora Vorbis\n-   Features - Playlist - Lyrics\n\nUsing APlayer on your project? [Let me know!](https://github.com/MoePlayer/APlayer/issues/79)\n\n**[Docs](https://aplayer.js.org)**\n\n**[中文文档](https://aplayer.js.org/#/zh-Hans/)**\n\n## Join the Discussion\n\n-   [Telegram Group](https://t.me/adplayer)\n-   [QQ Group](https://shang.qq.com/wpa/qunwpa?idkey=bf22213ae0028a82e5adf3f286dfd4f01e0997dc9f1dcd8e831a0a85e799be17): 415835947\n\n## Related Projects\n\n### Plugins\n\n-   [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin): Typecho\n-   [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer): Hexo\n-   [Hermit-X(APlayer for WordPress)](https://github.com/liwanglin12/Hermit-X): WordPress\n-   [APlayerHandle](https://github.com/kn007/APlayerHandle): WordPress\n-   [APlayer_for_Z-BlogPHP](https://github.com/fghrsh/APlayer_for_Z-BlogPHP): Z-BlogPHP\n-   [react-aplayer](https://github.com/sabrinaluo/react-aplayer): React\n-   [Vue-APlayer](https://github.com/SevenOutman/vue-aplayer): Vue\n-   [vue-aplayer](https://github.com/MoeFE/vue-aplayer): Vue\n-   [php-aplayer](https://github.com/Daryl-L/php-aplayer): PHP\n-   [aplayer-hugo-module](https://github.com/Runzelee/aplayer-hugo-module): Hugo\n\n### Tooling\n\n-   [APlayer-Controler](https://github.com/Mashiro-Sorata/APlayer-Controler): controling tool\n-   [MetingJS](https://github.com/metowolf/MetingJS): work with Meting music API\n-   Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/APlayer/issues/79)\n\n## Who use APlayer?\n\n-   [bilibili](https://www.bilibili.com/): 国内知名的视频弹幕网站\n-   [黑客派](https://hacpai.com/): 程序员和设计师的聚集地，一个活跃的小众社区\n-   [浙江大学 CC98 论坛](https://zh.wikipedia.org/wiki/CC98%E8%AE%BA%E5%9D%9B): 浙江大学校网内规模最大的论坛，中国各大学中较活跃的 BBS 之一\n-   [Jelly Rue](http://jellyrue.com/): Jelly Rue, an indie pop-rock band from Tartu.\n-   [Opus](http://www.opusopus.co/): An artist-exploration data visualization application\n-   [站长之家](http://www.chinaz.com/15year/index.html): 针对中文站点提供资讯、技术、资源、服务\n-   [LLSupport](https://www.lovelivesupport.com/): This site provides a lot of information about LoveLive\n-   [歌词千寻](https://www.lrcgc.com/diy): 每日更新的 LRC 歌词网站\n-   [iSearch](http://i.oppsu.cn): 一个提供 iTunes 搜索,试听,高清专辑封面获取,查看最新音乐动态等综合性平台\n-   [LRC 歌词编辑器](https://github.com/MoeFE/Lyric): 一款非常实用的在线 LRC 歌词编辑器\n-   [Аэростатика](https://aerostatica.ru/)\n-   [HealthDig](https://healthdig.co): 每天只需两分钟的重点新闻资讯\n-   Feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/APlayer/issues/79)\n\n## Current Premium Sponsors\n\n### Special Sponsors\n\n<a href=\"https://www.dogecloud.com/?ref=dplayer\" target=\"_blank\">\n    <img width=\"222px\" src=\"https://player.dogecloud.com/img/logo_with_product3.png\">\n</a>\n\n## Contributors\n\nThis project exists thanks to all the people who contribute.\n\n<a href=\"https://github.com/MoePlayer/APlayer/graphs/contributors\"><img src=\"https://opencollective.com/APlayer/contributors.svg?width=890\" /></a>\n\n## Donate\n\nAPlayer is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.\n\nYou can support APlayer via donations.\n\n### Recurring Donation\n\n-   Become a Sponser on [GitHub](https://github.com/sponsors/DIYgod)\n-   Become a Sponser on [Patreon](https://www.patreon.com/DIYgod)\n-   Become a Sponser on [爱发电](https://afdian.net/@diygod)\n-   Contact us directly: i@diygod.me\n\n### One-time Donation\n\nWe accept donations via the following ways:\n\n-   [WeChat Pay](https://diygod.me/images/wx.jpg)\n-   [Alipay](https://diygod.me/images/zfb.jpg)\n-   [Paypal](https://www.paypal.me/DIYgod)\n\n## Author\n\n**APlayer** © [DIYgod](https://github.com/DIYgod), Released under the [MIT](./LICENSE) License.<br>\nAuthored and maintained by DIYgod with help from contributors ([list](https://github.com/DIYgod/APlayer/contributors)).\n\n> [Blog](https://diygod.me) · GitHub [@DIYgod](https://github.com/DIYgod) · Twitter [@DIYgod](https://twitter.com/DIYgod) · Telegram Channel [@awesomeDIYgod](https://t.me/awesomeDIYgod)\n"
  },
  {
    "path": "demo/demo.js",
    "content": "const ap1 = new APlayer({\n    element: document.getElementById('player1'),\n    mini: false,\n    autoplay: false,\n    lrcType: false,\n    mutex: true,\n    preload: 'metadata',\n    audio: [{\n        name: '光るなら',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        theme: '#ebd0c2'\n    }]\n});\nap1.on('play', function () {\n    console.log('play');\n});\nap1.on('play', function () {\n    console.log('play play');\n});\nap1.on('pause', function () {\n    console.log('pause');\n});\nap1.on('canplay', function () {\n    console.log('canplay');\n});\nap1.on('playing', function () {\n    console.log('playing');\n});\nap1.on('ended', function () {\n    console.log('ended');\n});\nap1.on('error', function () {\n    console.log('error');\n});\n\nconst ap2 = new APlayer({\n    element: document.getElementById('player2'),\n    mini: true,\n    autoplay: false,\n    lrcType: false,\n    mutex: true,\n    audio: [{\n        name: '光るなら',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n        theme: '#ebd0c2'\n    }]\n});\n\nconst ap3 = new APlayer({\n    element: document.getElementById('player3'),\n    mini: false,\n    autoplay: false,\n    lrcType: 3,\n    mutex: true,\n    audio: [{\n        name: '光るなら',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n        theme: '#ebd0c2'\n    }]\n});\n\nconst ap4 = new APlayer({\n    element: document.getElementById('player4'),\n    mini: false,\n    autoplay: false,\n    lrcType: false,\n    mutex: true,\n    theme: '#ad7a86',\n    order: 'random',\n    audio: [{\n        name: '光るなら',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n        theme: '#ebd0c2'\n    }, {\n        name: 'トリカゴ',\n        artist: 'XX:me',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n        theme: '#46718b'\n    }, {\n        name: '前前前世',\n        artist: 'RADWIMPS',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n        theme: '#505d6b'\n    }, {\n        name: '光るなら(HLS)',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hls/hikarunara.m3u8',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        theme: '#ebd0c2',\n        type: 'hls'\n    }]\n});\n\nconst ap5 = new APlayer({\n    element: document.getElementById('player5'),\n    mini: false,\n    autoplay: false,\n    lrcType: 3,\n    mutex: true,\n    theme: '#e9e9e9',\n    listFolded: false,\n    listMaxHeight: 80,\n    audio: [{\n        name: '光るなら',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n    }, {\n        name: 'トリカゴ',\n        artist: 'XX:me',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n    }, {\n        name: '前前前世',\n        artist: 'RADWIMPS',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n        lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n    }]\n});\nconst colorThief = new ColorThief();\nconst image = new Image();\nconst xhr = new XMLHttpRequest();\nconst setTheme = (index) => {\n    if (!ap5.list.audios[index].theme) {\n        xhr.onload = function(){\n            let coverUrl = URL.createObjectURL(this.response);\n            image.onload = function(){\n                let color = colorThief.getColor(image);\n                ap5.theme(`rgb(${color[0]}, ${color[1]}, ${color[2]})`, index);\n                URL.revokeObjectURL(coverUrl)\n            };\n            image.src = coverUrl;\n        }\n        xhr.open('GET', ap5.list.audios[index].cover, true);\n        xhr.responseType = 'blob';\n        xhr.send();\n    }\n};\nsetTheme(ap5.list.index);\nap5.on('listswitch', (data) => {\n    setTheme(data.index);\n});\n\nconst ap6 = new APlayer({\n    element: document.getElementById('player6'),\n    mutex: true,\n    audio: [{\n        name: '光るなら(HLS)',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hls/hikarunara.m3u8',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        theme: '#ebd0c2',\n        type: 'hls'\n    }]\n});\nconst ap7 = new APlayer({\n    element: document.getElementById('player7'),\n    mutex: true,\n    audio: [{\n        name: '光るなら(HLS)',\n        artist: 'Goose house',\n        url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hls/hikarunara.m3u8',\n        cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        theme: '#ebd0c2',\n        type: 'customHls',\n    }],\n    customAudioType: {\n        'customHls': function (audioElement, audio, player) {\n            if (Hls.isSupported()) {\n                const hls = new Hls();\n                hls.loadSource(audio.url);\n                hls.attachMedia(audioElement);\n            }\n            else if (audioElement.canPlayType('application/x-mpegURL') || audioElement.canPlayType('application/vnd.apple.mpegURL')) {\n                audioElement.src = audio.url;\n            }\n            else {\n                player.notice('Error: HLS is not supported.');\n            }\n        }\n    }\n});\n\nconst ap8 = new APlayer({\n    element: document.getElementById('player8'),\n    mutex: true,\n    theme: '#ad7a86',\n    order: 'random',\n    lrcType: 3,\n    fixed: true,\n});\n$.ajax({\n    url: 'https://api.i-meto.com/meting/api?server=netease&type=playlist&id=35798529',\n    success: function (list) {\n        ap8.list.add(JSON.parse(list));\n    }\n});"
  },
  {
    "path": "demo/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"UTF-8\">\n    <title>APlayer Demo</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <style>\n        body {\n            font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n        }\n        .container {\n            max-width: 32rem;\n            margin-left: auto;\n            margin-right: auto;\n            margin-bottom: 150px;\n        }\n        h1 {\n            font-size: 54px;\n            color: #333;\n            margin: 30px 0 10px;\n        }\n        h2 {\n            font-size: 22px;\n            color: #555;\n        }\n        h3 {\n            font-size: 24px;\n            color: #555;\n        }\n        hr {\n            display: block;\n            width: 7rem;\n            height: 1px;\n            margin: 2.5rem 0;\n            background-color: #eee;\n            border: 0;\n        }\n        a {\n            color: #08c;\n            text-decoration: none;\n        }\n        p {\n            font-size: 18px;\n        }\n    </style>\n    <script src=\"https://cdn.jsdelivr.net/npm/vconsole/dist/vconsole.min.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js\"></script>\n    <script src=\"APlayer.js\"></script>\n    <script src=\"https://cdn.jsdelivr.net/npm/color-thief-don@2.0.2/src/color-thief.js\"></script>\n</head>\n<body>\n    <div class=\"container\">\n        <h1>APlayer</h1>\n        <h2>Wow, such a beautiful html5 music player</h2>\n        <p>Made by <a href=\"https://www.anotherhome.net/\" target=\"_blank\">DIYgod</a>. Available on <a href=\"https://github.com/DIYgod/APlayer\" target=\"_blank\">GitHub</a>. Licensed MIT.</p>\n        <hr>\n        <h3>Normal</h3>\n        <div id=\"player1\"></div>\n        <p></p>\n        <button onclick=\"ap1.play()\">ap.play()</button>\n        <button onclick=\"ap1.seek(100)\">ap.seek(100)</button>\n        <button onclick=\"ap1.pause()\">ap.pause()</button>\n        <button onclick=\"ap1.toggle()\">ap.toggle()</button>\n        <button onclick=\"ap1.volume(0.1)\">ap.volume(0.1)</button>\n        <button onclick=\"ap1.addAudio([\n            {\n                name: 'あっちゅ～ま青春!',\n                artist: '七森中☆ごらく部',\n                url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yuruyuri.mp3',\n                cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yuruyuri.jpg'\n            },\n            {\n                name: 'secret base~君がくれたもの~',\n                artist: '茅野愛衣',\n                url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/secretbase.mp3',\n                cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/secretbase.jpg'\n            },\n            {\n                name: '回レ！雪月花',\n                artist: '小倉唯',\n                url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/snowmoonflowers.mp3',\n                cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/snowmoonflowers.jpg'\n            }\n        ])\">ap.addAudio(...)</button>\n        <button onclick=\"ap1.destroy()\">ap.destroy()</button>\n        <h3>With playlist</h3>\n        <div id=\"player4\" class=\"aplayer\"></div>\n        <p></p>\n        <button onclick=\"ap4.switchAudio(2)\">ap.switchAudio(2)</button>\n        <h3>With lyrics</h3>\n        <div id=\"player3\" class=\"aplayer\"></div>\n        <h3>With playlist and lyrics</h3>\n        <div id=\"player5\" class=\"aplayer\"></div>\n        <h3>Narrow</h3>\n        <div id=\"player2\" class=\"aplayer\"></div>\n        <h3>HLS</h3>\n        <div id=\"player6\" class=\"aplayer\"></div>\n        <div id=\"player7\" class=\"aplayer\"></div>\n        <div id=\"player8\" class=\"aplayer\"></div>\n    </div>\n    <script>\n        if (/mobile/i.test(window.navigator.userAgent)) {\n            new VConsole();\n        }\n    </script>\n    <script src=\"https://cdn.jsdelivr.net/npm/jquery\"></script>\n    <script src=\"demo.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "docs/.nojekyll",
    "content": ""
  },
  {
    "path": "docs/CNAME",
    "content": "aplayer.js.org"
  },
  {
    "path": "docs/README.md",
    "content": "---\nsearch: english\n---\n\n# APlayer\n\n🍭 Wow, such a beautiful HTML5 music player\n\n## Special Sponsors\n\n<a href=\"https://www.dogecloud.com/?ref=dplayer\" target=\"_blank\">\n    <img width=\"222px\" src=\"https://player.dogecloud.com/img/logo_with_product3.png\">\n</a>\n\n## Installation\n\nUsing npm:\n\n```\nnpm install aplayer --save\n```\n\nUsing Yarn:\n\n```\nyarn add aplayer\n```\n\n## Quick Start\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer2\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"aplayer\"></div>\n<script src=\"APlayer.min.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    audio: [{\n        name: 'name',\n        artist: 'artist',\n        url: 'url.mp3',\n        cover: 'cover.jpg'\n    }]\n});\n```\n\nWork with module bundler:\n\n```js\nimport 'aplayer/dist/APlayer.min.css';\nimport APlayer from 'aplayer';\n\nconst ap = new APlayer(options);\n```\n\n## Options\n\nName | Default | Description\n----|-------|----\ncontainer | document.querySelector('.aplayer') | player container\nfixed | false | enable fixed mode, [see more details](https://aplayer.js.org/#/home?id=fixed-mode)\nmini | false | enable mini mode, [see more details](https://aplayer.js.org/#/home?id=mini-mode)\nautoplay | false | audio autoplay\ntheme | '#b7daff' | main color\nloop | 'all' | player loop play, values: 'all', 'one', 'none'\norder | 'list' | player play order, values: 'list', 'random'\npreload | 'auto' | values: 'none', 'metadata', 'auto'\nvolume | 0.7 | default volume, notice that player will remember user setting, default volume will not work after user set volume themselves\naudio | - | audio info, should be an object or object array\naudio.name | - | audio name\naudio.artist | - | audio artist\naudio.url | - | audio url\naudio.cover | - | audio cover\naudio.lrc | - | [see more details](https://aplayer.js.org/#/home?id=lrc)\naudio.theme | - | main color when switching to this audio, it has priority over the above theme\naudio.type | 'auto' | values: 'auto', 'hls', 'normal' or other custom type, [see more details](https://aplayer.js.org/#/home?id=mse-support)\ncustomAudioType | - | [see more details](https://aplayer.js.org/#/home?id=mse-support)\nmutex | true | prevent to play multiple player at the same time, pause other players when this player start play\nlrcType | 0 | [see more details](https://aplayer.js.org/#/home?id=lrc)\nlistFolded | false | indicate whether list should folded at first\nlistMaxHeight | - | list max height\nstorageName | 'aplayer-setting' | localStorage key that store player setting\n\nFor example:\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer3\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    mini: false,\n    autoplay: false,\n    theme: '#FADFA3',\n    loop: 'all',\n    order: 'random',\n    preload: 'auto',\n    volume: 0.7,\n    mutex: true,\n    listFolded: false,\n    listMaxHeight: 90,\n    lrcType: 3,\n    audio: [\n        {\n            name: 'name1',\n            artist: 'artist1',\n            url: 'url1.mp3',\n            cover: 'cover1.jpg',\n            lrc: 'lrc1.lrc',\n            theme: '#ebd0c2'\n        },\n        {\n            name: 'name2',\n            artist: 'artist2',\n            url: 'url2.mp3',\n            cover: 'cover2.jpg',\n            lrc: 'lrc2.lrc',\n            theme: '#46718b'\n        }\n    ]\n});\n```\n\n## API\n\n+ `APlayer.version`: static property, return the version of APlayer\n\n+ `ap.play()`: play audio\n\n+ `ap.pause()`: pause audio\n\n+ `ap.seek(time: number)`: seek to specified time, the unit of time is second\n\n  ```js\n  ap.seek(100);\n  ```\n\n+ `ap.toggle()`: toggle between play and pause\n\n+ `ap.on(event: string, handler: function)`: bind audio and player events, [see more details](https://aplayer.js.org/#/home?id=event-binding)\n\n+ `ap.volume(percentage: number, nostorage: boolean)`: set audio volume\n\n  ```js\n  ap.volume(0.1, true);\n  ```\n\n+ `ap.theme(color: string, index: number)`: set player theme, the default of index is current audio index\n\n  ```js\n  ap.theme('#000', 0);\n  ```\n\n+ `ap.setMode(mode: string)`: set player mode, the value of mode should be 'mini' or 'normal'\n\n+ `ap.mode`: return current player mode, 'mini' or 'normal'\n\n+ `ap.notice(text: string, time: number, opacity: number)`: show message, the unit of time is millisecond, the default of time is 2000, the default of opacity is 0.8, setting time to 0 can disable notice autohide.\n\n  ```js\n  ap.notice('Amazing player', 2000, 0.8);\n  ```\n\n+ `ap.skipBack()`: skip to previous audio\n\n+ `ap.skipForward()`: skip to next audio\n\n+ `ap.destroy()`: destroy player\n\n+ `ap.lrc`\n\n  + `ap.lrc.show()`: show lrc\n\n  + `ap.lrc.hide()`: hide lrc\n\n  + `ap.lrc.toggle()`: toggle lrc between show and hide\n\n+ `ap.list`\n\n  + `ap.list.show()`: show list\n\n  + `ap.list.hide()`: hide list\n\n  + `ap.list.toggle()`: toggle list between show and hide\n\n  + `ap.list.add(audios: array | object)`: add new audios to the list\n\n  ```js\n  ap.list.add([{\n      name: 'name',\n      artist: 'artist',\n      url: 'url.mp3',\n      cover: 'cover.jpg',\n      lrc: 'lrc.lrc',\n      theme: '#ebd0c2'\n  }]);\n  ```\n\n  + `ap.list.remove(index: number)`: remove an audio from the list\n\n  ```js\n  ap.list.remove(1);\n  ```\n\n  + `ap.list.switch()`: switch to an audio in the list\n\n  ```js\n  ap.list.switch(1);\n  ```\n\n  + `ap.list.clear()`: remove all audios from the list\n\n+ `ap.audio`: native audio\n\n + `ap.audio.currentTime`: returns the current playback position\n\n + `ap.audio.duration`: returns audio total time\n\n + `ap.audio.paused`: returns whether the audio paused\n\n + most [native api](http://www.w3schools.com/tags/ref_av_dom.asp) are supported\n\n## Event binding\n\n`ap.on(event, handler)`\n\n```js\nap.on('ended', function () {\n    console.log('player ended');\n});\n```\n\nAudio events\n\n- abort\n- canplay\n- canplaythrough\n- durationchange\n- emptied\n- ended\n- error\n- loadeddata\n- loadedmetadata\n- loadstart\n- mozaudioavailable\n- pause\n- play\n- playing\n- progress\n- ratechange\n- seeked\n- seeking\n- stalled\n- suspend\n- timeupdate\n- volumechange\n- waiting\n\nPlayer events\n\n- listshow\n- listhide\n- listadd\n- listremove\n- listswitch\n- listclear\n- noticeshow\n- noticehide\n- destroy\n- lrcshow\n- lrchide\n\n## LRC\n\nWe have three ways to pass LRC to APlayer, indicate the way to pass LRC by option `lrcType`, then put lrc to option `audio.lrc` or HTML.\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer4\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n### LRC file\n\nThe first way, put LRC to a LRC file, LRC file will be loaded when this audio start to play.\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    lrcType: 3,\n    audio: {\n        name: 'name',\n        artist: 'artist',\n        url: 'demo.mp3',\n        cover: 'demo.jpg',\n        lrc: 'lrc.lrc'\n    }\n});\n```\n\n### LRC string in JS\n\nThe second way, put LRC to a JS string.\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    lrcType: 1,\n    audio: {\n        name: 'name',\n        artist: 'artist',\n        url: 'demo.mp3',\n        cover: 'demo.jpg',\n        lrc: '[00:00.00]APlayer\\n[00:04.01]is\\n[00:08.02]amazing'\n    }\n});\n```\n\n### LRC in HTML\n\nThe third way, put LRC to HTML.\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"player\">\n    <pre class=\"aplayer-lrc-content\">\n        [00:00.00]APlayer audio1\n        [00:04.01]is\n        [00:08.02]amazing\n        <!-- ... -->\n    </pre>\n    <pre class=\"aplayer-lrc-content\">\n        [00:00.00]APlayer audio2\n        [00:04.01]is\n        [00:08.02]amazing\n        <!-- ... -->\n    </pre>\n</div>\n<script src=\"APlayer.min.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    lrcType: 2,\n    audio: [[\n        {\n            name: 'name1',\n            artist: 'artist1',\n            url: 'url1.mp3',\n            cover: 'cover1.jpg'\n        },\n        {\n            name: 'name2',\n            artist: 'artist2',\n            url: 'url2.mp3',\n            cover: 'cover2.jpg'\n        }\n    ]]\n});\n```\n\n### LRC format\n\nThe following LRC format are supported:\n\n`[mm:ss]APlayer`\n\n`[mm:ss.xx]is`\n\n`[mm:ss.xxx]amazing`\n\n`[mm:ss.xx][mm:ss.xx]APlayer`\n\n`[mm:ss.xx]<mm:ss.xx>is`\n\n`[mm:ss.xx]amazing[mm:ss.xx]APlayer`\n\n## Playlist\n\nAPlayer will show a playlist when it has more than one audio, option `listFolded` indicates whether list should folded at first, and option `listMaxHeight` indicates list max height.\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer5\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    listFolded: false,\n    listMaxHeight: 90,\n    lrcType: 3,\n    audio: [\n        {\n            name: 'name1',\n            artist: 'artist1',\n            url: 'url1.mp3',\n            cover: 'cover1.jpg',\n            lrc: 'lrc1.lrc',\n            theme: '#ebd0c2'\n        },\n        {\n            name: 'name2',\n            artist: 'artist2',\n            url: 'url2.mp3',\n            cover: 'cover2.jpg',\n            lrc: 'lrc2.lrc',\n            theme: '#46718b'\n        }\n    ]\n});\n```\n\n## Fixed mode\n\nAPlayer can be fixed to page bottom via fixed mode, fixed mode is a very different mode, enjoy it!\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer9\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    fixed: true,\n    audio: [{\n        name: 'name',\n        artist: 'artist',\n        url: 'url.mp3',\n        cover: 'cover.jpg',\n    }]\n});\n```\n\n## Mini mode\n\nIf you don't have enough space for normal player, mini mode might be your choice.\n\nPlease note that mini mode is conflicted with fixed mode.\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer6\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    mini: true,\n    audio: [{\n        name: 'name',\n        artist: 'artist',\n        url: 'url.mp3',\n        cover: 'cover.jpg',\n    }]\n});\n```\n\n## MSE support\n\n### HLS\n\nIt requires the library [hls.js](https://github.com/video-dev/hls.js) and it should be loaded before `APlayer.min.js`.\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer7\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"aplayer\"></div>\n<script src=\"hls.min.js\"></script>\n<script src=\"APlayer.min.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    audio: [{\n        name: 'HLS',\n        artist: 'artist',\n        url: 'url.m3u8',\n        cover: 'cover.jpg',\n        type: 'hls'\n    }]\n});\n```\n\n```js\n// another way, use customType\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    audio: [{\n        name: 'HLS',\n        artist: 'artist',\n        url: 'url.m3u8',\n        cover: 'cover.jpg',\n        type: 'customHls'\n    }],\n    customAudioType: {\n        'customHls': function (audioElement, audio, player) {\n            if (Hls.isSupported()) {\n                const hls = new Hls();\n                hls.loadSource(audio.url);\n                hls.attachMedia(audioElement);\n            }\n            else if (audioElement.canPlayType('application/x-mpegURL') || audioElement.canPlayType('application/vnd.apple.mpegURL')) {\n                audioElement.src = audio.url;\n            }\n            else {\n                player.notice('Error: HLS is not supported.');\n            }\n        }\n    }\n});\n```\n\n## Self-adapting theme according to cover\n\nIt requires the library [color-thief](https://github.com/lokesh/color-thief/blob/master/src/color-thief.js).\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer8\"><button class=\"docute-button load\">Click to load player</div>\n</div>\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"aplayer\"></div>\n<script src=\"APlayer.min.js\"></script>\n<script src=\"color-thief.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    theme: '#e9e9e9',\n    audio: [{\n        name: 'name1',\n        artist: 'artist1',\n        url: 'url1.mp3',\n        cover: 'cover1.jpg'\n    }, {\n        name: 'name2',\n        artist: 'artist2',\n        url: 'url2.mp3',\n        cover: 'cover2.jpg'\n    }]\n});\n\nconst colorThief = new ColorThief();\nconst image = new Image();\nconst xhr = new XMLHttpRequest();\nconst setTheme = (index) => {\n    if (!ap.list.audios[index].theme) {\n        xhr.onload = function(){\n            let coverUrl = URL.createObjectURL(this.response);\n            image.onload = function(){\n                let color = colorThief.getColor(image);\n                ap.theme(`rgb(${color[0]}, ${color[1]}, ${color[2]})`, index);\n                URL.revokeObjectURL(coverUrl)\n            };\n            image.src = coverUrl;\n        }\n        xhr.open('GET', ap.list.audios[index].cover, true);\n        xhr.responseType = 'blob';\n        xhr.send();\n    }\n};\nsetTheme(ap.list.index);\nap.on('listswitch', (index) => {\n    setTheme(index);\n});\n```\n\n## CDN\n\n- [jsDelivr](https://www.jsdelivr.com/package/npm/aplayer)\n- [cdnjs](https://cdnjs.com/libraries/aplayer)\n- [unpkg](https://unpkg.com/aplayer/)\n\n## FAQ\n\n### Why can't player autoplay in some mobile browsers?\n\nMost mobile browsers forbid audio autoplay, you wont be able to achieve it without hacks."
  },
  {
    "path": "docs/config.js",
    "content": "const langs = [\n    { title: 'English', path: '/home', matchPath: /^\\/(home|ecosystem|support)/ },\n    { title: '简体中文', path: '/zh-Hans/', matchPath: /^\\/zh-Hans/ },\n];\n\ndocute.init({\n    landing: 'landing.html',\n    title: 'APlayer',\n    repo: 'DIYgod/APlayer',\n    twitter: 'DIYgod',\n    'edit-link': 'https://github.com/MoePlayer/APlayer/tree/master/docs',\n    nav: {\n        default: [\n            {\n                title: 'Home', path: '/home'\n            },\n            {\n                title: 'Ecosystem', path: '/ecosystem'\n            },\n            {\n                title: 'Support APlayer', path: '/support'\n            },\n            {\n                title: 'Languages', type: 'dropdown', items: langs\n            }\n        ],\n        'zh-Hans': [\n            {\n                title: '首页', path: '/zh-Hans/'\n            },\n            {\n                title: '生态', path: '/zh-Hans/ecosystem'\n            },\n            {\n                title: '支持 APlayer', path: '/zh-Hans/support'\n            },\n            {\n                title: '选择语言', type: 'dropdown', items: langs\n            }\n        ],\n    },\n    plugins: [\n        docsearch({\n            apiKey: '',\n            indexName: 'aplayer',\n            tags: ['english', 'zh-Hans'],\n            url: 'https://aplayer.js.org'\n        }),\n        evanyou(),\n        player(),\n        insertUmamiJS('8c8b314e-99d9-4ac4-bee9-0e9826bb2b1c', 'https://umami.diygod.dev/script.js')\n    ]\n});\n\nfunction insertUmamiJS(id, url) {\n    var script = document.createElement('script');\n    script.setAttribute(\"data-website-id\",id);\n    script.src = url;\n    script.async = true;\n    document.head.appendChild(script);\n}\n\nfunction player () {\n    return function (context) {\n        context.event.on('landing:updated', function () {\n            console.log('landing:updated');\n            clearPlayer();\n            aplayer0();\n            aplayer1();\n        });\n        context.event.on('content:updated', function () {\n            console.log('content:updated');\n            clearPlayer();\n            for (let i = 0; i < document.querySelectorAll('.load').length; i++) {\n                document.querySelectorAll('.load')[i].addEventListener('click', function () {\n                    window[this.parentElement.id] && window[this.parentElement.id]();\n                });\n            }\n        });\n    };\n}\n\nfunction clearPlayer () {\n    for (let i = 0; i < 10; i++) {\n        if (window['ap' + i]) {\n            window['ap' + i].destroy();\n        }\n    }\n}\n\nfunction aplayer1 () {\n    window.ap1 = new APlayer({\n        container: document.getElementById('aplayer1'),\n        theme: '#F57F17',\n        lrcType: 3,\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n            theme: '#ebd0c2'\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n            theme: '#46718b'\n        }, {\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n            theme: '#505d6b'\n        }]\n    });\n}\n\nfunction aplayer0 () {\n    window.ap0 = new APlayer({\n        container: document.getElementById('aplayer0'),\n        fixed: true,\n        lrcType: 3,\n        audio: [{\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n            theme: '#505d6b'\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n            theme: '#46718b'\n        }, {\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n            theme: '#ebd0c2'\n        }]\n    });\n}\n\nfunction aplayer2 () {\n    window.ap2 = new APlayer({\n        container: document.getElementById('aplayer2'),\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            theme: '#ebd0c2'\n        }]\n    });\n}\n\nfunction aplayer3 () {\n    window.ap3 = new APlayer({\n        container: document.getElementById('aplayer3'),\n        mini: false,\n        autoplay: false,\n        loop: 'all',\n        order: 'random',\n        preload: 'auto',\n        volume: 0.7,\n        mutex: true,\n        listFolded: false,\n        listMaxHeight: 90,\n        lrcType: 3,\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n            theme: '#ebd0c2'\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n            theme: '#46718b'\n        }, {\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n            theme: '#505d6b'\n        }]\n    });\n}\n\nfunction aplayer4 () {\n    window.ap4 = new APlayer({\n        container: document.getElementById('aplayer4'),\n        lrcType: 3,\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n            theme: '#ebd0c2'\n        }]\n    });\n}\n\nfunction aplayer5 () {\n    window.ap5 = new APlayer({\n        container: document.getElementById('aplayer5'),\n        lrcType: 3,\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n            theme: '#ebd0c2'\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n            theme: '#46718b'\n        }, {\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n            theme: '#505d6b'\n        }]\n    });\n}\n\nfunction aplayer6 () {\n    window.ap6 = new APlayer({\n        container: document.getElementById('aplayer6'),\n        mini: true,\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            theme: '#ebd0c2'\n        }]\n    });\n}\n\nfunction aplayer7 () {\n    window.ap7 = new APlayer({\n        container: document.getElementById('aplayer7'),\n        audio: [{\n            name: '光るなら(HLS)',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hls/hikarunara.m3u8',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            theme: '#ebd0c2',\n            type: 'hls'\n        }, {\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            theme: '#ebd0c2'\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n            theme: '#46718b'\n        }, {\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n            theme: '#505d6b'\n        }]\n    });\n}\n\nfunction aplayer8 () {\n    window.ap8 = new APlayer({\n        container: document.getElementById('aplayer8'),\n        theme: '#e9e9e9',\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n        }, {\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n        }]\n    });\n\n    const colorThief = new ColorThief();\n    window.ap8.on('switchaudio', function (index) {\n        if (!window.ap8.options.audio[index].theme) {\n            colorThief.getColorAsync(window.ap8.options.audio[index].cover, function (color) {\n                window.ap8.theme(`rgb(${color[0]}, ${color[1]}, ${color[2]})`, index);\n            });\n        }\n    });\n}\n\nfunction aplayer9 () {\n    window.ap9 = new APlayer({\n        container: document.getElementById('aplayer9'),\n        fixed: true,\n        lrcType: 3,\n        audio: [{\n            name: '光るなら',\n            artist: 'Goose house',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/hikarunara.lrc',\n            theme: '#ebd0c2'\n        }, {\n            name: 'トリカゴ',\n            artist: 'XX:me',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/darling.lrc',\n            theme: '#46718b'\n        }, {\n            name: '前前前世',\n            artist: 'RADWIMPS',\n            url: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.mp3',\n            cover: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.jpg',\n            lrc: 'https://cn-south-17-aplayer-46154810.oss.dogecdn.com/yourname.lrc',\n            theme: '#505d6b'\n        }]\n    });\n}"
  },
  {
    "path": "docs/ecosystem.md",
    "content": "---\nsearch: english\n---\n\n# Ecosystem\n\nLet's make APlayer better, feel free to submit yours in [`Let me know!`](https://github.com/MoePlayer/APlayer/issues/79)\n\n## Help\n\n### Joining the Discussion\n\n- [Telegram Group](https://t.me/adplayer)\n- [QQ Group](https://shang.qq.com/wpa/qunwpa?idkey=bf22213ae0028a82e5adf3f286dfd4f01e0997dc9f1dcd8e831a0a85e799be17): 415835947\n\n### Creating issue\n\n- [MoePlayer/APlayer/issues](https://github.com/MoePlayer/APlayer/issues)\n\n## Related Projects\n\n### Plugins\n\n- [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin): Typecho\n- [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer): Hexo\n- [Hermit-X(APlayer for WordPress)](https://github.com/liwanglin12/Hermit-X): WordPress\n- [APlayerHandle](https://github.com/kn007/APlayerHandle): WordPress\n- [APlayer_for_Z-BlogPHP](https://github.com/fghrsh/APlayer_for_Z-BlogPHP): Z-BlogPHP\n- [react-aplayer](https://github.com/sabrinaluo/react-aplayer): React\n- [Vue-APlayer](https://github.com/SevenOutman/vue-aplayer): Vue\n- [vue-aplayer](https://github.com/MoeFE/vue-aplayer): Vue\n- [php-aplayer](https://github.com/Daryl-L/php-aplayer): PHP\n- [aplayer-hugo-module](https://github.com/Runzelee/aplayer-hugo-module): Hugo\n\n### Tooling\n\n- [APlayer-Controler](https://github.com/Mashiro-Sorata/APlayer-Controler): controling tool\n- [MetingJS](https://github.com/metowolf/MetingJS): work with Meting music API\n\n## Who use APlayer?\n\n- [bilibili](https://www.bilibili.com/): 国内知名的视频弹幕网站\n- [黑客派](https://hacpai.com/): 程序员和设计师的聚集地，一个活跃的小众社区\n- [浙江大学CC98论坛](https://zh.wikipedia.org/wiki/CC98%E8%AE%BA%E5%9D%9B): 浙江大学校网内规模最大的论坛，中国各大学中较活跃的BBS之一\n- [Jelly Rue](http://jellyrue.com/): Jelly Rue, an indie pop-rock band from Tartu.\n- [Opus](http://www.opusopus.co/): An artist-exploration data visualization application\n- [站长之家](http://www.chinaz.com/15year/index.html): 针对中文站点提供资讯、技术、资源、服务\n- [LLSupport](https://www.lovelivesupport.com/): This site provides a lot of information about LoveLive\n- [歌词千寻](https://www.lrcgc.com/diy): 每日更新的LRC歌词网站\n- [iSearch](http://i.oppsu.cn): 一个提供 iTunes 搜索,试听,高清专辑封面获取,查看最新音乐动态等综合性平台\n- [LRC歌词编辑器](https://github.com/MoeFE/Lyric): 一款非常实用的在线LRC歌词编辑器\n- [Аэростатика](https://aerostatica.ru/)\n- [HealthDig](https://healthdig.co): 每天只需两分钟的重点新闻资讯"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0\" />\n  <title>APlayer</title>\n  <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/docute@3.4.12/dist/docute.css\">\n  <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/docute@3.4.12/dist/theme-github.css\" />\n  <!-- Global site tag (gtag.js) - Google Analytics -->\n  <script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-48084758-8\"></script>\n  <script>\n    window.dataLayer = window.dataLayer || [];\n    function gtag() { dataLayer.push(arguments); }\n    gtag('js', new Date());\n\n    gtag('config', 'UA-48084758-8');\n  </script>\n  <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/aplayer@1.10.0/dist/APlayer.min.css\">\n  <script src=\"https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js\"></script>\n  <script src=\"https://cdn.jsdelivr.net/npm/aplayer@1.10.0/dist/APlayer.min.js\"></script>\n  <script src=\"https://cdn.jsdelivr.net/npm/color-thief-don@2.0.2/src/color-thief.js\"></script>\n  <style>\n    body {\n      text-rendering: auto;\n    }\n    #evanyou-canvas {\n      z-index: -1 !important;\n    }\n    .aplayer-wrap {\n      max-width: 700px;\n      margin: 20px 0;\n    }\n    .sidebar-toggle {\n      z-index: 90;\n    }\n  </style>\n</head>\n<body>\n  <!-- don't remove this part start -->\n  <div id=\"app\"></div>\n  <script src=\"https://cdn.jsdelivr.net/npm/docute@3.4.12/plugins/docsearch.js\"></script>\n  <script src=\"https://cdn.jsdelivr.net/npm/docute-evanyou/dist/evanyou.min.js\"></script>\n  <script src=\"https://cdn.jsdelivr.net/npm/docute@3.4.12/dist/docute.js\"></script>\n  <script src=\"./config.js\"></script>\n  <!-- livereload script placeholder -->\n  <!-- don't remove this part end -->\n</body>\n</html>\n"
  },
  {
    "path": "docs/landing.html",
    "content": "<h1>APlayer</h1>\n\n<h3>🍭 Wow, such a beautiful HTML5 music player.</h3>\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer1\"></div>\n</div>\n<div id=\"aplayer0\"></div>\n\n<div class=\"landing-buttons\">\n    <a class=\"landing-button\" target=\"_blank\" href=\"https://github.com/MoePlayer/APlayer\">\n        GitHub\n    </a>\n\n    <a class=\"landing-button\" router-link=\"/home\">\n        Docs\n    </a>\n</div>\n\n<style>\n    h1 {\n        margin: 0;\n        margin-top: -50px;\n        font-weight: normal;\n        font-size: 40px;\n        letter-spacing: 1px;\n    }\n\n    h3 {\n        margin-top: 20px;\n        color: #999;\n        font-weight: normal;\n        letter-spacing: 1px;\n    }\n\n    .landing {\n        padding: 10px;\n        display: -webkit-box;\n        display: -ms-flexbox;\n        display: flex;\n        -webkit-box-align: center;\n        -ms-flex-align: center;\n        align-items: center;\n        -webkit-box-pack: center;\n        -ms-flex-pack: center;\n        justify-content: center;\n        -webkit-box-orient: vertical;\n        -webkit-box-direction: normal;\n        -ms-flex-direction: column;\n        flex-direction: column;\n        height: 100%;\n        -webkit-user-select: none;\n        user-select: none;\n    }\n\n    .features {\n        margin-top: 20px;\n        margin-bottom: 10px;\n        font-size: 16px;\n        line-height: 1.7;\n    }\n\n    .landing-button {\n        border: 1px solid #ccc;\n        border-radius: 33px;\n        padding: 10px 30px;\n        background-color: white;\n        display: inline-block;\n        margin-right: 20px;\n        color: #333;\n    }\n\n    .landing-button:hover {\n        border-color: #42b983;\n        color: #42b983;\n        text-decoration: none;\n    }\n\n    .aplayer-wrap {\n        width: 600px;\n        max-width: 100%;\n        margin: 20px 0 40px;\n    }\n</style>"
  },
  {
    "path": "docs/support.md",
    "content": "---\nsearch: english\n---\n\n# Sponsor APlayer Development\n\nAPlayer is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.\n\nIf you run a business and are using APlayer in a revenue-generating product, it makes business sense to sponsor APlayer development: it ensures the project that your product relies on stays healthy and actively maintained.\n\nIf you are an individual user and have enjoyed the productivity of using APlayer, consider donating as a sign of appreciation - like buying me coffee once in a while :)\n\nYou can support APlayer via donations.\n\n### Recurring Donation\n\n-   Become a Sponser on [GitHub](https://github.com/sponsors/DIYgod)\n-   Become a Sponser on [Patreon](https://www.patreon.com/DIYgod)\n-   Become a Sponser on [爱发电](https://afdian.net/@diygod)\n-   Contact us directly: i@diygod.me\n\n### One-time Donation\n\nWe accept donations via the following ways:\n\n-   [WeChat Pay](https://diygod.me/images/wx.jpg)\n-   [Alipay](https://diygod.me/images/zfb.jpg)\n-   [Paypal](https://www.paypal.me/DIYgod)\n\n## Current Premium Sponsors\n\n### Special Sponsors\n\n<a href=\"https://www.dogecloud.com/?ref=dplayer\" target=\"_blank\">\n    <img width=\"222px\" src=\"https://player.dogecloud.com/img/logo_with_product3.png\">\n</a>\n\n## APlayer contributors\n\nThis project exists thanks to all the people who contribute.\n\n<a href=\"https://github.com/MoePlayer/APlayer/graphs/contributors\"><img src=\"https://opencollective.com/APlayer/contributors.svg?width=890\" /></a>"
  },
  {
    "path": "docs/zh-Hans/README.md",
    "content": "---\nnav: zh-Hans\nsearch: zh-Hans\n---\n\n# APlayer\n\n🍭 Wow, such a beautiful HTML5 music player\n\n## 特别赞助商\n\n<a href=\"https://www.dogecloud.com/?ref=dplayer\" target=\"_blank\">\n    <img width=\"222px\" src=\"https://player.dogecloud.com/img/logo_with_product3.png\">\n</a>\n\n## 安装\n\n使用 npm:\n\n```\nnpm install aplayer --save\n```\n\n使用 Yarn:\n\n```\nyarn add aplayer\n```\n\n## 入门\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer2\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"aplayer\"></div>\n<script src=\"APlayer.min.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    audio: [{\n        name: 'name',\n        artist: 'artist',\n        url: 'url.mp3',\n        cover: 'cover.jpg'\n    }]\n});\n```\n\n使用模块管理器:\n\n```js\nimport 'APlayer/dist/APlayer.min.css';\nimport APlayer from 'APlayer';\n\nconst ap = new APlayer(options);\n```\n\n## 参数\n\n名称 | 默认值 | 描述\n----|-------|----\ncontainer | document.querySelector('.aplayer') | 播放器容器元素\nfixed | false | 开启吸底模式, [详情](https://aplayer.js.org/#/home?id=fixed-mode)\nmini | false | 开启迷你模式, [详情](https://aplayer.js.org/#/home?id=mini-mode)\nautoplay | false | 音频自动播放\ntheme | '#b7daff' | 主题色\nloop | 'all' | 音频循环播放, 可选值: 'all', 'one', 'none'\norder | 'list' | 音频循环顺序, 可选值: 'list', 'random'\npreload | 'auto' | 预加载，可选值: 'none', 'metadata', 'auto'\nvolume | 0.7 | 默认音量，请注意播放器会记忆用户设置，用户手动设置音量后默认音量即失效\naudio | - | 音频信息, 应该是一个对象或对象数组\naudio.name | - | 音频名称\naudio.artist | - | 音频艺术家\naudio.url | - | 音频链接\naudio.cover | - | 音频封面\naudio.lrc | - | [详情](https://aplayer.js.org/#/home?id=lrc)\naudio.theme | - | 切换到此音频时的主题色，比上面的 theme 优先级高\naudio.type | 'auto' | 可选值: 'auto', 'hls', 'normal' 或其他自定义类型, [详情](https://aplayer.js.org/#/home?id=mse-support)\ncustomAudioType | - | 自定义类型，[详情](https://aplayer.js.org/#/home?id=mse-support)\nmutex | true | 互斥，阻止多个播放器同时播放，当前播放器播放时暂停其他播放器\nlrcType | 0 | [详情](https://aplayer.js.org/#/home?id=lrc)\nlistFolded | false | 列表默认折叠\nlistMaxHeight | - | 列表最大高度\nstorageName | 'aplayer-setting' | 存储播放器设置的 localStorage key\n\n例如:\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer3\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    mini: false,\n    autoplay: false,\n    theme: '#FADFA3',\n    loop: 'all',\n    order: 'random',\n    preload: 'auto',\n    volume: 0.7,\n    mutex: true,\n    listFolded: false,\n    listMaxHeight: 90,\n    lrcType: 3,\n    audio: [\n        {\n            name: 'name1',\n            artist: 'artist1',\n            url: 'url1.mp3',\n            cover: 'cover1.jpg',\n            lrc: 'lrc1.lrc',\n            theme: '#ebd0c2'\n        },\n        {\n            name: 'name2',\n            artist: 'artist2',\n            url: 'url2.mp3',\n            cover: 'cover2.jpg',\n            lrc: 'lrc2.lrc',\n            theme: '#46718b'\n        }\n    ]\n});\n```\n\n## API\n\n+ `APlayer.version`: 静态属性, 返回 APlayer 的版本号\n\n+ `ap.play()`: 播放音频\n\n+ `ap.pause()`: 暂停音频\n\n+ `ap.seek(time: number)`: 跳转到特定时间，时间的单位为秒\n\n  ```js\n  ap.seek(100);\n  ```\n\n+ `ap.toggle()`: 切换播放和暂停\n\n+ `ap.on(event: string, handler: function)`: 绑定音频和播放器事件，[详情](https://aplayer.js.org/#/home?id=event-binding)\n  \n+ `ap.volume(percentage: number, nostorage: boolean)`: 设置音频音量\n\n  ```js\n  ap.volume(0.1, true);\n  ```\n\n+ `ap.theme(color: string, index: number)`: 设置播放器主题色, index 默认为当前音频的 index\n\n  ```js\n  ap.theme('#000', 0);\n  ```\n\n+ `ap.setMode(mode: string)`: 设置播放器模式，mode 取值应为 'mini' 或 'normal'\n\n+ `ap.mode`: 返回播放器当前模式，'mini' 或 'normal'\n\n+ `ap.notice(text: string, time: number, opacity: number)`: 显示通知，时间的单位为毫秒，默认时间 2000 毫秒，默认透明度 0.8，设置时间为 0 可以取消通知自动隐藏\n\n  ```js\n  ap.notice('Amazing player', 2000, 0.8);\n  ```\n\n+ `ap.skipBack()`: 切换到上一首音频\n\n+ `ap.skipForward()`: 切换到下一首音频\n\n+ `ap.destroy()`: 销毁播放器\n\n+ `ap.lrc`\n\n  + `ap.lrc.show()`: 显示歌词\n\n  + `ap.lrc.hide()`: 隐藏歌词\n\n  + `ap.lrc.toggle()`: 显示/隐藏歌词\n\n+ `ap.list`\n\n  + `ap.list.show()`: 显示播放列表\n\n  + `ap.list.hide()`: 隐藏播放列表\n\n  + `ap.list.toggle()`: 显示/隐藏播放列表\n\n  + `ap.list.add(audios: array | object)`: 添加一个或几个新音频到播放列表\n\n  ```js\n  ap.list.add([{\n      name: 'name',\n      artist: 'artist',\n      url: 'url.mp3',\n      cover: 'cover.jpg',\n      lrc: 'lrc.lrc',\n      theme: '#ebd0c2'\n  }]);\n  ```\n\n  + `ap.list.remove(index: number)`: 移除播放列表中的一个音频\n\n  ```js\n  ap.list.remove(1);\n  ```\n\n  + `ap.list.switch()`: 切换到播放列表里的其他音频\n\n  ```js\n  ap.list.switch(1);\n  ```\n\n  + `ap.list.clear()`: 清空播放列表\n\n+ `ap.audio`: 原生 audio\n\n + `ap.audio.currentTime`: 返回音频当前播放时间\n\n + `ap.audio.duration`: 返回音频总时间\n\n + `ap.audio.paused`: 返回音频是否暂停\n\n + 支持大多数[原生audio接口](http://www.w3schools.com/tags/ref_av_dom.asp)\n\n## 事件绑定\n\n`ap.on(event, handler)`\n\n```js\nap.on('ended', function () {\n    console.log('player ended');\n});\n```\n\n音频事件\n\n- abort\n- canplay\n- canplaythrough\n- durationchange\n- emptied\n- ended\n- error\n- loadeddata\n- loadedmetadata\n- loadstart\n- mozaudioavailable\n- pause\n- play\n- playing\n- progress\n- ratechange\n- seeked\n- seeking\n- stalled\n- suspend\n- timeupdate\n- volumechange\n- waiting\n\n播放器事件\n\n- listshow\n- listhide\n- listadd\n- listremove\n- listswitch\n- listclear\n- noticeshow\n- noticehide\n- destroy\n- lrcshow\n- lrchide\n\n## 歌词\n\n我们有三种方式来给 APlayer 传递歌词，使用 `lrcType` 参数指明使用哪种方式，然后把歌词放到 `audio.lrc` 参数或者 HTML 里。\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer4\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n### LRC 文件方式\n\n第一种方式，把歌词放到 LRC 文件里，音频播放时会加载对应的 LRC 文件。\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    lrcType: 3,\n    audio: {\n        name: 'name',\n        artist: 'artist',\n        url: 'demo.mp3',\n        cover: 'demo.jpg',\n        lrc: 'lrc.lrc'\n    }\n});\n```\n\n### JS 字符串方式\n\n第二种方式，把歌词放到 JS 字符串里面。\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    lrcType: 1,\n    audio: {\n        name: 'name',\n        artist: 'artist',\n        url: 'demo.mp3',\n        cover: 'demo.jpg',\n        lrc: '[00:00.00]APlayer\\n[00:04.01]is\\n[00:08.02]amazing'\n    }\n});\n```\n\n### HTML 方式\n\n第三种方式，把歌词放到 HTML 里面。\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"player\">\n    <pre class=\"aplayer-lrc-content\">\n        [00:00.00]APlayer audio1\n        [00:04.01]is\n        [00:08.02]amazing\n        <!-- ... -->\n    </pre>\n    <pre class=\"aplayer-lrc-content\">\n        [00:00.00]APlayer audio2\n        [00:04.01]is\n        [00:08.02]amazing\n        <!-- ... -->\n    </pre>\n</div>\n<script src=\"APlayer.min.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    lrcType: 2,\n    audio: [[\n        {\n            name: 'name1',\n            artist: 'artist1',\n            url: 'url1.mp3',\n            cover: 'cover1.jpg'\n        },\n        {\n            name: 'name2',\n            artist: 'artist2',\n            url: 'url2.mp3',\n            cover: 'cover2.jpg'\n        }\n    ]]\n});\n```\n\n### 歌词格式\n\n支持下面格式的歌词：\n\n`[mm:ss]APlayer`\n\n`[mm:ss.xx]is`\n\n`[mm:ss.xxx]amazing`\n\n`[mm:ss.xx][mm:ss.xx]APlayer`\n\n`[mm:ss.xx]<mm:ss.xx>is`\n\n`[mm:ss.xx]amazing[mm:ss.xx]APlayer`\n\n## 播放列表\n\n当有多个音频时会 APlayer 会展示一个播放列表，`listFolded` 参数指明列表是否默认折叠，`listMaxHeight` 参数指明列表最大高度。\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer5\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    listFolded: false,\n    listMaxHeight: 90,\n    lrcType: 3,\n    audio: [\n        {\n            name: 'name1',\n            artist: 'artist1',\n            url: 'url1.mp3',\n            cover: 'cover1.jpg',\n            lrc: 'lrc1.lrc',\n            theme: '#ebd0c2'\n        },\n        {\n            name: 'name2',\n            artist: 'artist2',\n            url: 'url2.mp3',\n            cover: 'cover2.jpg',\n            lrc: 'lrc2.lrc',\n            theme: '#46718b'\n        }\n    ]\n});\n```\n## 吸底模式\n\nAPlayer 可以通过吸底模式固定在页面底部，这种模式跟普通模式有很大不同。\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer9\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    fixed: true,\n    audio: [{\n        name: 'name',\n        artist: 'artist',\n        url: 'url.mp3',\n        cover: 'cover.jpg',\n    }]\n});\n```\n\n## 迷你模式\n\n如果你没有足够空间来放置正常模式的播放器，那么你可以考虑使用迷你模式。\n\n请注意迷你模式与吸底模式冲突。\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer6\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('player'),\n    mini: true,\n    audio: [{\n        name: 'name',\n        artist: 'artist',\n        url: 'url.mp3',\n        cover: 'cover.jpg',\n    }]\n});\n```\n\n## MSE 支持\n\n### HLS\n\n需要在 `APlayer.min.js` 前面加载 [hls.js](https://github.com/video-dev/hls.js)。\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer7\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"aplayer\"></div>\n<script src=\"hls.min.js\"></script>\n<script src=\"APlayer.min.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    audio: [{\n        name: 'HLS',\n        artist: 'artist',\n        url: 'url.m3u8',\n        cover: 'cover.jpg',\n        type: 'hls'\n    }]\n});\n```\n\n```js\n// 另一种方式，使用 customAudioType\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    audio: [{\n        name: 'HLS',\n        artist: 'artist',\n        url: 'url.m3u8',\n        cover: 'cover.jpg',\n        type: 'customHls'\n    }],\n    customAudioType: {\n        'customHls': function (audioElement, audio, player) {\n            if (Hls.isSupported()) {\n                const hls = new Hls();\n                hls.loadSource(audio.url);\n                hls.attachMedia(audioElement);\n            }\n            else if (audioElement.canPlayType('application/x-mpegURL') || audioElement.canPlayType('application/vnd.apple.mpegURL')) {\n                audioElement.src = audio.url;\n            }\n            else {\n                player.notice('Error: HLS is not supported.');\n            }\n        }\n    }\n});\n```\n\n## 根据封面自适应主题色\n\n需要额外加载 [color-thief.js](https://github.com/lokesh/color-thief/blob/master/src/color-thief.js)\n\n<div class=\"aplayer-wrap\">\n    <div id=\"aplayer8\"><button class=\"docute-button load\">点击加载播放器</div>\n</div>\n\n```html\n<link rel=\"stylesheet\" href=\"APlayer.min.css\">\n<div id=\"aplayer\"></div>\n<script src=\"APlayer.min.js\"></script>\n<script src=\"color-thief.js\"></script>\n```\n\n```js\nconst ap = new APlayer({\n    container: document.getElementById('aplayer'),\n    theme: '#e9e9e9',\n    audio: [{\n        name: 'name1',\n        artist: 'artist1',\n        url: 'url1.mp3',\n        cover: 'cover1.jpg'\n    }, {\n        name: 'name2',\n        artist: 'artist2',\n        url: 'url2.mp3',\n        cover: 'cover2.jpg'\n    }]\n});\n\nconst colorThief = new ColorThief();\nconst image = new Image();\nconst xhr = new XMLHttpRequest();\nconst setTheme = (index) => {\n    if (!ap.list.audios[index].theme) {\n        xhr.onload = function(){\n            let coverUrl = URL.createObjectURL(this.response);\n            image.onload = function(){\n                let color = colorThief.getColor(image);\n                ap.theme(`rgb(${color[0]}, ${color[1]}, ${color[2]})`, index);\n                URL.revokeObjectURL(coverUrl)\n            };\n            image.src = coverUrl;\n        }\n        xhr.open('GET', ap.list.audios[index].cover, true);\n        xhr.responseType = 'blob';\n        xhr.send();\n    }\n};\nsetTheme(ap.list.index);\nap.on('listswitch', (index) => {\n    setTheme(index);\n});\n```\n\n## CDN\n\n- [jsDelivr](https://www.jsdelivr.com/package/npm/aplayer)\n- [cdnjs](https://cdnjs.com/libraries/aplayer)\n- [unpkg](https://unpkg.com/aplayer/)\n\n## 常见问题\n\n### 为什么播放器不能在手机上自动播放？\n\n大多数移动端浏览器禁止了音频自动播放。"
  },
  {
    "path": "docs/zh-Hans/ecosystem.md",
    "content": "---\nnav: zh-Hans\nsearch: zh-Hans\n---\n\n# 生态\n\n让 APlayer 变得更好，请随意在 [`Let me know!`](https://github.com/MoePlayer/APlayer/issues/79) 提交你的项目和产品\n\n## 帮助\n\n### 参与讨论\n\n- [Telegram 群](https://t.me/adplayer)\n- [QQ 群](https://shang.qq.com/wpa/qunwpa?idkey=bf22213ae0028a82e5adf3f286dfd4f01e0997dc9f1dcd8e831a0a85e799be17): 415835947\n\n### 提交 issue\n\n- [MoePlayer/APlayer/issues](https://github.com/MoePlayer/APlayer/issues)\n\n## 相关项目\n\n### 插件\n\n- [APlayer-Typecho-Plugin](https://github.com/zgq354/APlayer-Typecho-Plugin): Typecho\n- [hexo-tag-aplayer](https://github.com/grzhan/hexo-tag-aplayer): Hexo\n- [Hermit-X(APlayer for WordPress)](https://github.com/liwanglin12/Hermit-X): WordPress\n- [APlayerHandle](https://github.com/kn007/APlayerHandle): WordPress\n- [APlayer_for_Z-BlogPHP](https://github.com/fghrsh/APlayer_for_Z-BlogPHP): Z-BlogPHP\n- [react-aplayer](https://github.com/sabrinaluo/react-aplayer): React\n- [Vue-APlayer](https://github.com/SevenOutman/vue-aplayer): Vue\n- [vue-aplayer](https://github.com/MoeFE/vue-aplayer): Vue\n- [php-aplayer](https://github.com/Daryl-L/php-aplayer): PHP\n\n### 工具\n\n- [APlayer-Controler](https://github.com/Mashiro-Sorata/APlayer-Controler): controling tool\n- [MetingJS](https://github.com/metowolf/MetingJS): work with Meting music API\n\n## 谁在用 APlayer?\n\n- [bilibili](https://www.bilibili.com/): 国内知名的视频弹幕网站\n- [黑客派](https://hacpai.com/): 程序员和设计师的聚集地，一个活跃的小众社区\n- [浙江大学CC98论坛](https://zh.wikipedia.org/wiki/CC98%E8%AE%BA%E5%9D%9B): 浙江大学校网内规模最大的论坛，中国各大学中较活跃的BBS之一\n- [Jelly Rue](http://jellyrue.com/): Jelly Rue, an indie pop-rock band from Tartu.\n- [Opus](http://www.opusopus.co/): An artist-exploration data visualization application\n- [站长之家](http://www.chinaz.com/15year/index.html): 针对中文站点提供资讯、技术、资源、服务\n- [LLSupport](https://www.lovelivesupport.com/): This site provides a lot of information about LoveLive\n- [歌词千寻](https://www.lrcgc.com/diy): 每日更新的LRC歌词网站\n- [iSearch](http://i.oppsu.cn): 一个提供 iTunes 搜索,试听,高清专辑封面获取,查看最新音乐动态等综合性平台\n- [LRC歌词编辑器](https://github.com/MoeFE/Lyric): 一款非常实用的在线LRC歌词编辑器\n- [Аэростатика](https://aerostatica.ru/)"
  },
  {
    "path": "docs/zh-Hans/support.md",
    "content": "---\nnav: zh-Hans\nsearch: zh-Hans\n---\n\n# 赞助 APlayer 的研发\n\nAPlayer 是采用 MIT 许可的开源项目，使用完全免费。 但是随着项目规模的增长，也需要有相应的资金支持才能持续项目的维护的开发。\n\n如果你是企业经营者并且将 APlayer 用在商业产品中，那么赞助 APlayer 有商业上的益处：可以让你的产品所依赖的框架保持健康并得到积极的维护。\n\n如果你是个人开发者并且享受 APlayer 带来的高开发效率，可以用捐助来表示你的谢意 —— 比如偶尔给我买杯咖啡 :)\n\n你可以通过下列的方法来赞助 APlayer 的开发.\n\n## 周期性赞助\n\n-   通过 [GitHub](https://github.com/sponsors/DIYgod) 赞助\n-   通过 [Patreon](https://www.patreon.com/DIYgod) 赞助\n-   通过 [爱发电](https://afdian.net/@diygod) 赞助\n-   给我们发邮件联系赞助事宜: <i@diygod.me>\n\n## 一次性赞助\n\n我们通过以下方式接受赞助:\n\n-   [微信支付](https://diygod.me/images/wx.jpg)\n-   [支付宝](https://diygod.me/images/zfb.jpg)\n-   [Paypal](https://www.paypal.me/DIYgod)\n\n## 当前的顶级赞助商\n\n### 特别赞助商\n\n<a href=\"https://www.dogecloud.com/?ref=dplayer\" target=\"_blank\">\n    <img width=\"222px\" src=\"https://player.dogecloud.com/img/logo_with_product3.png\">\n</a>\n\n## APlayer 贡献者\n\n感谢所有贡献者。\n\n<a href=\"https://github.com/MoePlayer/APlayer/graphs/contributors\"><img src=\"https://opencollective.com/APlayer/contributors.svg?width=890\" /></a>"
  },
  {
    "path": "package.json",
    "content": "{\n    \"name\": \"aplayer\",\n    \"version\": \"1.10.1\",\n    \"description\": \"Wow, such a beautiful html5 music player\",\n    \"main\": \"dist/APlayer.min.js\",\n    \"style\": \"dist/APlayer.min.css\",\n    \"scripts\": {\n        \"start\": \"npm run dev\",\n        \"build\": \"cross-env NODE_ENV=production webpack --config webpack/prod.config.js --progress --display-error-details --colors\",\n        \"dev\": \"cross-env NODE_ENV=development webpack-dev-server --config webpack/dev.config.js --watch --colors\",\n        \"test\": \"eslint src webpack\",\n        \"format\": \"eslint \\\"**/*.js\\\" --fix && prettier \\\"**/*.{js,json,md}\\\" --write\",\n        \"format:staged\": \"eslint \\\"**/*.js\\\" --fix && pretty-quick --staged --verbose --pattern \\\"**/*.{js,json,md}\\\"\",\n        \"format:check\": \"eslint \\\"**/*.js\\\" && prettier-check \\\"**/*.{js,json,md}\\\"\"\n    },\n    \"files\": [\n        \"dist\"\n    ],\n    \"repository\": {\n        \"url\": \"git+https://github.com/DIYgod/APlayer.git\",\n        \"type\": \"git\"\n    },\n    \"keywords\": [\n        \"player\",\n        \"music\",\n        \"html5\"\n    ],\n    \"gitHooks\": {\n        \"pre-commit\": \"npm run format:staged\"\n    },\n    \"author\": \"DIYgod\",\n    \"license\": \"MIT\",\n    \"bugs\": {\n        \"url\": \"https://github.com/DIYgod/APlayer/issues\"\n    },\n    \"homepage\": \"https://github.com/DIYgod/APlayer#readme\",\n    \"devDependencies\": {\n        \"@babel/core\": \"^7.6.0\",\n        \"@babel/preset-env\": \"^7.4.5\",\n        \"@vuepress/plugin-back-to-top\": \"1.7.1\",\n        \"@vuepress/plugin-google-analytics\": \"1.7.1\",\n        \"@vuepress/plugin-pwa\": \"1.7.1\",\n        \"art-template\": \"4.13.2\",\n        \"art-template-loader\": \"1.4.3\",\n        \"autoprefixer\": \"^9.6.1\",\n        \"babel-loader\": \"^8.0.6\",\n        \"cross-env\": \"^7.0.0\",\n        \"css-loader\": \"^5.0.0\",\n        \"cssnano\": \"^4.1.10\",\n        \"eslint\": \"^7.0.0\",\n        \"eslint-config-prettier\": \"^6.3.0\",\n        \"eslint-loader\": \"^4.0.0\",\n        \"eslint-plugin-prettier\": \"^3.1.1\",\n        \"exports-loader\": \"^1.0.0\",\n        \"file-loader\": \"^6.0.0\",\n        \"git-revision-webpack-plugin\": \"^3.0.3\",\n        \"mini-css-extract-plugin\": \"1.3.0\",\n        \"node-sass\": \"^5.0.0\",\n        \"postcss-loader\": \"^3.0.0\",\n        \"prettier\": \"^2.0.1\",\n        \"prettier-check\": \"^2.0.0\",\n        \"pretty-quick\": \"^3.0.0\",\n        \"sass-loader\": \"^10.0.0\",\n        \"strip-loader\": \"^0.1.2\",\n        \"style-loader\": \"^2.0.0\",\n        \"svg-inline-loader\": \"0.8.2\",\n        \"template-string-optimize-loader\": \"^3.0.0\",\n        \"url-loader\": \"^4.0.0\",\n        \"vuepress\": \"1.7.1\",\n        \"webpack\": \"^4.40.2\",\n        \"webpack-cli\": \"3.3.12\",\n        \"webpack-dev-server\": \"^3.8.1\",\n        \"yorkie\": \"^2.0.0\"\n    },\n    \"dependencies\": {\n        \"balloon-css\": \"^1.0.3\",\n        \"promise-polyfill\": \"8.2.0\",\n        \"smoothscroll\": \"0.4.0\"\n    }\n}\n"
  },
  {
    "path": "src/css/index.scss",
    "content": "$aplayer-height: 66px;\n$lrc-height: 30px;\n$aplayer-height-lrc: $aplayer-height + $lrc-height - 6;\n\n.aplayer {\n    background: #fff;\n    font-family: Arial, Helvetica, sans-serif;\n    margin: 5px;\n    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07), 0 1px 5px 0 rgba(0, 0, 0, 0.1);\n    border-radius: 2px;\n    overflow: hidden;\n    user-select: none;\n    line-height: initial;\n    position: relative;\n\n    * {\n        box-sizing: content-box;\n    }\n\n    svg {\n        width: 100%;\n        height: 100%;\n        \n        path,\n        circle {\n            fill: #fff;\n        }\n    }\n\n    &.aplayer-withlist {\n        .aplayer-info {\n            border-bottom: 1px solid #e9e9e9;\n        }\n        .aplayer-list {\n            display: block;\n        }\n        .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-menu {\n            display: inline;\n        }\n        .aplayer-icon-order {\n            display: inline;\n        }\n    }\n\n    &.aplayer-withlrc {\n        .aplayer-pic {\n            height: $aplayer-height-lrc;\n            width: $aplayer-height-lrc;\n        }\n        .aplayer-info {\n            margin-left: $aplayer-height-lrc;\n            height: $aplayer-height-lrc;\n            padding: 10px 7px 0 7px;\n        }\n        .aplayer-lrc {\n            display: block;\n        }\n    }\n\n    &.aplayer-narrow {\n        width: $aplayer-height;\n        \n        .aplayer-info {\n            display: none;\n        }\n        .aplayer-list {\n            display: none;\n        }\n        .aplayer-pic,\n        .aplayer-body {\n            height: $aplayer-height;\n            width: $aplayer-height;\n        }\n    }\n\n    &.aplayer-fixed {\n        position: fixed;\n        bottom: 0;\n        left: 0;\n        right: 0;\n        margin: 0;\n        z-index: 99;\n        overflow: visible;\n        max-width: 400px;\n        box-shadow: none;\n\n        .aplayer-list {\n            margin-bottom: 65px;\n            border: 1px solid #eee;\n            border-bottom: none;\n        }\n\n        .aplayer-body {\n            position: fixed;\n            bottom: 0;\n            left: 0;\n            right: 0;\n            margin: 0;\n            z-index: 99;\n            background: #fff;\n            padding-right: 18px;\n            transition: all 0.3s ease;\n            max-width: 400px;\n        }\n\n        .aplayer-lrc {\n            display: block;\n            position: fixed;\n            bottom: 10px;\n            left: 0;\n            right: 0;\n            margin: 0;\n            z-index: 98;\n            pointer-events: none;\n            text-shadow: -1px -1px 0 #fff;\n\n            &:before,\n            &:after {\n                display: none;\n            }\n        }\n\n        .aplayer-info {\n            transform: scaleX(1);\n            transform-origin: 0 0;\n            transition: all 0.3s ease;\n            border-bottom: none;\n            border-top: 1px solid #e9e9e9;\n\n            .aplayer-music {\n                width: calc(100% - 105px);\n            }\n        }\n\n        .aplayer-miniswitcher {\n            display: block;\n        }\n\n        &.aplayer-narrow {\n            .aplayer-info {\n                display: block;\n                transform: scaleX(0);\n            }\n            .aplayer-body {\n                width: $aplayer-height !important;\n            }\n\n            .aplayer-miniswitcher .aplayer-icon {\n                transform: rotateY(0);\n            }\n        }\n\n        .aplayer-icon-back,\n        .aplayer-icon-play,\n        .aplayer-icon-forward,\n        .aplayer-icon-lrc {\n            display: inline-block;\n        }\n\n        .aplayer-icon-back,\n        .aplayer-icon-play,\n        .aplayer-icon-forward,\n        .aplayer-icon-menu {\n            position: absolute;\n            bottom: 27px;\n            width: 20px;\n            height: 20px;\n        }\n\n        .aplayer-icon-back {\n            right: 75px;\n        }\n\n        .aplayer-icon-play {\n            right: 50px;\n        }\n\n        .aplayer-icon-forward {\n            right: 25px;\n        }\n\n        .aplayer-icon-menu {\n            right: 0;\n        }\n    }\n\n    &.aplayer-mobile {\n        .aplayer-icon-volume-down {\n            display: none;\n        }\n    }\n\n    &.aplayer-arrow {\n        .aplayer-icon-order,\n        .aplayer-icon-loop {\n            display: none;\n        }\n    }\n\n    &.aplayer-loading {\n        .aplayer-info .aplayer-controller .aplayer-loading-icon {\n            display: block;\n        }\n\n        .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {\n            transform: scale(1);\n        }\n    }\n\n    .aplayer-body {\n        position: relative;\n    }\n\n    .aplayer-icon {\n        width: 15px;\n        height: 15px;\n        border: none;\n        background-color: transparent;\n        outline: none;\n        cursor: pointer;\n        opacity: .8;\n        vertical-align: middle;\n        padding: 0;\n        font-size: 12px;\n        margin: 0;\n        display: inline-block;\n\n        path {\n            transition: all .2s ease-in-out;\n        }\n    }\n\n    .aplayer-icon-order,\n    .aplayer-icon-back,\n    .aplayer-icon-play,\n    .aplayer-icon-forward,\n    .aplayer-icon-lrc {\n        display: none;\n    }\n\n    .aplayer-icon-lrc-inactivity {\n        svg {\n            opacity: 0.4;\n        }\n    }\n\n    .aplayer-icon-forward {\n        transform: rotate(180deg);\n    }\n\n    .aplayer-lrc-content {\n        display: none;\n    }\n\n    .aplayer-pic {\n        position: relative;\n        float: left;\n        height: $aplayer-height;\n        width: $aplayer-height;\n        background-size: cover;\n        background-position: center;\n        transition: all 0.3s ease;\n        cursor: pointer;\n\n        &:hover .aplayer-button {\n            opacity: 1;\n        }\n\n        .aplayer-button {\n            position: absolute;\n            border-radius: 50%;\n            opacity: 0.8;\n            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n            background: rgba(0, 0, 0, 0.2);\n            transition: all 0.1s ease;\n\n            path {\n                fill: #fff;\n            }\n        }\n\n        .aplayer-hide {\n            display: none;\n        }\n\n        .aplayer-play {\n            width: 26px;\n            height: 26px;\n            border: 2px solid #fff;\n            bottom: 50%;\n            right: 50%;\n            margin: 0 -15px -15px 0;\n            svg {\n                position: absolute;\n                top: 3px;\n                left: 4px;\n                height: 20px;\n                width: 20px;\n            }\n        }\n\n        .aplayer-pause {\n            width: 16px;\n            height: 16px;\n            border: 2px solid #fff;\n            bottom: 4px;\n            right: 4px;\n            svg {\n                position: absolute;\n                top: 2px;\n                left: 2px;\n                height: 12px;\n                width: 12px;\n            }\n        }\n    }\n\n    .aplayer-info {\n        margin-left: $aplayer-height;\n        padding: 14px 7px 0 10px;\n        height: $aplayer-height;\n        box-sizing: border-box;\n\n        .aplayer-music {\n            overflow: hidden;\n            white-space: nowrap;\n            text-overflow: ellipsis;\n            margin: 0 0 13px 5px;\n            user-select: text;\n            cursor: default;\n            padding-bottom: 2px;\n            height: 20px;\n\n            .aplayer-title {\n                font-size: 14px;\n            }\n\n            .aplayer-author {\n                font-size: 12px;\n                color: #666;\n            }\n        }\n\n        .aplayer-controller {\n            position: relative;\n            display: flex;\n\n            .aplayer-bar-wrap {\n                margin: 0 0 0 5px;\n                padding: 4px 0;\n                cursor: pointer !important;\n                flex: 1;\n\n                &:hover {\n                    .aplayer-bar .aplayer-played .aplayer-thumb {\n                        transform: scale(1);\n                    }\n                }\n\n                .aplayer-bar {\n                    position: relative;\n                    height: 2px;\n                    width: 100%;\n                    background: #cdcdcd;\n\n                    .aplayer-loaded {\n                        position: absolute;\n                        left: 0;\n                        top: 0;\n                        bottom: 0;\n                        background: #aaa;\n                        height: 2px;\n                        transition: all 0.5s ease;\n                    }\n\n                    .aplayer-played {\n                        position: absolute;\n                        left: 0;\n                        top: 0;\n                        bottom: 0;\n                        height: 2px;\n\n                        .aplayer-thumb {\n                            position: absolute;\n                            top: 0;\n                            right: 5px;\n                            margin-top: -4px;\n                            margin-right: -10px;\n                            height: 10px;\n                            width: 10px;\n                            border-radius: 50%;\n                            cursor: pointer;\n                            transition: all .3s ease-in-out;\n                            transform: scale(0);\n                        }\n                    }\n                }\n            }\n\n            .aplayer-time {\n                position: relative;\n                right: 0;\n                bottom: 4px;\n                height: 17px;\n                color: #999;\n                font-size: 11px;\n                padding-left: 7px;\n\n                .aplayer-time-inner {\n                    vertical-align: middle;\n                }\n\n                .aplayer-icon {\n                    cursor: pointer;\n                    transition: all 0.2s ease;\n\n                    path {\n                        fill: #666;\n                    }\n\n                    &.aplayer-icon-loop {\n                        margin-right: 2px;\n                    }\n\n                    &:hover {\n                        path {\n                            fill: #000;\n                        }\n                    }\n\n                    &.aplayer-icon-menu {\n                        display: none;\n                    }\n                }\n\n                &.aplayer-time-narrow {\n                    .aplayer-icon-mode {\n                        display: none;\n                    }\n\n                    .aplayer-icon-menu {\n                        display: none;\n                    }\n                }\n            }\n\n            .aplayer-volume-wrap {\n                position: relative;\n                display: inline-block;\n                margin-left: 3px;\n                cursor: pointer !important;\n\n                &:hover .aplayer-volume-bar-wrap {\n                    height: 40px;\n                }\n\n                .aplayer-volume-bar-wrap {\n                    position: absolute;\n                    bottom: 15px;\n                    right: -3px;\n                    width: 25px;\n                    height: 0;\n                    z-index: 99;\n                    overflow: hidden;\n                    transition: all .2s ease-in-out;\n\n                    &.aplayer-volume-bar-wrap-active {\n                        height: 40px;\n                    }\n\n                    .aplayer-volume-bar {\n                        position: absolute;\n                        bottom: 0;\n                        right: 10px;\n                        width: 5px;\n                        height: 35px;\n                        background: #aaa;\n                        border-radius: 2.5px;\n                        overflow: hidden;\n\n                        .aplayer-volume {\n                            position: absolute;\n                            bottom: 0;\n                            right: 0;\n                            width: 5px;\n                            transition: all 0.1s ease;\n                        }\n                    }\n                }\n            }\n\n            .aplayer-loading-icon {\n                display: none;\n\n                svg {\n                    position: absolute;\n                    animation: rotate 1s linear infinite;\n                }\n            }\n        }\n    }\n\n    .aplayer-lrc {\n        display: none;\n        position: relative;\n        height: $lrc-height;\n        text-align: center;\n        overflow: hidden;\n        margin: -10px 0 7px;\n\n        &:before {\n            position: absolute;\n            top: 0;\n            z-index: 1;\n            display: block;\n            overflow: hidden;\n            width: 100%;\n            height: 10%;\n            content: ' ';\n            background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);\n            background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);\n            background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);\n            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 );\n        }\n\n        &:after {\n            position: absolute;\n            bottom: 0;\n            z-index: 1;\n            display: block;\n            overflow: hidden;\n            width: 100%;\n            height: 33%;\n            content: ' ';\n            background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%);\n            background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 100%);\n            background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 100%);\n            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ccffffff',GradientType=0 );\n        }\n\n        p {\n            font-size: 12px;\n            color: #666;\n            line-height: 16px !important;\n            height: 16px !important;\n            padding: 0 !important;\n            margin: 0 !important;\n            transition: all 0.5s ease-out;\n            opacity: 0.4;\n            overflow: hidden;\n\n            &.aplayer-lrc-current {\n                opacity: 1;\n                overflow: visible;\n                height: initial !important;\n                min-height: 16px;\n            }\n        }\n\n        &.aplayer-lrc-hide {\n            display: none;\n        }\n\n        .aplayer-lrc-contents {\n            width: 100%;\n            transition: all 0.5s ease-out;\n            user-select: text;\n            cursor: default;\n        }\n    }\n\n    .aplayer-list {\n        overflow: auto;\n        transition: all 0.5s ease;\n        will-change: height;\n        display: none;\n        overflow: hidden;\n        list-style-type: none;\n        margin: 0;\n        padding: 0;\n        overflow-y: auto;\n\n        &::-webkit-scrollbar {\n            width: 5px;\n        }\n\n        &::-webkit-scrollbar-thumb {\n            border-radius: 3px;\n            background-color: #eee;\n        }\n\n        &::-webkit-scrollbar-thumb:hover {\n            background-color: #ccc;\n        }\n\n        li {\n            position: relative;\n            height: 32px;\n            line-height: 32px;\n            padding: 0 15px;\n            font-size: 12px;\n            border-top: 1px solid #e9e9e9;\n            cursor: pointer;\n            transition: all 0.2s ease;\n            overflow: hidden;\n            margin: 0;\n\n            &:first-child {\n                border-top: none;\n            }\n\n            &:hover {\n                background: #efefef;\n            }\n\n            &.aplayer-list-light {\n                background: #e9e9e9;\n\n                .aplayer-list-cur {\n                    display: inline-block;\n                }\n            }\n\n            .aplayer-list-cur {\n                display: none;\n                width: 3px;\n                height: 22px;\n                position: absolute;\n                left: 0;\n                top: 5px;\n                cursor: pointer;\n            }\n            .aplayer-list-index {\n                color: #666;\n                margin-right: 12px;\n                cursor: pointer;\n            }\n            .aplayer-list-author {\n                color: #666;\n                float: right;\n                cursor: pointer;\n            }\n        }\n    }\n\n    .aplayer-notice {\n        opacity: 0;\n        position: absolute;\n        top: 50%;\n        left: 50%;\n        transform: translate(-50%, -50%);\n        font-size: 12px;\n        border-radius: 4px;\n        padding: 5px 10px;\n        transition: all .3s ease-in-out;\n        overflow: hidden;\n        color: #fff;\n        pointer-events: none;\n        background-color: #f4f4f5;\n        color: #909399;\n    }\n\n    .aplayer-miniswitcher {\n        display: none;\n        position: absolute;\n        top: 0;\n        right: 0;\n        bottom: 0;\n        height: 100%;\n        background: #e6e6e6;\n        width: 18px;\n        border-radius: 0 2px 2px 0;\n\n        .aplayer-icon {\n            height: 100%;\n            width: 100%;\n            transform: rotateY(180deg);\n            transition: all 0.3s ease;\n\n            path {\n                fill: #666;\n            }\n\n            &:hover {\n                path {\n                    fill: #000;\n                }\n            }\n        }\n    }\n}\n\n@keyframes aplayer-roll {\n    0%{left:0}\n    100%{left: -100%}\n}\n\n@keyframes rotate {\n    0% {\n        transform: rotate(0)\n    }\n    100% {\n        transform: rotate(360deg)\n    }\n}"
  },
  {
    "path": "src/js/bar.js",
    "content": "class Bar {\n    constructor(template) {\n        this.elements = {};\n        this.elements.volume = template.volume;\n        this.elements.played = template.played;\n        this.elements.loaded = template.loaded;\n    }\n\n    /**\n     * Update progress\n     *\n     * @param {String} type - Point out which bar it is\n     * @param {Number} percentage\n     * @param {String} direction - Point out the direction of this bar, Should be height or width\n     */\n    set(type, percentage, direction) {\n        percentage = Math.max(percentage, 0);\n        percentage = Math.min(percentage, 1);\n        this.elements[type].style[direction] = percentage * 100 + '%';\n    }\n\n    get(type, direction) {\n        return parseFloat(this.elements[type].style[direction]) / 100;\n    }\n}\n\nexport default Bar;\n"
  },
  {
    "path": "src/js/controller.js",
    "content": "import utils from './utils';\nimport Icons from './icons';\n\nclass Controller {\n    constructor(player) {\n        this.player = player;\n\n        this.initPlayButton();\n        this.initPlayBar();\n        this.initOrderButton();\n        this.initLoopButton();\n        this.initMenuButton();\n        if (!utils.isMobile) {\n            this.initVolumeButton();\n        }\n        this.initMiniSwitcher();\n        this.initSkipButton();\n        this.initLrcButton();\n    }\n\n    initPlayButton() {\n        this.player.template.pic.addEventListener('click', () => {\n            this.player.toggle();\n        });\n    }\n\n    initPlayBar() {\n        const thumbMove = (e) => {\n            let percentage = ((e.clientX || e.changedTouches[0].clientX) - this.player.template.barWrap.getBoundingClientRect().left) / this.player.template.barWrap.clientWidth;\n            percentage = Math.max(percentage, 0);\n            percentage = Math.min(percentage, 1);\n            this.player.bar.set('played', percentage, 'width');\n            this.player.lrc && this.player.lrc.update(percentage * this.player.duration);\n            this.player.template.ptime.innerHTML = utils.secondToTime(percentage * this.player.duration);\n        };\n\n        const thumbUp = (e) => {\n            document.removeEventListener(utils.nameMap.dragEnd, thumbUp);\n            document.removeEventListener(utils.nameMap.dragMove, thumbMove);\n            let percentage = ((e.clientX || e.changedTouches[0].clientX) - this.player.template.barWrap.getBoundingClientRect().left) / this.player.template.barWrap.clientWidth;\n            percentage = Math.max(percentage, 0);\n            percentage = Math.min(percentage, 1);\n            this.player.bar.set('played', percentage, 'width');\n            this.player.seek(percentage * this.player.duration);\n            this.player.disableTimeupdate = false;\n        };\n\n        this.player.template.barWrap.addEventListener(utils.nameMap.dragStart, () => {\n            this.player.disableTimeupdate = true;\n            document.addEventListener(utils.nameMap.dragMove, thumbMove);\n            document.addEventListener(utils.nameMap.dragEnd, thumbUp);\n        });\n    }\n\n    initVolumeButton() {\n        this.player.template.volumeButton.addEventListener('click', () => {\n            if (this.player.audio.muted) {\n                this.player.volume(this.player.audio.volume, true);\n            } else {\n                this.player.audio.muted = true;\n                this.player.switchVolumeIcon();\n                this.player.bar.set('volume', 0, 'height');\n            }\n        });\n\n        const thumbMove = (e) => {\n            let percentage = 1 - ((e.clientY || e.changedTouches[0].clientY) - this.player.template.volumeBar.getBoundingClientRect().top) / this.player.template.volumeBar.clientHeight;\n            percentage = Math.max(percentage, 0);\n            percentage = Math.min(percentage, 1);\n            this.player.volume(percentage);\n        };\n\n        const thumbUp = (e) => {\n            this.player.template.volumeBarWrap.classList.remove('aplayer-volume-bar-wrap-active');\n            document.removeEventListener(utils.nameMap.dragEnd, thumbUp);\n            document.removeEventListener(utils.nameMap.dragMove, thumbMove);\n            let percentage = 1 - ((e.clientY || e.changedTouches[0].clientY) - this.player.template.volumeBar.getBoundingClientRect().top) / this.player.template.volumeBar.clientHeight;\n            percentage = Math.max(percentage, 0);\n            percentage = Math.min(percentage, 1);\n            this.player.volume(percentage);\n        };\n\n        this.player.template.volumeBarWrap.addEventListener(utils.nameMap.dragStart, () => {\n            this.player.template.volumeBarWrap.classList.add('aplayer-volume-bar-wrap-active');\n            document.addEventListener(utils.nameMap.dragMove, thumbMove);\n            document.addEventListener(utils.nameMap.dragEnd, thumbUp);\n        });\n    }\n\n    initOrderButton() {\n        this.player.template.order.addEventListener('click', () => {\n            if (this.player.options.order === 'list') {\n                this.player.options.order = 'random';\n                this.player.template.order.innerHTML = Icons.orderRandom;\n            } else if (this.player.options.order === 'random') {\n                this.player.options.order = 'list';\n                this.player.template.order.innerHTML = Icons.orderList;\n            }\n        });\n    }\n\n    initLoopButton() {\n        this.player.template.loop.addEventListener('click', () => {\n            if (this.player.list.audios.length > 1) {\n                if (this.player.options.loop === 'one') {\n                    this.player.options.loop = 'none';\n                    this.player.template.loop.innerHTML = Icons.loopNone;\n                } else if (this.player.options.loop === 'none') {\n                    this.player.options.loop = 'all';\n                    this.player.template.loop.innerHTML = Icons.loopAll;\n                } else if (this.player.options.loop === 'all') {\n                    this.player.options.loop = 'one';\n                    this.player.template.loop.innerHTML = Icons.loopOne;\n                }\n            } else {\n                if (this.player.options.loop === 'one' || this.player.options.loop === 'all') {\n                    this.player.options.loop = 'none';\n                    this.player.template.loop.innerHTML = Icons.loopNone;\n                } else if (this.player.options.loop === 'none') {\n                    this.player.options.loop = 'all';\n                    this.player.template.loop.innerHTML = Icons.loopAll;\n                }\n            }\n        });\n    }\n\n    initMenuButton() {\n        this.player.template.menu.addEventListener('click', () => {\n            this.player.list.toggle();\n        });\n    }\n\n    initMiniSwitcher() {\n        this.player.template.miniSwitcher.addEventListener('click', () => {\n            this.player.setMode(this.player.mode === 'mini' ? 'normal' : 'mini');\n        });\n    }\n\n    initSkipButton() {\n        this.player.template.skipBackButton.addEventListener('click', () => {\n            this.player.skipBack();\n        });\n        this.player.template.skipForwardButton.addEventListener('click', () => {\n            this.player.skipForward();\n        });\n        this.player.template.skipPlayButton.addEventListener('click', () => {\n            this.player.toggle();\n        });\n    }\n\n    initLrcButton() {\n        this.player.template.lrcButton.addEventListener('click', () => {\n            if (this.player.template.lrcButton.classList.contains('aplayer-icon-lrc-inactivity')) {\n                this.player.template.lrcButton.classList.remove('aplayer-icon-lrc-inactivity');\n                this.player.lrc && this.player.lrc.show();\n            } else {\n                this.player.template.lrcButton.classList.add('aplayer-icon-lrc-inactivity');\n                this.player.lrc && this.player.lrc.hide();\n            }\n        });\n    }\n}\n\nexport default Controller;\n"
  },
  {
    "path": "src/js/events.js",
    "content": "class Events {\n    constructor() {\n        this.events = {};\n\n        this.audioEvents = [\n            'abort',\n            'canplay',\n            'canplaythrough',\n            'durationchange',\n            'emptied',\n            'ended',\n            'error',\n            'loadeddata',\n            'loadedmetadata',\n            'loadstart',\n            'mozaudioavailable',\n            'pause',\n            'play',\n            'playing',\n            'progress',\n            'ratechange',\n            'seeked',\n            'seeking',\n            'stalled',\n            'suspend',\n            'timeupdate',\n            'volumechange',\n            'waiting',\n        ];\n        this.playerEvents = ['destroy', 'listshow', 'listhide', 'listadd', 'listremove', 'listswitch', 'listclear', 'noticeshow', 'noticehide', 'lrcshow', 'lrchide'];\n    }\n\n    on(name, callback) {\n        if (this.type(name) && typeof callback === 'function') {\n            if (!this.events[name]) {\n                this.events[name] = [];\n            }\n            this.events[name].push(callback);\n        }\n    }\n\n    trigger(name, data) {\n        if (this.events[name] && this.events[name].length) {\n            for (let i = 0; i < this.events[name].length; i++) {\n                this.events[name][i](data);\n            }\n        }\n    }\n\n    type(name) {\n        if (this.playerEvents.indexOf(name) !== -1) {\n            return 'player';\n        } else if (this.audioEvents.indexOf(name) !== -1) {\n            return 'audio';\n        }\n\n        console.error(`Unknown event name: ${name}`);\n        return null;\n    }\n}\n\nexport default Events;\n"
  },
  {
    "path": "src/js/icons.js",
    "content": "import play from '../assets/play.svg';\nimport pause from '../assets/pause.svg';\nimport volumeUp from '../assets/volume-up.svg';\nimport volumeDown from '../assets/volume-down.svg';\nimport volumeOff from '../assets/volume-off.svg';\nimport orderRandom from '../assets/order-random.svg';\nimport orderList from '../assets/order-list.svg';\nimport menu from '../assets/menu.svg';\nimport loopAll from '../assets/loop-all.svg';\nimport loopOne from '../assets/loop-one.svg';\nimport loopNone from '../assets/loop-none.svg';\nimport loading from '../assets/loading.svg';\nimport right from '../assets/right.svg';\nimport skip from '../assets/skip.svg';\nimport lrc from '../assets/lrc.svg';\n\nconst Icons = {\n    play: play,\n    pause: pause,\n    volumeUp: volumeUp,\n    volumeDown: volumeDown,\n    volumeOff: volumeOff,\n    orderRandom: orderRandom,\n    orderList: orderList,\n    menu: menu,\n    loopAll: loopAll,\n    loopOne: loopOne,\n    loopNone: loopNone,\n    loading: loading,\n    right: right,\n    skip: skip,\n    lrc: lrc,\n};\n\nexport default Icons;\n"
  },
  {
    "path": "src/js/index.js",
    "content": "import '../css/index.scss';\nimport APlayer from './player';\n\n/* global APLAYER_VERSION GIT_HASH */\nconsole.log(`${'\\n'} %c APlayer v${APLAYER_VERSION} ${GIT_HASH} %c http://aplayer.js.org ${'\\n'}`, 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\n\nexport default APlayer;\n"
  },
  {
    "path": "src/js/list.js",
    "content": "import tplListItem from '../template/list-item.art';\nimport utils from './utils';\nimport smoothScroll from 'smoothscroll';\n\nclass List {\n    constructor(player) {\n        this.player = player;\n        this.index = 0;\n        this.audios = this.player.options.audio;\n        this.showing = true;\n        this.player.template.list.style.height = `${Math.min(this.player.template.list.scrollHeight, this.player.options.listMaxHeight)}px`;\n\n        this.bindEvents();\n    }\n\n    bindEvents() {\n        this.player.template.list.addEventListener('click', (e) => {\n            let target;\n            if (e.target.tagName.toUpperCase() === 'LI') {\n                target = e.target;\n            } else {\n                target = e.target.parentElement;\n            }\n            const audioIndex = parseInt(target.getElementsByClassName('aplayer-list-index')[0].innerHTML) - 1;\n            if (audioIndex !== this.index) {\n                this.switch(audioIndex);\n                this.player.play();\n            } else {\n                this.player.toggle();\n            }\n        });\n    }\n\n    show() {\n        this.showing = true;\n        this.player.template.list.scrollTop = this.index * 33;\n        this.player.template.list.style.height = `${Math.min(this.player.template.list.scrollHeight, this.player.options.listMaxHeight)}px`;\n        this.player.events.trigger('listshow');\n    }\n\n    hide() {\n        this.showing = false;\n        this.player.template.list.style.height = `${Math.min(this.player.template.list.scrollHeight, this.player.options.listMaxHeight)}px`;\n        setTimeout(() => {\n            this.player.template.list.style.height = '0px';\n            this.player.events.trigger('listhide');\n        }, 0);\n    }\n\n    toggle() {\n        if (this.showing) {\n            this.hide();\n        } else {\n            this.show();\n        }\n    }\n\n    add(audios) {\n        this.player.events.trigger('listadd', {\n            audios: audios,\n        });\n\n        if (Object.prototype.toString.call(audios) !== '[object Array]') {\n            audios = [audios];\n        }\n        audios.map((item) => {\n            item.name = item.name || item.title || 'Audio name';\n            item.artist = item.artist || item.author || 'Audio artist';\n            item.cover = item.cover || item.pic;\n            item.type = item.type || 'normal';\n            return item;\n        });\n\n        const wasSingle = !(this.audios.length > 1);\n        const wasEmpty = this.audios.length === 0;\n\n        this.player.template.list.innerHTML += tplListItem({\n            theme: this.player.options.theme,\n            audio: audios,\n            index: this.audios.length + 1,\n        });\n\n        this.audios = this.audios.concat(audios);\n\n        if (wasSingle && this.audios.length > 1) {\n            this.player.container.classList.add('aplayer-withlist');\n        }\n\n        this.player.randomOrder = utils.randomOrder(this.audios.length);\n        this.player.template.listCurs = this.player.container.querySelectorAll('.aplayer-list-cur');\n\n        this.player.template.listCurs[this.audios.length - 1].style.backgroundColor = audios.theme || this.player.options.theme;\n\n        if (wasEmpty) {\n            if (this.player.options.order === 'random') {\n                this.switch(this.player.randomOrder[0]);\n            } else {\n                this.switch(0);\n            }\n        }\n    }\n\n    remove(index) {\n        this.player.events.trigger('listremove', {\n            index: index,\n        });\n        if (this.audios[index]) {\n            if (this.audios.length > 1) {\n                const list = this.player.container.querySelectorAll('.aplayer-list li');\n                list[index].remove();\n\n                this.audios.splice(index, 1);\n                this.player.lrc && this.player.lrc.remove(index);\n\n                if (index === this.index) {\n                    if (this.audios[index]) {\n                        this.switch(index);\n                    } else {\n                        this.switch(index - 1);\n                    }\n                }\n                if (this.index > index) {\n                    this.index--;\n                }\n\n                for (let i = index; i < list.length; i++) {\n                    list[i].getElementsByClassName('aplayer-list-index')[0].textContent = i;\n                }\n                if (this.audios.length === 1) {\n                    this.player.container.classList.remove('aplayer-withlist');\n                }\n\n                this.player.template.listCurs = this.player.container.querySelectorAll('.aplayer-list-cur');\n            } else {\n                this.clear();\n            }\n        }\n    }\n\n    switch(index) {\n        this.player.events.trigger('listswitch', {\n            index: index,\n        });\n\n        if (typeof index !== 'undefined' && this.audios[index]) {\n            this.index = index;\n\n            const audio = this.audios[this.index];\n\n            // set html\n            this.player.template.pic.style.backgroundImage = audio.cover ? `url('${audio.cover}')` : '';\n            this.player.theme(this.audios[this.index].theme || this.player.options.theme, this.index, false);\n            this.player.template.title.innerHTML = audio.name;\n            this.player.template.author.innerHTML = audio.artist ? ' - ' + audio.artist : '';\n\n            const light = this.player.container.getElementsByClassName('aplayer-list-light')[0];\n            if (light) {\n                light.classList.remove('aplayer-list-light');\n            }\n            this.player.container.querySelectorAll('.aplayer-list li')[this.index].classList.add('aplayer-list-light');\n\n            smoothScroll(this.index * 33, 500, null, this.player.template.list);\n\n            this.player.setAudio(audio);\n\n            this.player.lrc && this.player.lrc.switch(this.index);\n            this.player.lrc && this.player.lrc.update(0);\n\n            // set duration time\n            if (this.player.duration !== 1) {\n                // compatibility: Android browsers will output 1 at first\n                this.player.template.dtime.innerHTML = utils.secondToTime(this.player.duration);\n            }\n        }\n    }\n\n    clear() {\n        this.player.events.trigger('listclear');\n        this.index = 0;\n        this.player.container.classList.remove('aplayer-withlist');\n        this.player.pause();\n        this.audios = [];\n        this.player.lrc && this.player.lrc.clear();\n        this.player.audio.src = '';\n        this.player.template.list.innerHTML = '';\n        this.player.template.pic.style.backgroundImage = '';\n        this.player.theme(this.player.options.theme, this.index, false);\n        this.player.template.title.innerHTML = 'No audio';\n        this.player.template.author.innerHTML = '';\n        this.player.bar.set('loaded', 0, 'width');\n        this.player.template.dtime.innerHTML = utils.secondToTime(0);\n    }\n}\n\nexport default List;\n"
  },
  {
    "path": "src/js/lrc.js",
    "content": "import tplLrc from '../template/lrc.art';\n\nclass Lrc {\n    constructor(options) {\n        this.container = options.container;\n        this.async = options.async;\n        this.player = options.player;\n        this.parsed = [];\n        this.index = 0;\n        this.current = [];\n    }\n\n    show() {\n        this.player.events.trigger('lrcshow');\n        this.player.template.lrcWrap.classList.remove('aplayer-lrc-hide');\n    }\n\n    hide() {\n        this.player.events.trigger('lrchide');\n        this.player.template.lrcWrap.classList.add('aplayer-lrc-hide');\n    }\n\n    toggle() {\n        if (this.player.template.lrcWrap.classList.contains('aplayer-lrc-hide')) {\n            this.show();\n        } else {\n            this.hide();\n        }\n    }\n\n    update(currentTime = this.player.audio.currentTime) {\n        if (this.index > this.current.length - 1 || currentTime < this.current[this.index][0] || (!this.current[this.index + 1] || currentTime >= this.current[this.index + 1][0])) {\n            for (let i = 0; i < this.current.length; i++) {\n                if (currentTime >= this.current[i][0] && (!this.current[i + 1] || currentTime < this.current[i + 1][0])) {\n                    this.index = i;\n                    this.container.style.transform = `translateY(${-this.index * 16}px)`;\n                    this.container.style.webkitTransform = `translateY(${-this.index * 16}px)`;\n                    this.container.getElementsByClassName('aplayer-lrc-current')[0].classList.remove('aplayer-lrc-current');\n                    this.container.getElementsByTagName('p')[i].classList.add('aplayer-lrc-current');\n                }\n            }\n        }\n    }\n\n    switch(index) {\n        if (!this.parsed[index]) {\n            if (!this.async) {\n                if (this.player.list.audios[index].lrc) {\n                    this.parsed[index] = this.parse(this.player.list.audios[index].lrc);\n                } else {\n                    this.parsed[index] = [['00:00', 'Not available']];\n                }\n            } else {\n                this.parsed[index] = [['00:00', 'Loading']];\n                const xhr = new XMLHttpRequest();\n                xhr.onreadystatechange = () => {\n                    if (index === this.player.list.index && xhr.readyState === 4) {\n                        if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) {\n                            this.parsed[index] = this.parse(xhr.responseText);\n                        } else {\n                            this.player.notice(`LRC file request fails: status ${xhr.status}`);\n                            this.parsed[index] = [['00:00', 'Not available']];\n                        }\n                        this.container.innerHTML = tplLrc({\n                            lyrics: this.parsed[index],\n                        });\n                        this.update(0);\n                        this.current = this.parsed[index];\n                    }\n                };\n                const apiurl = this.player.list.audios[index].lrc;\n                xhr.open('get', apiurl, true);\n                xhr.send(null);\n            }\n        }\n\n        this.container.innerHTML = tplLrc({\n            lyrics: this.parsed[index],\n        });\n        this.current = this.parsed[index];\n        this.update(0);\n    }\n\n    /**\n     * Parse lrc, suppose multiple time tag\n     *\n     * @param {String} lrc_s - Format:\n     * [mm:ss]lyric\n     * [mm:ss.xx]lyric\n     * [mm:ss.xxx]lyric\n     * [mm:ss.xx][mm:ss.xx][mm:ss.xx]lyric\n     * [mm:ss.xx]<mm:ss.xx>lyric\n     *\n     * @return {String} [[time, text], [time, text], [time, text], ...]\n     */\n    parse(lrc_s) {\n        if (lrc_s) {\n            lrc_s = lrc_s.replace(/([^\\]^\\n])\\[/g, (match, p1) => p1 + '\\n[');\n            const lyric = lrc_s.split('\\n');\n            let lrc = [];\n            const lyricLen = lyric.length;\n            for (let i = 0; i < lyricLen; i++) {\n                // match lrc time\n                const lrcTimes = lyric[i].match(/\\[(\\d{2}):(\\d{2})(\\.(\\d{2,3}))?]/g);\n                // match lrc text\n                const lrcText = lyric[i]\n                    .replace(/.*\\[(\\d{2}):(\\d{2})(\\.(\\d{2,3}))?]/g, '')\n                    .replace(/<(\\d{2}):(\\d{2})(\\.(\\d{2,3}))?>/g, '')\n                    .replace(/^\\s+|\\s+$/g, '');\n\n                if (lrcTimes) {\n                    // handle multiple time tag\n                    const timeLen = lrcTimes.length;\n                    for (let j = 0; j < timeLen; j++) {\n                        const oneTime = /\\[(\\d{2}):(\\d{2})(\\.(\\d{2,3}))?]/.exec(lrcTimes[j]);\n                        const min2sec = oneTime[1] * 60;\n                        const sec2sec = parseInt(oneTime[2]);\n                        const msec2sec = oneTime[4] ? parseInt(oneTime[4]) / ((oneTime[4] + '').length === 2 ? 100 : 1000) : 0;\n                        const lrcTime = min2sec + sec2sec + msec2sec;\n                        lrc.push([lrcTime, lrcText]);\n                    }\n                }\n            }\n            // sort by time\n            lrc = lrc.filter((item) => item[1]);\n            lrc.sort((a, b) => a[0] - b[0]);\n            return lrc;\n        } else {\n            return [];\n        }\n    }\n\n    remove(index) {\n        this.parsed.splice(index, 1);\n    }\n\n    clear() {\n        this.parsed = [];\n        this.container.innerHTML = '';\n    }\n}\n\nexport default Lrc;\n"
  },
  {
    "path": "src/js/options.js",
    "content": "export default (options) => {\n    // default options\n    const defaultOption = {\n        container: options.element || document.getElementsByClassName('aplayer')[0],\n        mini: options.narrow || options.fixed || false,\n        fixed: false,\n        autoplay: false,\n        mutex: true,\n        lrcType: options.showlrc || options.lrc || 0,\n        preload: 'metadata',\n        theme: '#b7daff',\n        loop: 'all',\n        order: 'list',\n        volume: 0.7,\n        listFolded: options.fixed,\n        listMaxHeight: options.listmaxheight || 250,\n        audio: options.music || [],\n        storageName: 'aplayer-setting',\n    };\n    for (const defaultKey in defaultOption) {\n        if (defaultOption.hasOwnProperty(defaultKey) && !options.hasOwnProperty(defaultKey)) {\n            options[defaultKey] = defaultOption[defaultKey];\n        }\n    }\n\n    options.listMaxHeight = parseFloat(options.listMaxHeight);\n\n    if (Object.prototype.toString.call(options.audio) !== '[object Array]') {\n        options.audio = [options.audio];\n    }\n\n    options.audio.map((item) => {\n        item.name = item.name || item.title || 'Audio name';\n        item.artist = item.artist || item.author || 'Audio artist';\n        item.cover = item.cover || item.pic;\n        item.type = item.type || 'normal';\n        return item;\n    });\n\n    if (options.audio.length <= 1 && options.loop === 'one') {\n        options.loop = 'all';\n    }\n\n    return options;\n};\n"
  },
  {
    "path": "src/js/player.js",
    "content": "import Promise from 'promise-polyfill';\n\nimport utils from './utils';\nimport Icons from './icons';\nimport handleOption from './options';\nimport Template from './template';\nimport Bar from './bar';\nimport Storage from './storage';\nimport Lrc from './lrc';\nimport Controller from './controller';\nimport Timer from './timer';\nimport Events from './events';\nimport List from './list';\n\nconst instances = [];\n\nclass APlayer {\n    /**\n     * APlayer constructor function\n     *\n     * @param {Object} options - See README\n     * @constructor\n     */\n    constructor(options) {\n        this.options = handleOption(options);\n        this.container = this.options.container;\n        this.paused = true;\n        this.playedPromise = Promise.resolve();\n        this.mode = 'normal';\n\n        this.randomOrder = utils.randomOrder(this.options.audio.length);\n\n        this.container.classList.add('aplayer');\n        if (this.options.lrcType && !this.options.fixed) {\n            this.container.classList.add('aplayer-withlrc');\n        }\n        if (this.options.audio.length > 1) {\n            this.container.classList.add('aplayer-withlist');\n        }\n        if (utils.isMobile) {\n            this.container.classList.add('aplayer-mobile');\n        }\n        this.arrow = this.container.offsetWidth <= 300;\n        if (this.arrow) {\n            this.container.classList.add('aplayer-arrow');\n        }\n\n        // save lrc\n        if (this.options.lrcType === 2 || this.options.lrcType === true) {\n            const lrcEle = this.container.getElementsByClassName('aplayer-lrc-content');\n            for (let i = 0; i < lrcEle.length; i++) {\n                if (this.options.audio[i]) {\n                    this.options.audio[i].lrc = lrcEle[i].innerHTML;\n                }\n            }\n        }\n\n        this.template = new Template({\n            container: this.container,\n            options: this.options,\n            randomOrder: this.randomOrder,\n        });\n\n        if (this.options.fixed) {\n            this.container.classList.add('aplayer-fixed');\n            this.template.body.style.width = this.template.body.offsetWidth - 18 + 'px';\n        }\n        if (this.options.mini) {\n            this.setMode('mini');\n            this.template.info.style.display = 'block';\n        }\n        if (this.template.info.offsetWidth < 200) {\n            this.template.time.classList.add('aplayer-time-narrow');\n        }\n\n        if (this.options.lrcType) {\n            this.lrc = new Lrc({\n                container: this.template.lrc,\n                async: this.options.lrcType === 3,\n                player: this,\n            });\n        }\n        this.events = new Events();\n        this.storage = new Storage(this);\n        this.bar = new Bar(this.template);\n        this.controller = new Controller(this);\n        this.timer = new Timer(this);\n        this.list = new List(this);\n\n        this.initAudio();\n        this.bindEvents();\n        if (this.options.order === 'random') {\n            this.list.switch(this.randomOrder[0]);\n        } else {\n            this.list.switch(0);\n        }\n\n        // autoplay\n        if (this.options.autoplay) {\n            this.play();\n        }\n\n        instances.push(this);\n    }\n\n    initAudio() {\n        this.audio = document.createElement('audio');\n        this.audio.preload = this.options.preload;\n\n        for (let i = 0; i < this.events.audioEvents.length; i++) {\n            this.audio.addEventListener(this.events.audioEvents[i], (e) => {\n                this.events.trigger(this.events.audioEvents[i], e);\n            });\n        }\n\n        this.volume(this.storage.get('volume'), true);\n    }\n\n    bindEvents() {\n        this.on('play', () => {\n            if (this.paused) {\n                this.setUIPlaying();\n            }\n        });\n\n        this.on('pause', () => {\n            if (!this.paused) {\n                this.setUIPaused();\n            }\n        });\n\n        this.on('timeupdate', () => {\n            if (!this.disableTimeupdate) {\n                this.bar.set('played', this.audio.currentTime / this.duration, 'width');\n                this.lrc && this.lrc.update();\n                const currentTime = utils.secondToTime(this.audio.currentTime);\n                if (this.template.ptime.innerHTML !== currentTime) {\n                    this.template.ptime.innerHTML = currentTime;\n                }\n            }\n        });\n\n        // show audio time: the metadata has loaded or changed\n        this.on('durationchange', () => {\n            if (this.duration !== 1) {\n                // compatibility: Android browsers will output 1 at first\n                this.template.dtime.innerHTML = utils.secondToTime(this.duration);\n            }\n        });\n\n        // Can seek now\n        this.on('loadedmetadata', () => {\n            this.seek(0);\n            if (!this.paused) {\n                this.audio.play();\n            }\n        });\n\n        // show audio loaded bar: to inform interested parties of progress downloading the media\n        this.on('canplay', () => {\n            const percentage = this.audio.buffered.length ? this.audio.buffered.end(this.audio.buffered.length - 1) / this.duration : 0;\n            this.bar.set('loaded', percentage, 'width');\n        });\n        this.on('progress', () => {\n            const percentage = this.audio.buffered.length ? this.audio.buffered.end(this.audio.buffered.length - 1) / this.duration : 0;\n            this.bar.set('loaded', percentage, 'width');\n        });\n\n        // audio download error: an error occurs\n        let skipTime;\n        this.on('error', () => {\n            if (this.list.audios.length > 1) {\n                this.notice('An audio error has occurred, player will skip forward in 2 seconds.');\n                skipTime = setTimeout(() => {\n                    this.skipForward();\n                    if (!this.paused) {\n                        this.play();\n                    }\n                }, 2000);\n            } else if (this.list.audios.length === 1) {\n                this.notice('An audio error has occurred.');\n            }\n        });\n        this.events.on('listswitch', () => {\n            skipTime && clearTimeout(skipTime);\n        });\n\n        // multiple audio play\n        this.on('ended', () => {\n            if (this.options.loop === 'none') {\n                if (this.options.order === 'list') {\n                    if (this.list.index < this.list.audios.length - 1) {\n                        this.list.switch((this.list.index + 1) % this.list.audios.length);\n                        this.play();\n                    } else {\n                        this.list.switch((this.list.index + 1) % this.list.audios.length);\n                        this.pause();\n                    }\n                } else if (this.options.order === 'random') {\n                    if (this.randomOrder.indexOf(this.list.index) < this.randomOrder.length - 1) {\n                        this.list.switch(this.nextIndex());\n                        this.play();\n                    } else {\n                        this.list.switch(this.nextIndex());\n                        this.pause();\n                    }\n                }\n            } else if (this.options.loop === 'one') {\n                this.list.switch(this.list.index);\n                this.play();\n            } else if (this.options.loop === 'all') {\n                this.skipForward();\n                this.play();\n            }\n        });\n    }\n\n    setAudio(audio) {\n        if (this.hls) {\n            this.hls.destroy();\n            this.hls = null;\n        }\n        let type = audio.type;\n        if (this.options.customAudioType && this.options.customAudioType[type]) {\n            if (Object.prototype.toString.call(this.options.customAudioType[type]) === '[object Function]') {\n                this.options.customAudioType[type](this.audio, audio, this);\n            } else {\n                console.error(`Illegal customType: ${type}`);\n            }\n        } else {\n            if (!type || type === 'auto') {\n                if (/m3u8(#|\\?|$)/i.exec(audio.url)) {\n                    type = 'hls';\n                } else {\n                    type = 'normal';\n                }\n            }\n            if (type === 'hls') {\n                if (window.Hls.isSupported()) {\n                    this.hls = new window.Hls();\n                    this.hls.loadSource(audio.url);\n                    this.hls.attachMedia(this.audio);\n                } else if (this.audio.canPlayType('application/x-mpegURL') || this.audio.canPlayType('application/vnd.apple.mpegURL')) {\n                    this.audio.src = audio.url;\n                } else {\n                    this.notice('Error: HLS is not supported.');\n                }\n            } else if (type === 'normal') {\n                this.audio.src = audio.url;\n            }\n        }\n    }\n\n    theme(color = this.list.audios[this.list.index].theme || this.options.theme, index = this.list.index, isReset = true) {\n        if (isReset) {\n            this.list.audios[index] && (this.list.audios[index].theme = color);\n        }\n        this.template.listCurs[index] && (this.template.listCurs[index].style.backgroundColor = color);\n        if (index === this.list.index) {\n            this.template.pic.style.backgroundColor = color;\n            this.template.played.style.background = color;\n            this.template.thumb.style.background = color;\n            this.template.volume.style.background = color;\n        }\n    }\n\n    seek(time) {\n        time = Math.max(time, 0);\n        time = Math.min(time, this.duration);\n        this.audio.currentTime = time;\n        this.bar.set('played', time / this.duration, 'width');\n        this.template.ptime.innerHTML = utils.secondToTime(time);\n    }\n\n    get duration() {\n        return isNaN(this.audio.duration) ? 0 : this.audio.duration;\n    }\n\n    setUIPlaying() {\n        if (this.paused) {\n            this.paused = false;\n            this.template.button.classList.remove('aplayer-play');\n            this.template.button.classList.add('aplayer-pause');\n            this.template.button.innerHTML = '';\n            setTimeout(() => {\n                this.template.button.innerHTML = Icons.pause;\n            }, 100);\n            this.template.skipPlayButton.innerHTML = Icons.pause;\n        }\n\n        this.timer.enable('loading');\n\n        if (this.options.mutex) {\n            for (let i = 0; i < instances.length; i++) {\n                if (this !== instances[i]) {\n                    instances[i].pause();\n                }\n            }\n        }\n    }\n\n    play() {\n        this.setUIPlaying();\n\n        const playPromise = this.audio.play();\n        if (playPromise) {\n            playPromise.catch((e) => {\n                console.warn(e);\n                if (e.name === 'NotAllowedError') {\n                    this.setUIPaused();\n                }\n            });\n        }\n    }\n\n    setUIPaused() {\n        if (!this.paused) {\n            this.paused = true;\n\n            this.template.button.classList.remove('aplayer-pause');\n            this.template.button.classList.add('aplayer-play');\n            this.template.button.innerHTML = '';\n            setTimeout(() => {\n                this.template.button.innerHTML = Icons.play;\n            }, 100);\n            this.template.skipPlayButton.innerHTML = Icons.play;\n        }\n\n        this.container.classList.remove('aplayer-loading');\n        this.timer.disable('loading');\n    }\n\n    pause() {\n        this.setUIPaused();\n        this.audio.pause();\n    }\n\n    switchVolumeIcon() {\n        if (this.volume() >= 0.95) {\n            this.template.volumeButton.innerHTML = Icons.volumeUp;\n        } else if (this.volume() > 0) {\n            this.template.volumeButton.innerHTML = Icons.volumeDown;\n        } else {\n            this.template.volumeButton.innerHTML = Icons.volumeOff;\n        }\n    }\n\n    /**\n     * Set volume\n     */\n    volume(percentage, nostorage) {\n        percentage = parseFloat(percentage);\n        if (!isNaN(percentage)) {\n            percentage = Math.max(percentage, 0);\n            percentage = Math.min(percentage, 1);\n            this.bar.set('volume', percentage, 'height');\n            if (!nostorage) {\n                this.storage.set('volume', percentage);\n            }\n\n            this.audio.volume = percentage;\n            if (this.audio.muted) {\n                this.audio.muted = false;\n            }\n\n            this.switchVolumeIcon();\n        }\n\n        return this.audio.muted ? 0 : this.audio.volume;\n    }\n\n    /**\n     * bind events\n     */\n    on(name, callback) {\n        this.events.on(name, callback);\n    }\n\n    /**\n     * toggle between play and pause\n     */\n    toggle() {\n        if (this.template.button.classList.contains('aplayer-play')) {\n            this.play();\n        } else if (this.template.button.classList.contains('aplayer-pause')) {\n            this.pause();\n        }\n    }\n\n    // abandoned\n    switchAudio(index) {\n        this.list.switch(index);\n    }\n\n    // abandoned\n    addAudio(audios) {\n        this.list.add(audios);\n    }\n\n    // abandoned\n    removeAudio(index) {\n        this.list.remove(index);\n    }\n\n    /**\n     * destroy this player\n     */\n    destroy() {\n        instances.splice(instances.indexOf(this), 1);\n        this.pause();\n        this.container.innerHTML = '';\n        this.audio.src = '';\n        this.timer.destroy();\n        this.events.trigger('destroy');\n    }\n\n    setMode(mode = 'normal') {\n        this.mode = mode;\n        if (mode === 'mini') {\n            this.container.classList.add('aplayer-narrow');\n        } else if (mode === 'normal') {\n            this.container.classList.remove('aplayer-narrow');\n        }\n    }\n\n    notice(text, time = 2000, opacity = 0.8) {\n        this.template.notice.innerHTML = text;\n        this.template.notice.style.opacity = opacity;\n        if (this.noticeTime) {\n            clearTimeout(this.noticeTime);\n        }\n        this.events.trigger('noticeshow', {\n            text: text,\n        });\n        if (time) {\n            this.noticeTime = setTimeout(() => {\n                this.template.notice.style.opacity = 0;\n                this.events.trigger('noticehide');\n            }, time);\n        }\n    }\n\n    prevIndex() {\n        if (this.list.audios.length > 1) {\n            if (this.options.order === 'list') {\n                return this.list.index - 1 < 0 ? this.list.audios.length - 1 : this.list.index - 1;\n            } else if (this.options.order === 'random') {\n                const index = this.randomOrder.indexOf(this.list.index);\n                if (index === 0) {\n                    return this.randomOrder[this.randomOrder.length - 1];\n                } else {\n                    return this.randomOrder[index - 1];\n                }\n            }\n        } else {\n            return 0;\n        }\n    }\n\n    nextIndex() {\n        if (this.list.audios.length > 1) {\n            if (this.options.order === 'list') {\n                return (this.list.index + 1) % this.list.audios.length;\n            } else if (this.options.order === 'random') {\n                const index = this.randomOrder.indexOf(this.list.index);\n                if (index === this.randomOrder.length - 1) {\n                    return this.randomOrder[0];\n                } else {\n                    return this.randomOrder[index + 1];\n                }\n            }\n        } else {\n            return 0;\n        }\n    }\n\n    skipBack() {\n        this.list.switch(this.prevIndex());\n    }\n\n    skipForward() {\n        this.list.switch(this.nextIndex());\n    }\n\n    static get version() {\n        /* global APLAYER_VERSION */\n        return APLAYER_VERSION;\n    }\n}\n\nexport default APlayer;\n"
  },
  {
    "path": "src/js/storage.js",
    "content": "import utils from './utils';\n\nclass Storage {\n    constructor(player) {\n        this.storageName = player.options.storageName;\n\n        this.data = JSON.parse(utils.storage.get(this.storageName));\n        if (!this.data) {\n            this.data = {};\n        }\n        this.data.volume = this.data.volume || player.options.volume;\n    }\n\n    get(key) {\n        return this.data[key];\n    }\n\n    set(key, value) {\n        this.data[key] = value;\n        utils.storage.set(this.storageName, JSON.stringify(this.data));\n    }\n}\n\nexport default Storage;\n"
  },
  {
    "path": "src/js/template.js",
    "content": "import Icons from './icons';\nimport tplPlayer from '../template/player.art';\n\nclass Template {\n    constructor(options) {\n        this.container = options.container;\n        this.options = options.options;\n        this.randomOrder = options.randomOrder;\n        this.init();\n    }\n\n    init() {\n        let cover = '';\n        if (this.options.audio.length) {\n            if (this.options.order === 'random') {\n                cover = this.options.audio[this.randomOrder[0]].cover;\n            } else {\n                cover = this.options.audio[0].cover;\n            }\n        }\n\n        this.container.innerHTML = tplPlayer({\n            options: this.options,\n            icons: Icons,\n            cover: cover,\n            getObject: (obj) => obj,\n        });\n\n        this.lrc = this.container.querySelector('.aplayer-lrc-contents');\n        this.lrcWrap = this.container.querySelector('.aplayer-lrc');\n        this.ptime = this.container.querySelector('.aplayer-ptime');\n        this.info = this.container.querySelector('.aplayer-info');\n        this.time = this.container.querySelector('.aplayer-time');\n        this.barWrap = this.container.querySelector('.aplayer-bar-wrap');\n        this.button = this.container.querySelector('.aplayer-button');\n        this.body = this.container.querySelector('.aplayer-body');\n        this.list = this.container.querySelector('.aplayer-list');\n        this.listCurs = this.container.querySelectorAll('.aplayer-list-cur');\n        this.played = this.container.querySelector('.aplayer-played');\n        this.loaded = this.container.querySelector('.aplayer-loaded');\n        this.thumb = this.container.querySelector('.aplayer-thumb');\n        this.volume = this.container.querySelector('.aplayer-volume');\n        this.volumeBar = this.container.querySelector('.aplayer-volume-bar');\n        this.volumeButton = this.container.querySelector('.aplayer-time button');\n        this.volumeBarWrap = this.container.querySelector('.aplayer-volume-bar-wrap');\n        this.loop = this.container.querySelector('.aplayer-icon-loop');\n        this.order = this.container.querySelector('.aplayer-icon-order');\n        this.menu = this.container.querySelector('.aplayer-icon-menu');\n        this.pic = this.container.querySelector('.aplayer-pic');\n        this.title = this.container.querySelector('.aplayer-title');\n        this.author = this.container.querySelector('.aplayer-author');\n        this.dtime = this.container.querySelector('.aplayer-dtime');\n        this.notice = this.container.querySelector('.aplayer-notice');\n        this.miniSwitcher = this.container.querySelector('.aplayer-miniswitcher');\n        this.skipBackButton = this.container.querySelector('.aplayer-icon-back');\n        this.skipForwardButton = this.container.querySelector('.aplayer-icon-forward');\n        this.skipPlayButton = this.container.querySelector('.aplayer-icon-play');\n        this.lrcButton = this.container.querySelector('.aplayer-icon-lrc');\n    }\n}\n\nexport default Template;\n"
  },
  {
    "path": "src/js/timer.js",
    "content": "class Timer {\n    constructor(player) {\n        this.player = player;\n\n        window.requestAnimationFrame = (() =>\n            window.requestAnimationFrame ||\n            window.webkitRequestAnimationFrame ||\n            window.mozRequestAnimationFrame ||\n            window.oRequestAnimationFrame ||\n            window.msRequestAnimationFrame ||\n            function(callback) {\n                window.setTimeout(callback, 1000 / 60);\n            })();\n\n        this.types = ['loading'];\n\n        this.init();\n    }\n\n    init() {\n        this.types.forEach((item) => {\n            this[`init${item}Checker`]();\n        });\n    }\n\n    initloadingChecker() {\n        let lastPlayPos = 0;\n        let currentPlayPos = 0;\n        let bufferingDetected = false;\n        this.loadingChecker = setInterval(() => {\n            if (this.enableloadingChecker) {\n                // whether the audio is buffering\n                currentPlayPos = this.player.audio.currentTime;\n                if (!bufferingDetected && currentPlayPos === lastPlayPos && !this.player.audio.paused) {\n                    this.player.container.classList.add('aplayer-loading');\n                    bufferingDetected = true;\n                }\n                if (bufferingDetected && currentPlayPos > lastPlayPos && !this.player.audio.paused) {\n                    this.player.container.classList.remove('aplayer-loading');\n                    bufferingDetected = false;\n                }\n                lastPlayPos = currentPlayPos;\n            }\n        }, 100);\n    }\n\n    enable(type) {\n        this[`enable${type}Checker`] = true;\n\n        if (type === 'fps') {\n            this.initfpsChecker();\n        }\n    }\n\n    disable(type) {\n        this[`enable${type}Checker`] = false;\n    }\n\n    destroy() {\n        this.types.forEach((item) => {\n            this[`enable${item}Checker`] = false;\n            this[`${item}Checker`] && clearInterval(this[`${item}Checker`]);\n        });\n    }\n}\n\nexport default Timer;\n"
  },
  {
    "path": "src/js/utils.js",
    "content": "const isMobile = /mobile/i.test(window.navigator.userAgent);\n\nconst utils = {\n    /**\n     * Parse second to time string\n     *\n     * @param {Number} second\n     * @return {String} 00:00 or 00:00:00\n     */\n    secondToTime: (second) => {\n        const add0 = (num) => (num < 10 ? '0' + num : '' + num);\n        const hour = Math.floor(second / 3600);\n        const min = Math.floor((second - hour * 3600) / 60);\n        const sec = Math.floor(second - hour * 3600 - min * 60);\n        return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':');\n    },\n\n    isMobile: isMobile,\n\n    storage: {\n        set: (key, value) => {\n            localStorage.setItem(key, value);\n        },\n\n        get: (key) => localStorage.getItem(key),\n    },\n\n    nameMap: {\n        dragStart: isMobile ? 'touchstart' : 'mousedown',\n        dragMove: isMobile ? 'touchmove' : 'mousemove',\n        dragEnd: isMobile ? 'touchend' : 'mouseup',\n    },\n\n    /**\n     * get random order, using Fisher–Yates shuffle\n     */\n    randomOrder: (length) => {\n        function shuffle(arr) {\n            for (let i = arr.length - 1; i >= 0; i--) {\n                const randomIndex = Math.floor(Math.random() * (i + 1));\n                const itemAtIndex = arr[randomIndex];\n                arr[randomIndex] = arr[i];\n                arr[i] = itemAtIndex;\n            }\n            return arr;\n        }\n        return shuffle(\n            [...Array(length)].map(function(item, i) {\n                return i;\n            })\n        );\n    },\n};\n\nexport default utils;\n"
  },
  {
    "path": "src/template/list-item.art",
    "content": "{{each audio}}\n<li>\n    <span class=\"aplayer-list-cur\" style=\"background-color: {{ $value.theme || theme }};\"></span>\n    <span class=\"aplayer-list-index\">{{ $index + index }}</span>\n    <span class=\"aplayer-list-title\">{{ $value.name }}</span>\n    <span class=\"aplayer-list-author\">{{ $value.artist }}</span>\n</li>\n{{/each}}"
  },
  {
    "path": "src/template/lrc.art",
    "content": "{{each lyrics}}\n    <p{{ if $index === 0 }} class=\"aplayer-lrc-current\"{{ /if }}>{{$value[1]}}</p>\n{{/each}}"
  },
  {
    "path": "src/template/player.art",
    "content": "{{ if !options.fixed }}\n<div class=\"aplayer-body\">\n    <div class=\"aplayer-pic\" style=\"{{ if cover  }}background-image: url(&quot;{{ cover }}&quot;);{{ /if }}background-color: {{ options.theme }};\">\n        <div class=\"aplayer-button aplayer-play\">{{@ icons.play }}</div>\n    </div>\n    <div class=\"aplayer-info\">\n        <div class=\"aplayer-music\">\n            <span class=\"aplayer-title\">No audio</span>\n            <span class=\"aplayer-author\"></span>\n        </div>\n        <div class=\"aplayer-lrc\">\n            <div class=\"aplayer-lrc-contents\" style=\"transform: translateY(0); -webkit-transform: translateY(0);\"></div>\n        </div>\n        <div class=\"aplayer-controller\">\n            <div class=\"aplayer-bar-wrap\">\n                <div class=\"aplayer-bar\">\n                    <div class=\"aplayer-loaded\" style=\"width: 0\"></div>\n                    <div class=\"aplayer-played\" style=\"width: 0; background: {{ options.theme }};\">\n                        <span class=\"aplayer-thumb\" style=\"background: {{ options.theme }};\">\n                            <span class=\"aplayer-loading-icon\">{{@ icons.loading }}</span>\n                        </span>\n                    </div>\n                </div>\n            </div>\n            <div class=\"aplayer-time\">\n                <span class=\"aplayer-time-inner\">\n                    <span class=\"aplayer-ptime\">00:00</span> / <span class=\"aplayer-dtime\">00:00</span>\n                </span>\n                <span class=\"aplayer-icon aplayer-icon-back\">\n                    {{@ icons.skip }}\n                </span>\n                <span class=\"aplayer-icon aplayer-icon-play\">\n                    {{@ icons.play }}\n                </span>\n                <span class=\"aplayer-icon aplayer-icon-forward\">\n                    {{@ icons.skip }}\n                </span>\n                <div class=\"aplayer-volume-wrap\">\n                    <button type=\"button\" class=\"aplayer-icon aplayer-icon-volume-down\">\n                        {{@ icons.volumeDown }}\n                    </button>\n                    <div class=\"aplayer-volume-bar-wrap\">\n                        <div class=\"aplayer-volume-bar\">\n                            <div class=\"aplayer-volume\" style=\"height: 80%; background: {{ options.theme }};\"></div>\n                        </div>\n                    </div>\n                </div>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-order\">\n                    {{ if options.order === 'list' }}{{@ icons.orderList }}{{ else if options.order === 'random' }}{{@ icons.orderRandom }}{{ /if }}\n                </button>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-loop\">\n                    {{ if options.loop === 'one' }}{{@ icons.loopOne }}{{ else if options.loop === 'all' }}{{@ icons.loopAll }}{{ else if options.loop === 'none' }}{{@ icons.loopNone }}{{ /if }}\n                </button>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-menu\">\n                    {{@ icons.menu }}\n                </button>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-lrc\">\n                    {{@ icons.lrc }}\n                </button>\n            </div>\n        </div>\n    </div>\n    <div class=\"aplayer-notice\"></div>\n    <div class=\"aplayer-miniswitcher\"><button class=\"aplayer-icon\">{{@ icons.right }}</button></div>\n</div>\n<ol class=\"aplayer-list{{ if options.listFolded }} aplayer-list-hide{{ /if }}\">\n    {{ include './list-item.art' getObject({\n        theme: options.theme,\n        audio: options.audio,\n        index: 1\n    }) }}\n</ol>\n{{ else }}\n<ol class=\"aplayer-list{{ if options.listFolded }} aplayer-list-hide{{ /if }}\">\n    {{ include './list-item.art' getObject({\n        theme: options.theme,\n        audio: options.audio,\n        index: 1\n    }) }}\n</ol>\n<div class=\"aplayer-body\">\n    <div class=\"aplayer-pic\" style=\"{{ if cover  }}background-image: url(&quot;{{ cover }}&quot;);{{ /if }}background-color: {{ options.theme }};\">\n        <div class=\"aplayer-button aplayer-play\">{{@ icons.play }}</div>\n    </div>\n    <div class=\"aplayer-info\" style=\"display: none;\">\n        <div class=\"aplayer-music\">\n            <span class=\"aplayer-title\">No audio</span>\n            <span class=\"aplayer-author\"></span>\n        </div>\n        <div class=\"aplayer-controller\">\n            <div class=\"aplayer-bar-wrap\">\n                <div class=\"aplayer-bar\">\n                    <div class=\"aplayer-loaded\" style=\"width: 0\"></div>\n                    <div class=\"aplayer-played\" style=\"width: 0; background: {{ options.theme }};\">\n                        <span class=\"aplayer-thumb\" style=\"background: {{ options.theme }};\">\n                            <span class=\"aplayer-loading-icon\">{{@ icons.loading }}</span>\n                        </span>\n                    </div>\n                </div>\n            </div>\n            <div class=\"aplayer-time\">\n                <span class=\"aplayer-time-inner\">\n                    <span class=\"aplayer-ptime\">00:00</span> / <span class=\"aplayer-dtime\">00:00</span>\n                </span>\n                <span class=\"aplayer-icon aplayer-icon-back\">\n                    {{@ icons.skip }}\n                </span>\n                <span class=\"aplayer-icon aplayer-icon-play\">\n                    {{@ icons.play }}\n                </span>\n                <span class=\"aplayer-icon aplayer-icon-forward\">\n                    {{@ icons.skip }}\n                </span>\n                <div class=\"aplayer-volume-wrap\">\n                    <button type=\"button\" class=\"aplayer-icon aplayer-icon-volume-down\">\n                        {{@ icons.volumeDown }}\n                    </button>\n                    <div class=\"aplayer-volume-bar-wrap\">\n                        <div class=\"aplayer-volume-bar\">\n                            <div class=\"aplayer-volume\" style=\"height: 80%; background: {{ options.theme }};\"></div>\n                        </div>\n                    </div>\n                </div>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-order\">\n                    {{ if options.order === 'list' }}{{@ icons.orderList }}{{ else if options.order === 'random' }}{{@ icons.orderRandom }}{{ /if }}\n                </button>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-loop\">\n                    {{ if options.loop === 'one' }}{{@ icons.loopOne }}{{ else if options.loop === 'all' }}{{@ icons.loopAll }}{{ else if options.loop === 'none' }}{{@ icons.loopNone }}{{ /if }}\n                </button>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-menu\">\n                    {{@ icons.menu }}\n                </button>\n                <button type=\"button\" class=\"aplayer-icon aplayer-icon-lrc\">\n                    {{@ icons.lrc }}\n                </button>\n            </div>\n        </div>\n    </div>\n    <div class=\"aplayer-notice\"></div>\n    <div class=\"aplayer-miniswitcher\"><button class=\"aplayer-icon\">{{@ icons.right }}</button></div>\n</div>\n<div class=\"aplayer-lrc\">\n    <div class=\"aplayer-lrc-contents\" style=\"transform: translateY(0); -webkit-transform: translateY(0);\"></div>\n</div>\n{{/if}}"
  },
  {
    "path": "tea.yaml",
    "content": "# https://tea.xyz/what-is-this-file\n---\nversion: 1.0.0\ncodeOwners:\n  - '0x185bfcef7b37010e2511309048a130f477f54fBf'\nquorum: 1\n"
  },
  {
    "path": "webpack/dev.config.js",
    "content": "const path = require('path');\nconst webpack = require('webpack');\nconst GitRevisionPlugin = require('git-revision-webpack-plugin');\nconst gitRevisionPlugin = new GitRevisionPlugin();\nconst autoprefixer = require('autoprefixer');\nconst cssnano = require('cssnano');\n\nmodule.exports = {\n    mode: 'development',\n\n    devtool: 'cheap-module-source-map',\n\n    entry: {\n        APlayer: './src/js/index.js',\n    },\n\n    output: {\n        path: path.resolve(__dirname, '..', 'dist'),\n        filename: '[name].js',\n        library: '[name]',\n        libraryTarget: 'umd',\n        libraryExport: 'default',\n        umdNamedDefine: true,\n        publicPath: '/',\n    },\n\n    resolve: {\n        modules: ['node_modules'],\n        extensions: ['.js', '.scss'],\n    },\n\n    module: {\n        strictExportPresence: true,\n        rules: [\n            {\n                test: /\\.js$/,\n                use: [\n                    {\n                        loader: 'babel-loader',\n                        options: {\n                            cacheDirectory: true,\n                            presets: ['@babel/preset-env'],\n                        },\n                    },\n                ],\n            },\n            {\n                test: /\\.scss$/,\n                use: [\n                    'style-loader',\n                    {\n                        loader: 'css-loader',\n                        options: {\n                            importLoaders: 1,\n                        },\n                    },\n                    {\n                        loader: 'postcss-loader',\n                        options: {\n                            plugins: [autoprefixer, cssnano],\n                        },\n                    },\n                    'sass-loader',\n                ],\n            },\n            {\n                test: /\\.(png|jpg)$/,\n                loader: 'url-loader',\n                options: {\n                    limit: 40000,\n                },\n            },\n            {\n                test: /\\.svg$/,\n                loader: 'svg-inline-loader',\n            },\n            {\n                test: /\\.art$/,\n                loader: 'art-template-loader',\n            },\n        ],\n    },\n\n    devServer: {\n        compress: true,\n        contentBase: path.resolve(__dirname, '..', 'demo'),\n        clientLogLevel: 'none',\n        quiet: false,\n        open: true,\n        historyApiFallback: {\n            disableDotRule: true,\n        },\n        watchOptions: {\n            ignored: /node_modules/,\n        },\n    },\n\n    plugins: [\n        new webpack.DefinePlugin({\n            APLAYER_VERSION: `\"${require('../package.json').version}\"`,\n            GIT_HASH: JSON.stringify(gitRevisionPlugin.version()),\n        }),\n    ],\n\n    node: {\n        dgram: 'empty',\n        fs: 'empty',\n        net: 'empty',\n        tls: 'empty',\n    },\n\n    performance: {\n        hints: false,\n    },\n};\n"
  },
  {
    "path": "webpack/prod.config.js",
    "content": "const path = require('path');\nconst webpack = require('webpack');\nconst GitRevisionPlugin = require('git-revision-webpack-plugin');\nconst gitRevisionPlugin = new GitRevisionPlugin();\nconst autoprefixer = require('autoprefixer');\nconst cssnano = require('cssnano');\n\nmodule.exports = {\n    mode: 'production',\n\n    bail: true,\n\n    devtool: 'source-map',\n\n    entry: {\n        APlayer: './src/js/index.js',\n    },\n\n    output: {\n        path: path.resolve(__dirname, '..', 'dist'),\n        filename: '[name].min.js',\n        library: '[name]',\n        libraryTarget: 'umd',\n        libraryExport: 'default',\n        umdNamedDefine: true,\n        publicPath: '/',\n    },\n\n    resolve: {\n        modules: ['node_modules'],\n        extensions: ['.js', '.scss'],\n    },\n\n    module: {\n        strictExportPresence: true,\n        rules: [\n            {\n                test: /\\.js$/,\n                use: [\n                    'template-string-optimize-loader',\n                    {\n                        loader: 'babel-loader',\n                        options: {\n                            cacheDirectory: true,\n                            presets: ['@babel/preset-env'],\n                        },\n                    },\n                ],\n            },\n            {\n                test: /\\.scss$/,\n                use: [\n                    'style-loader',\n                    {\n                        loader: 'css-loader',\n                        options: {\n                            importLoaders: 1,\n                        },\n                    },\n                    {\n                        loader: 'postcss-loader',\n                        options: {\n                            plugins: [autoprefixer, cssnano],\n                        },\n                    },\n                    'sass-loader',\n                ],\n            },\n            {\n                test: /\\.(png|jpg)$/,\n                loader: 'url-loader',\n                options: {\n                    limit: 40000,\n                },\n            },\n            {\n                test: /\\.svg$/,\n                loader: 'svg-inline-loader',\n            },\n            {\n                test: /\\.art$/,\n                loader: 'art-template-loader',\n            },\n        ],\n    },\n\n    plugins: [\n        new webpack.DefinePlugin({\n            APLAYER_VERSION: `\"${require('../package.json').version}\"`,\n            GIT_HASH: JSON.stringify(gitRevisionPlugin.version()),\n        }),\n    ],\n\n    node: {\n        dgram: 'empty',\n        fs: 'empty',\n        net: 'empty',\n        tls: 'empty',\n    },\n};\n"
  }
]