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

Commit

Permalink
fix bug:
Browse files Browse the repository at this point in the history
repair audio error it not  callback
         audiosFileMap.size==0  soundPool?.load will not go
         setOnLoadCompleteListener will not run
         completionBlock  not  run  cannot callback

commit info:
an error svga
deal with code
  • Loading branch information
zhusiliang committed Jul 27, 2021
1 parent 3c8b653 commit fc2d35e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Binary file added app/src/main/assets/jojo_audio.svga
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public void onClick(View view) {

private void loadAnimation() {
SVGAParser svgaParser = SVGAParser.Companion.shareParser();
String name = this.randomSample();
// String name = this.randomSample();
//asset jojo_audio.svga cannot callback
String name = "jojo_audio.svga";
Log.d("SVGA", "## name " + name);
svgaParser.setFrameSize(100, 100);
svgaParser.decodeFromAssets(name, new SVGAParser.ParseCompletion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ class SVGAVideoEntity {
}
setupSoundPool(entity, completionBlock)
val audiosFileMap = generateAudioFileMap(entity)
/**
* repair audio error it not callback
audiosFileMap.size==0 soundPool?.load will not go
setOnLoadCompleteListener will not run
completionBlock not run cannot callback
*/
if(audiosFileMap.size==0){
run(completionBlock)
}
this.audioList = entity.audios.map { audio ->
return@map createSvgaAudioEntity(audio, audiosFileMap)
}
Expand Down

0 comments on commit fc2d35e

Please sign in to comment.