Last active
June 29, 2017 03:03
-
-
Save maicong/7fb26d07a2b0bc19b28e8cf01dbddbed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<div id="player" class="aplayer"></div> | |
<script src="https://cdn.bootcss.com/aplayer/1.6.0/APlayer.min.js"></script> | |
<script> | |
(() => { | |
const music = [ | |
{ | |
title: '以前你给过的快乐 现在都陪着我难过', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/06/18/2608207362935446022_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '为什么要爱你?', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/04/08/2595049036987342342_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '异地恋怎么了,难道天下情侣都是老乡吗?', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/04/08/2595046679050261510_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '你是那种不爱交际的人吗 ', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/04/03/2594155380994616326_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '希望你变成一个不被内心吞没的女人', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/03/19/2591210126497670150_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '决定女人成功的能力', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/03/18/2591205702681323014_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '恨是如何让你失去力量的呢?', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/02/28/2587799555154966022_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '因为我是女人', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/02/18/2585860439577495558_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '女人的选择(希望你变成一个脱离婚姻的女人)', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/02/16/2585475649164103686_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '为什么你不需要乖乖听话?', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/02/13/2585073159187572742_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '女人要感谢对自己说“狠话”的男人', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/02/05/2583436815303595014_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '爱上一个浪子 怎么办?', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2017/01/02/2577199511324688390_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '是什么,使得你身心疲惫?', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/12/22/2575066555402860038_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '别笑了 眼泪都掉了 周诗诗', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/12/11/2573031668617957894_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '眼别瞎 看懂谁对你好', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/11/21/2569330701742541830_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '姑娘 加油~', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/11/16/2568402761172243462_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '成长', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/09/04/2555024709218061318_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '狼狈不堪', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/09/04/2555025125829891590_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '风的追随还是树的不挽留', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/09/04/2555023979073614342_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
}, | |
{ | |
title: '不懂得安慰,只懂得陪她落泪', | |
author: '执挽', | |
url: 'http://cdn5.lizhi.fm/audio/2016/09/01/2554307657988519430_hd.mp3', | |
pic: 'http://cdnimg103.lizhi.fm/radio_cover/2016/08/14/30640040356838148.jpg' | |
} | |
] | |
const ls = window.localStorage | |
const ap = new window.APlayer({ | |
element: document.getElementById('player'), | |
narrow: false, | |
autoplay: false, | |
showlrc: false, | |
mutex: true, | |
theme: '#ad7a86', | |
preload: 'metadata', | |
mode: 'circulation', | |
music: music.reverse() | |
}) | |
const playIndex = Number(ls.getItem('_playIndex')) | |
ap.setMusic(playIndex) | |
ap.play( | |
Number(ls.getItem(`_currentTime_${playIndex}`)) | |
) | |
ap.on('playing', () => { | |
ls.setItem('_playIndex', ap.playIndex) | |
ls.setItem(`_currentTime_${ap.playIndex}`, ap.audio.currentTime) | |
}) | |
})() | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment