diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..b80fdb0f --- /dev/null +++ b/.eslintrc @@ -0,0 +1,61 @@ +{ + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "env": { + "browser": true + }, + "rules": { + "no-console": 0, + "no-extra-parens": 1, + "block-scoped-var": 1, + "curly": 1, + "eqeqeq": 1, + "no-global-assign": 1, + "no-implicit-globals": 1, + "no-labels": 1, + "no-multi-str": 1, + "comma-spacing": 1, + "comma-style": 1, + "func-call-spacing": 1, + "indent": 1, + "keyword-spacing": 1, + "linebreak-style": 1, + "lines-around-comment": 1, + "no-multiple-empty-lines": 1, + "space-infix-ops": 1, + "arrow-spacing": 1, + "no-var": 1, + "prefer-const": 1, + "no-unsafe-negation": 1, + "array-callback-return": 1, + "dot-location": 1, + "dot-notation": 1, + "no-eval": 1, + "no-extend-native": 1, + "no-extra-label": 1, + "semi": 1, + "space-before-blocks": 1, + "space-before-function-paren": 1, + "space-in-parens": 1, + "space-unary-ops": 1, + "spaced-comment": 1, + "arrow-body-style": 1, + "arrow-parens": 1, + "no-restricted-imports": 1, + "no-duplicate-imports": 1, + "no-useless-computed-key": 1, + "no-useless-rename": 1, + "rest-spread-spacing": 1, + "no-trailing-spaces": 1 + }, + "globals": { + "require": false, + "module": false, + "Hls": false, + "flvjs": false, + "dashjs": false + } +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 0f9c7394..9138bc89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,9 @@ language: node_js + node_js: - - "6.1" \ No newline at end of file + - "node" + +cache: + yarn: true + directories: + - node_modules \ No newline at end of file diff --git a/demo/demo.js b/demo/demo.js index 02cbe3ef..fb1b6546 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,4 +1,4 @@ -var ap1 = new APlayer({ +const ap1 = new APlayer({ element: document.getElementById('player1'), narrow: false, autoplay: true, @@ -10,8 +10,8 @@ var ap1 = new APlayer({ music: { title: 'Preparation', author: 'Hans Zimmer/Richard Harvey', - url: 'http://devtest.qiniudn.com/Preparation.mp3', - pic: 'http://devtest.qiniudn.com/Preparation.jpg' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/preparation.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/preparation.jpg' } }); ap1.on('play', function () { @@ -36,7 +36,7 @@ ap1.on('error', function () { console.log('error'); }); -var ap2 = new APlayer({ +const ap2 = new APlayer({ element: document.getElementById('player2'), narrow: true, autoplay: false, @@ -47,12 +47,12 @@ var ap2 = new APlayer({ music: { title: 'Preparation', author: 'Hans Zimmer/Richard Harvey', - url: 'http://devtest.qiniudn.com/Preparation.mp3', - pic: 'http://devtest.qiniudn.com/Preparation.jpg' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/preparation.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/preparation.jpg' } }); -var ap3 = new APlayer({ +const ap3 = new APlayer({ element: document.getElementById('player3'), narrow: false, autoplay: false, @@ -63,13 +63,13 @@ var ap3 = new APlayer({ music: { title: '回レ!雪月花', author: '小倉唯', - url: 'http://devtest.qiniudn.com/回レ!雪月花.mp3', - pic: 'http://devtest.qiniudn.com/回レ!雪月花.jpg', - lrc: "回レ!雪月花.lrc" + url: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.jpg', + lrc: "https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.lrc" } }); -var ap4 = new APlayer({ +const ap4 = new APlayer({ element: document.getElementById('player4'), narrow: false, autoplay: false, @@ -81,25 +81,25 @@ var ap4 = new APlayer({ { title: 'あっちゅ~ま青春!', author: '七森中☆ごらく部', - url: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.mp3', - pic: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.jpg' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/yuruyuri.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/yuruyuri.jpg' }, { title: 'secret base~君がくれたもの~', author: '茅野愛衣', - url: 'http://devtest.qiniudn.com/secret base~.mp3', - pic: 'http://devtest.qiniudn.com/secret base~.jpg' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.jpg' }, { title: '回レ!雪月花', author: '小倉唯', - url: 'http://devtest.qiniudn.com/回レ!雪月花.mp3', - pic: 'http://devtest.qiniudn.com/回レ!雪月花.jpg' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.jpg' } ] }); -var ap5 = new APlayer({ +const ap5 = new APlayer({ element: document.getElementById('player5'), narrow: false, autoplay: false, @@ -112,23 +112,23 @@ var ap5 = new APlayer({ { title: 'あっちゅ~ま青春!', author: '七森中☆ごらく部', - url: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.mp3', - pic: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.jpg', - lrc: 'あっちゅ~ま青春!.lrc' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/yuruyuri.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/yuruyuri.jpg', + lrc: 'https://moeplayer.b0.upaiyun.com/aplayer/yuruyuri.lrc' }, { title: 'secret base~君がくれたもの~', author: '茅野愛衣', - url: 'http://devtest.qiniudn.com/secret base~.mp3', - pic: 'http://devtest.qiniudn.com/secret base~.jpg', - lrc: 'secret base~君がくれたもの~.lrc' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.jpg', + lrc: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.lrc' }, { title: '回レ!雪月花', author: '小倉唯', - url: 'http://devtest.qiniudn.com/回レ!雪月花.mp3', - pic: 'http://devtest.qiniudn.com/回レ!雪月花.jpg', - lrc: '回レ!雪月花.lrc' + url: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.mp3', + pic: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.jpg', + lrc: 'https://moeplayer.b0.upaiyun.com/aplayer/snowmoonflowers.lrc' } ] }); \ No newline at end of file diff --git a/demo/index.html b/demo/index.html index bc331e5e..ed301f25 100644 --- a/demo/index.html +++ b/demo/index.html @@ -43,6 +43,7 @@ font-size: 18px; } +