Git Product home page Git Product logo

Comments (14)

liuleshuai avatar liuleshuai commented on September 21, 2024

image

from vap.

hexleo avatar hexleo commented on September 21, 2024

ios和Android demo没用同一个素材,你播放的是融合动画,需要你自己判断[imgUser]这个tag,然后返回bitmap才能播放。你给的错误里显示,bitmap为null,所以无法播放

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

ios和Android demo没用同一个素材,你播放的是融合动画,需要你自己判断[imgUser]这个tag,然后返回bitmap才能播放。你给的错误里显示,bitmap为null,所以无法播放

也就是说,使用融合动画,必须在fetchImage返回bitmap才行,fetchText也不能返回null,是这样么

from vap.

hexleo avatar hexleo commented on September 21, 2024

也就是说,使用融合动画,必须在fetchImage返回bitmap才行,fetchText也不能返回null,是这样么

是的

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

这个感觉有点不合理呀,比如跑车这个动效,虽然素材里配置了[imgUser]这个tag,但效果上其实并没有显示头像,这种情况按理说客户端返回null也是可以接受的

from vap.

hexleo avatar hexleo commented on September 21, 2024

这里可以优化下,如果返回null还是能正常播放,只不过没有图片显示在mask那。这里强制要求bitmap的目的是希望保证至少有东西可以展示,比如你希望展示头像,但头像没下载回来,你至少要展示一个占位图

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

这里可以优化下,如果返回null还是能正常播放,只不过没有图片显示在mask那。这里强制要求bitmap的目的是希望保证至少有东西可以展示,比如你希望展示头像,但头像没下载回来,你至少要展示一个占位图

如果我用glide去download一个头像资源,在弱网情况下导致头像没有及时下载下来,function1.invoke(BitmapFactory.decodeFile(resource.getAbsolutePath(), options))迟迟没有回调,会有什么问题呢

from vap.

hexleo avatar hexleo commented on September 21, 2024

获取资源的接口 fun fetchImage(resource: Resource, result:(Bitmap?) -> Unit)

回调result() 一定要被调用,不然会永久等待,超时需要业务自己控制回调result

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

能不能提供个超时回调呢。。。大佬

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

这可能是个大坑,毕竟使用vap动效基本都是礼物功能开发,头像资源肯定是拉接口去拿的,可能有人没有及时识别到超时这块的问题

from vap.

hexleo avatar hexleo commented on September 21, 2024

这个问题以前我们讨论过,不同业务有不同的超时逻辑,我们不好统一这个逻辑,所以这个就交由业务自己来决定。
不过我们有个改进的想法,新加一个设置url的接口,组件帮助下载

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

你们自己业务使用的处理超时方式是怎样呢?是指定时间内没下载下来就用占位头像嘛?还是由后台返回头像显示的时间,根据这个字段来就判断处理呢?

from vap.

hexleo avatar hexleo commented on September 21, 2024

图片下载组件有自己的超时机制,比如重试次数,最长等待时间等策略。这些都失败之后,我们会用占位图显示

from vap.

liuleshuai avatar liuleshuai commented on September 21, 2024

好的,了解了,感谢~

from vap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.