Commit 949793e8 authored by limingzhe's avatar limingzhe

style: 文本样式

parents da3447ee 22aae6c5
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"zone.js": "~0.10.2", "zone.js": "~0.10.2"
"node-sass": "4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.900.3", "@angular-devkit/build-angular": "~0.900.3",
......
...@@ -784,13 +784,22 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -784,13 +784,22 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
url2Blob (url) { url2Blob (url) {
return new Promise(resolve => { return new Promise((resolve, reject) => {
console.log(' in url2Blob ..') console.log(' in url2Blob ..');
console.log('url: ', url); console.log('url: ', url);
var xhr = new XMLHttpRequest(); // const xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'arraybuffer'; fetch(url)
// Retrieve its body as ReadableStream
.then(response => {
console.log(' in url2Blob load end..');
console.log(response.arrayBuffer);
resolve(response.arrayBuffer);
});
// xhr.open('get', url, true);
// xhr.responseType = 'arraybuffer';
// xhr.onload = () => { // xhr.onload = () => {
// console.log(' in url2Blob load end..') // console.log(' in url2Blob load end..')
...@@ -801,6 +810,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -801,6 +810,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// } // }
// }; // };
/*
xhr.onreadystatechange = () => { xhr.onreadystatechange = () => {
if (xhr.readyState !== 4) { if (xhr.readyState !== 4) {
return; return;
...@@ -811,18 +821,20 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -811,18 +821,20 @@ export class PlayComponent implements OnInit, OnDestroy {
if ((status >= 200 && status < 300) || status === 304) { if ((status >= 200 && status < 300) || status === 304) {
console.log('request success'); console.log('request success');
console.log(xhr.response); console.log(xhr.response);
console.log(xhr.response);
resolve(xhr.response); resolve(xhr.response);
} else { } else {
console.log('request error'); console.log('request error');
console.log('xhr.response: ', xhr.response); console.log('xhr.response1: ', xhr.response);
console.log('xhr.response2: ', xhr.responseText);
reject(xhr);
} }
}; };
xhr.responseType = 'arraybuffer';
xhr.open('get', url, true);
xhr.send(); xhr.send();
*/
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment