From 8a29d3f93aebb42da14140ac460696a3888f05cf Mon Sep 17 00:00:00 2001 From: dds_feng Date: Tue, 13 Dec 2016 23:13:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BE=93=E5=87=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A0=BC=E5=BC=8F=E5=8F=98=E6=9B=B4=E5=AF=BC=E8=87=B4?= =?UTF-8?q?js=E5=87=BA=E9=94=99,=E6=9B=B4=E6=96=B0js=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index f45d69c..b28c6df 100644 --- a/index.html +++ b/index.html @@ -117,7 +117,7 @@ xhr.onreadystatechange = () => { if (xhr.readyState === 4) { if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) { - const response = JSON.parse(xhr.responseText); + var response = JSON.parse(xhr.responseText); var dp2 = new DPlayer({ element: document.getElementById('dplayer2'), autoplay: false, @@ -125,7 +125,7 @@ loop: true, screenshot: false, video: { - url: response.durl[0].url, + url: response.video.durl.url, pic: 'http://devtest.qiniudn.com/微小微-江南皮革厂倒闭了.jpg' }, danmaku: { @@ -136,14 +136,13 @@ addition: ['https://api.prprpr.me/dplayer/bilibili?aid=4045652'] } }); - } - else { + } else { console.log('Request was unsuccessful: ' + xhr.status); } } }; - xhr.open('get', 'https://api.prprpr.me/dplayer/video/bilibili?aid=4045652', true); - xhr.send(null); + xhr.open('GET', 'https://api.prprpr.me/dplayer/video/bilibili?aid=4045652', true); + xhr.send(); // Live Video (HTTP Live Streaming, M3U8 format) support var dp3 = new DPlayer({ @@ -199,4 +198,5 @@ requestAnimationFrame(animate); - \ No newline at end of file + +