You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
* 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().
16
+
* 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.([f29563e](https://github.com/svga/SVGAPlayer-Android/commit/f29563e))
* 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.([8437fd7](https://github.com/svga/SVGAPlayer-Android/commit/8437fd7))
19
+
* feat(SVGAParser): Add aliases to the log section to facilitate developers to troubleshoot problems([977059e](https://github.com/svga/SVGAPlayer-Android/commit/977059e))
20
+
* feat(SVGACache): Open cache cleaning method: SVGACache#clearCache().([a8d926e](https://github.com/svga/SVGAPlayer-Android/commit/a8d926e))
11
21
12
22
### Bug Fixes
13
23
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.
Copy file name to clipboardExpand all lines: readme.md
+33-2Lines changed: 33 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ How many times should animation loops. `0` means Infinity Loop.
101
101
102
102
#### ~~clearsAfterStop: Boolean~~
103
103
104
-
Defaults to `true`.When the animation is finished, whether to clear the canvas and the internal data of SVGAVideoEntity.
104
+
Defaults to `false`.When the animation is finished, whether to clear the canvas and the internal data of SVGAVideoEntity.
105
105
It is no longer recommended. Developers can control resource release through clearAfterDetached, or manually control resource release through SVGAVideoEntity#clear
106
106
107
107
#### clearsAfterDetached: Boolean
@@ -116,7 +116,7 @@ Defaults to `Forward`. Could be `Forward`, `Backward`, `Clear`.
116
116
117
117
`Backward` means animation will pause on first frame after finished.
118
118
119
-
'Clear' after the animation is played, all the canvas content is cleared, but it is only the canvas and does not involve the internal data of SVGAVideoEntity.
119
+
`Clear` after the animation is played, all the canvas content is cleared, but it is only the canvas and does not involve the internal data of SVGAVideoEntity.
120
120
121
121
### Using code
122
122
@@ -208,11 +208,42 @@ Updated the internal log output, which can be managed and controlled through SVG
208
208
Set whether the log is enabled through the `setLogEnabled` method
209
209
Inject a custom ILogger implementation class through the `injectSVGALoggerImp` method
210
210
211
+
212
+
```kotlin
213
+
214
+
// By default, SVGA will not output any log, so you need to manually set it to true
215
+
SVGALogger.setLogEnabled(true)
216
+
217
+
// If you want to collect the output log of SVGA, you can obtain it in the following way
218
+
SVGALogger.injectSVGALoggerImp(object:ILogger {
219
+
// Implement related interfaces to receive log
220
+
})
221
+
```
222
+
211
223
### SVGASoundManager
212
224
Added SVGASoundManager to control SVGA audio, you need to manually call the init method to initialize, otherwise follow the default audio loading logic.
213
225
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.
214
226
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.
215
227
228
+
```kotlin
229
+
// Initialize the audio manager for easy management of audio playback
230
+
// If it is not initialized, the audio will be loaded in the original way by default
231
+
SVGASoundManager.init()
232
+
233
+
// Release audio resources
234
+
SVGASoundManager.release()
235
+
236
+
/**
237
+
* Set the volume level, entity is null by default
238
+
* When entity is null, it controls the volume of all audio loaded through SVGASoundManager, which includes the currently playing audio and subsequent loaded audio
239
+
* When entity is not null, only the SVGA audio volume of the instance is controlled, and the others are not affected
240
+
*
241
+
* @param volume The value range is [0f, 1f]
242
+
* @param entity That is, the instance of SVGAParser callback
0 commit comments