Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit d97916c

Browse files
committed
docs: 文档更新
1 parent 977059e commit d97916c

File tree

3 files changed

+46
-9
lines changed

3 files changed

+46
-9
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# SVGAPlayer-Android CHANGELOG (2021-03-02)
22

3+
## [2.6.0](2021-08-18)
4+
5+
## Features
6+
7+
* feat(SVGASoundManager): Added SVGASoundManager to control SVGA audio, you need to manually call the init method to initialize, otherwise follow the default audio loading logic.
8+
* feat(SVGAParser): SVGAParser#decodeFromAssets and SVGAParser#decodeFromURL add a parameter, which can be null. It is used to send the audio file back to the developer. The developer can control the audio playback by himself. If this parameter is set, the audio part will not be processed internally.
9+
* feat(SVGAParser): Add aliases to the log section to facilitate developers to troubleshoot problems
10+
* feat(SVGACache): Open cache cleaning method: SVGACache#clearCache().
11+
12+
### Bug Fixes
13+
14+
* refactor(ILogger): Remove redundant api.
15+
* fix(SoundPool): Added SVGASoundManager to solve the problem that the internal SoundPool does not load audio occasionally.
16+
* fix(SVGAParser): Zip Path Traversal Vulnerability.
17+
* fix(SVGAParser): link reuse problem.
318

419
## [2.5.15](https://github.com/svga/SVGAPlayer-Android/compare/2.5.14...2.5.15) (2021-03-02)
520

readme.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,24 @@ You can also create `SVGAParser` instance by yourself.
151151

152152
```kotlin
153153
parser = new SVGAParser(this);
154-
parser.decodeFromAssets("posche.svga", new SVGAParser.ParseCompletion() {
154+
// The third parameter is a default parameter, which is null by default. If this method is set, the audio parsing and playback will not be processed internally. The audio File instance will be sent back to the developer through PlayCallback, and the developer will control the audio playback and playback. stop
155+
parser.decodeFromAssets("posche.svga", object : SVGAParser.ParseCompletion {
155156
// ...
156-
});
157+
}, object : SVGAParser.PlayCallback {
158+
// The default is null, can not be set
159+
})
157160
```
158161

159162
#### Create a `SVGAParser` instance, parse from remote server like this.
160163

161164
```kotlin
162165
parser = new SVGAParser(this);
166+
// The third parameter is a default parameter, which is null by default. If this method is set, the audio parsing and playback will not be processed internally. The audio File instance will be sent back to the developer through PlayCallback, and the developer will control the audio playback and playback. stop
163167
parser.decodeFromURL(new URL("https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true"), new SVGAParser.ParseCompletion() {
164-
165-
});
168+
// ...
169+
}, object : SVGAParser.PlayCallback {
170+
// The default is null, can not be set
171+
})
166172
```
167173

168174
#### Create a `SVGADrawable` instance then set to `SVGAImageView`, play it as you want.
@@ -203,6 +209,11 @@ Updated the internal log output, which can be managed and controlled through SVG
203209
Set whether the log is enabled through the `setLogEnabled` method
204210
Inject a custom ILogger implementation class through the `injectSVGALoggerImp` method
205211

212+
### SVGASoundManager
213+
Added SVGASoundManager to control SVGA audio, you need to manually call the init method to initialize, otherwise follow the default audio loading logic.
214+
In addition, through SVGASoundManager#setVolume, you can control the volume of SVGA playback. The range is [0f, 1f]. By default, the volume of all SVGA playbacks is controlled.
215+
And this method can set a second default parameter: SVGAVideoEntity, which means that only the current SVGA volume is controlled, and the volume of other SVGAs remains unchanged.
216+
206217
## Features
207218

208219
Here are many feature samples.

readme.zh.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,24 @@ SVGAParser.shareParser().init(this);
132132

133133
```kotlin
134134
parser = new SVGAParser(this);
135-
parser.decodeFromAssets("posche.svga", new SVGAParser.ParseCompletion() {
136-
137-
});
135+
// 第三个为可缺省参数,默认为 null,如果设置该方法,则内部不在处理音频的解析以及播放,会通过 PlayCallback 把音频 File 实例回传给开发者,有开发者自行控制音频的播放与停止。
136+
parser.decodeFromAssets("posche.svga", object : SVGAParser.ParseCompletion {
137+
// ...
138+
}, object : SVGAParser.PlayCallback {
139+
// The default is null, can not be set
140+
})
138141
```
139142

140143
#### 创建一个 `SVGAParser` 实例,加载远端服务器中的动画。
141144

142145
```kotlin
143146
parser = new SVGAParser(this);
147+
// 第三个为可缺省参数,默认为 null,如果设置该方法,则内部不在处理音频的解析以及播放,会通过 PlayCallback 把音频 File 实例回传给开发者,有开发者自行控制音频的播放与停止。
144148
parser.decodeFromURL(new URL("https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true"), new SVGAParser.ParseCompletion() {
145-
146-
});
149+
// ...
150+
}, object : SVGAParser.PlayCallback {
151+
// The default is null, can not be set
152+
})
147153
```
148154

149155
#### 创建一个 `SVGADrawable` 实例,并赋值给 `SVGAImageView`,然后播放动画。
@@ -184,6 +190,11 @@ HttpResponseCache.install(cacheDir, 1024 * 1024 * 128)
184190
通过 `setLogEnabled` 方法设置日志是否开启
185191
通过 `injectSVGALoggerImp` 方法注入自定义 ILogger 实现类
186192

193+
### SVGASoundManager
194+
新增 SVGASoundManager 控制 SVGA 音频,需要手动调用 init 方法进行初始化,否则按照默认的音频加载逻辑。
195+
另外通过 SVGASoundManager#setVolume 可控制 SVGA 播放时的音量大小,范围值在 [0f, 1f],默认控制所有 SVGA 播放时的音量,
196+
而且该方法可设置第二个可缺省参数:SVGAVideoEntity,表示仅控制当前 SVGA 的音量大小,其他 SVGA 的音量保持不变。
197+
187198
## 功能示例
188199

189200
* [使用位图替换指定元素。](https://github.com/yyued/SVGAPlayer-Android/wiki/Dynamic-Image)

0 commit comments

Comments
 (0)