Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
teddi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
teddi
Commits
39eff6a2
Commit
39eff6a2
authored
Nov 17, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a59966a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
readme.md
readme.md
+9
-0
svga.ts
src/svga.ts
+5
-1
No files found.
readme.md
View file @
39eff6a2
...
...
@@ -67,3 +67,12 @@ svga.onFinished(() => {
});
```
[
了解更多,请点击查看API
](
./globals.html#getsvga
)
# 快速加载svga资源,但不装载 loadSVGA
js
```
js
import
{
loadSVGA
}
from
"teddi"
;
const
url
=
''
;
const
videoItem
=
await
loadSVGA
(
url
);
```
[
了解更多,请点击查看API
](
./globals.html#loadsvga
)
\ No newline at end of file
src/svga.ts
View file @
39eff6a2
...
...
@@ -2,6 +2,10 @@ import SVGA = require("svgaplayerweb");
var
svgaParser
=
new
SVGA
.
Parser
();
/**
* 快速加载svga资源,但不装载
* @param url 资源URL
*/
export
const
loadSVGA
=
(
url
:
string
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
svgaParser
.
load
(
url
,
(
videoItem
:
SVGA
.
VideoEntity
)
=>
{
...
...
@@ -12,7 +16,7 @@ export const loadSVGA = (url:string) => {
})
}
/**
*
加载一个svga
*
快速装载一个svga动画
* @param url 资源URL
* @param className 挂载元素的class name
* @param loops 播放次数。默认为空,循环播放。
...
...
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