Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_network_test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
JM_network_test
Commits
22aae6c5
Commit
22aae6c5
authored
Oct 26, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qqqq
parent
88ae8435
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
110 deletions
+121
-110
package.json
package.json
+1
-2
play.component.ts
src/app/play/play.component.ts
+120
-108
No files found.
package.json
View file @
22aae6c5
...
...
@@ -31,8 +31,7 @@
"
rxjs
"
:
"
~6.5.4
"
,
"
spark-md5
"
:
"
^3.0.0
"
,
"
tslib
"
:
"
^1.10.0
"
,
"
zone.js
"
:
"
~0.10.2
"
,
"
node-sass
"
:
"
4.0.0
"
"
zone.js
"
:
"
~0.10.2
"
},
"devDependencies"
:
{
"
@angular-devkit/build-angular
"
:
"
~0.900.3
"
,
...
...
src/app/play/play.component.ts
View file @
22aae6c5
...
...
@@ -797,13 +797,22 @@ export class PlayComponent implements OnInit, OnDestroy {
}
url2Blob
(
url
)
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
,
reject
)
=>
{
console
.
log
(
'
in url2Blob ..
'
)
console
.
log
(
'
in url2Blob ..
'
)
;
console
.
log
(
'
url:
'
,
url
);
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
get
'
,
url
,
true
);
xhr
.
responseType
=
'
arraybuffer
'
;
// const xhr = new XMLHttpRequest();
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 = () => {
// console.log(' in url2Blob load end..')
...
...
@@ -814,6 +823,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// }
// };
/*
xhr.onreadystatechange = () => {
if (xhr.readyState !== 4) {
return;
...
...
@@ -824,18 +834,20 @@ export class PlayComponent implements OnInit, OnDestroy {
if ((status >= 200 && status < 300) || status === 304) {
console.log('request success');
console.log(xhr.response);
console.log(xhr.response);
resolve(xhr.response);
} else {
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();
*/
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment