Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_03
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
dfzx_03
Commits
54d9ca8f
Commit
54d9ca8f
authored
Jul 18, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加_l处理
parent
95abd31c
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5902 additions
and
14101 deletions
+5902
-14101
package-lock.json
package-lock.json
+5838
-4194
package.json
package.json
+4
-3
play.component.ts
src/app/play/play.component.ts
+60
-2
yarn.lock
yarn.lock
+0
-9902
No files found.
package-lock.json
View file @
54d9ca8f
This diff is collapsed.
Click to expand it.
package.json
View file @
54d9ca8f
...
...
@@ -43,6 +43,7 @@
"
nedb
"
:
"
^1.8.0
"
,
"
ng-lottie
"
:
"
^0.3.1
"
,
"
ng-zorro-antd
"
:
"
^7.2.0
"
,
"
node-sass
"
:
"
^4.14.1
"
,
"
npm
"
:
"
^6.5.0
"
,
"
rxjs
"
:
"
^6.3.3
"
,
"
rxjs-compat
"
:
"
^6.3.3
"
,
...
...
src/app/play/play.component.ts
View file @
54d9ca8f
...
...
@@ -30,9 +30,64 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
constructor
(
private
appRef
:
ApplicationRef
)
{
}
httpHeadCall
(
requsetUrl
,
callback
)
{
let
xhr
=
new
XMLHttpRequest
();
console
.
log
(
"
Status: Send Post Request to
"
+
requsetUrl
);
try
{
xhr
.
onreadystatechange
=
()
=>
{
try
{
console
.
log
(
'
xhr.readyState:
'
,
xhr
.
readyState
);
if
(
xhr
.
readyState
==
4
)
{
if
((
xhr
.
status
>=
200
&&
xhr
.
status
<
400
))
{
callback
(
true
);
}
else
{
callback
(
false
);
}
}
}
catch
(
e
)
{
console
.
log
(
e
)
}
};
xhr
.
open
(
"
HEAD
"
,
requsetUrl
,
true
);
// xhr.setRequestHeader('content-type', 'application/json');
// xhr.setRequestHeader('token', this.token);
// xhr.send(JSON.stringify(requestData));
xhr
.
send
();
xhr
.
timeout
=
15000
;
xhr
.
onerror
=
(
e
)
=>
{
console
.
log
(
"
汪汪汪 posterror
"
,
e
);
callback
(
false
);
};
xhr
.
ontimeout
=
(
e
)
=>
{
console
.
log
(
"
汪汪汪 ontimeout
"
,
e
);
callback
(
false
);
};
}
catch
(
e
)
{
console
.
log
(
"
Send Get Request error:
"
,
e
)
}
}
getVideoUrl
()
{
const
url1
=
this
.
data
.
contentObj
.
video_url
;
const
url2
=
url1
.
replace
(
/.mp4$/g
,
"
_l.mp4
"
);
this
.
httpHeadCall
(
url2
,
(
success
)
=>
{
if
(
success
)
{
this
.
data
.
contentObj
.
video_url
=
url2
;
}
})
}
ngOnInit
()
{
// console.log(this.data.contentObj)
// this.hasVideo = !!this.data.contentObj.video_url && typeof this.data.contentObj.video_url === 'string';
this
.
data
=
{};
this
.
data
.
contentObj
=
{};
...
...
@@ -54,6 +109,9 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
this
.
initDefaultData
();
console
.
log
(
'
this.data.contentObj.video_url:
'
,
this
.
data
.
contentObj
.
video_url
);
if
(
this
.
data
.
contentObj
.
video_url
)
{
this
.
getVideoUrl
();
}
this
.
hasVideo
=
!!
this
.
data
.
contentObj
.
video_url
&&
typeof
this
.
data
.
contentObj
.
video_url
===
'
string
'
;
...
...
yarn.lock
deleted
100644 → 0
View file @
95abd31c
This diff is collapsed.
Click to expand it.
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