-
Notifications
You must be signed in to change notification settings - Fork 0
/
mp3.html
72 lines (70 loc) · 2.3 KB
/
mp3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html xmlns="/www.w3.org/1999/xhtml">
<head id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="qrcode.js"></script>
<script
type="text/javascript"
src="http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"
></script>
<script
type="text/javascript"
src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"
></script>
<script src="https://cdn.jsdelivr.net/npm/color-thief-don@2.0.2/src/color-thief.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/aplayer@1.10.0/dist/APlayer.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.0/dist/APlayer.min.js"></script>
</head>
<body>
<header></header>
<script src="src/js/smusic.min.js"></script>
<div id="aplayer"></div>
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return "";
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
const ap = new APlayer({
container: document.getElementById("aplayer"),
autoplay: true,
listFolded: false,
theme: "#e9e9e9",
listMaxHeight: 90,
audio: [
{
name: getParameterByName("title"),
artist: getParameterByName("artist"),
url: getParameterByName("src"),
cover: "http://ting.xiai123.com/images/2016chun-8x.png"
},
{
name: getParameterByName("title"),
artist: getParameterByName("artist"),
url: getParameterByName("src"),
cover: "http://ting.xiai123.com/images/2016chun-8x.png"
}
]
});
ap.play();
</script>
<div id="qrcode"></div>
<img id="img" src="#" alt="#" />
</body>
<script>
let imgBase64 = jrQrcode.getQrBase64(unescape(window.location.href), {});
document.getElementById("img").setAttribute("src", imgBase64);
jQuery("#qrcode").qrcode({
width: 300,
height: 300,
text: window.location.href
});
</script>
</html>