|
@@ -50,11 +50,11 @@ class XSvgPlayer : ConstraintLayout {
|
|
|
if (imGiftModel.svga.isNullOrEmpty()){
|
|
|
return
|
|
|
}
|
|
|
- svgaParser!!.let {
|
|
|
+ svgaParser?.let {
|
|
|
LogUtil.d("svgPlayer","xxx--$isPlaying")
|
|
|
it.decodeFromURL(URL(imGiftModel.svga),object:SVGAParser.ParseCompletion{
|
|
|
override fun onComplete(videoItem: SVGAVideoEntity) {
|
|
|
- binding!!.apply {
|
|
|
+ binding?.apply {
|
|
|
val drawable = SVGADrawable(videoItem)
|
|
|
svgaImageView.visibility = View.VISIBLE
|
|
|
svgaImageView.setImageDrawable(drawable)
|
|
@@ -129,15 +129,22 @@ class XSvgPlayer : ConstraintLayout {
|
|
|
nextSvgPlay?.invoke()
|
|
|
}
|
|
|
}
|
|
|
+ },object : SVGAParser.PlayCallback{
|
|
|
+ override fun onPlay(file: List<File>) {
|
|
|
+ LogUtil.d("svgPlayer","onPlay--${file.size}")
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
|
|
|
- handler.postDelayed({
|
|
|
- if (!callbackExecuted){
|
|
|
- playJoinRoomSvga(userJoinRoomBean)
|
|
|
- LogUtil.d("JoinAnimalManager","callbackExecuted")
|
|
|
- }
|
|
|
+ if(handler != null){
|
|
|
+ handler.postDelayed({
|
|
|
+ if (!callbackExecuted && binding?.svgaImageView?.isAnimating == false){
|
|
|
+ playJoinRoomSvga(userJoinRoomBean)
|
|
|
+ LogUtil.d("JoinAnimalManager","callbackExecuted")
|
|
|
+ }
|
|
|
|
|
|
- },7000)
|
|
|
+ },7000)
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|