@lijuhong1981/jsgif 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/GIFImageLoader.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijuhong1981/jsgif",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "lijuhong1981 <lijuhong@hotmail.com>",
|
|
6
6
|
"homepage": "https://github.com/lijuhong1981/jslibs#readme",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/lijuhong1981/jslibs/issues"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "c46541f47b63668952abb99d1edd73e9781418a9",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@lijuhong1981/jscheck": "^1.0.10",
|
|
24
24
|
"@lijuhong1981/jsdestroy": "^1.1.10",
|
|
25
|
-
"@lijuhong1981/jsevents": "^1.1.
|
|
26
|
-
"@lijuhong1981/jsload": "^1.2.
|
|
25
|
+
"@lijuhong1981/jsevents": "^1.1.8",
|
|
26
|
+
"@lijuhong1981/jsload": "^1.2.5"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/src/GIFImageLoader.js
CHANGED
|
@@ -6,14 +6,17 @@ class GIFImageLoader extends ImageLoader {
|
|
|
6
6
|
// super(options);
|
|
7
7
|
// }
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 重写图片加载函数,生成canvas以绘制gif动画
|
|
11
|
+
*/
|
|
12
|
+
onImageLoad(options, onLoad, onError) {
|
|
10
13
|
const player = new GIFPlayer();
|
|
11
|
-
player.loadUrl(url,
|
|
12
|
-
player.canvas.gifPlayer = player;
|
|
14
|
+
player.loadUrl(options.url, options.requestOptions, function () {
|
|
13
15
|
onLoad(player.canvas);
|
|
14
16
|
}, function (error) {
|
|
15
17
|
onError(error);
|
|
16
18
|
});
|
|
19
|
+
player.canvas.gifPlayer = player;
|
|
17
20
|
return player.canvas;
|
|
18
21
|
}
|
|
19
22
|
};
|