libpag
libpag copied to clipboard
Android端特定PAG文件在4.5.x版本播放抖动
【版本信息】
libpag:4.5.84
【平台信息】
Android 原生
【预期的表现】
能够播放正常
【实际的情况】
- 在4.5.x版本使用PAGView播放特效会抖动,使用PAGImageView播放特效会跳帧
- 在4.4.35版本播放正常
【Demo及附件】
https://github.com/user-attachments/assets/559643ae-f734-47d7-995f-134740e59da0
` class PAGTestActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val root = LinearLayout(this).apply {
orientation = LinearLayout.VERTICAL
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
)
}
setContentView(root)
val playerContainer = FrameLayout(this)
root.addView(
playerContainer,
LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
0,
1f,
)
)
val playerLayoutParams = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
)
val pagView = PAGView(this).apply {
visibility = View.INVISIBLE
playerContainer.addView(this, playerLayoutParams)
}
val pagImageView = PAGImageView(this).apply {
visibility = View.INVISIBLE
playerContainer.addView(this, playerLayoutParams)
}
val controls = LinearLayout(this).apply {
orientation = LinearLayout.HORIZONTAL
}
root.addView(
controls,
LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
)
)
controls.addView(Button(this).apply {
text = "播放 PAGView"
setOnClickListener {
pagImageView.pause()
pagImageView.visibility = View.INVISIBLE
pagView.visibility = View.VISIBLE
pagView.setRepeatCount(0)
pagView.setPath(PAG_ASSET_PATH)
pagView.play()
}
}, LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f))
controls.addView(Button(this).apply {
text = "播放 PAGImageView"
setOnClickListener {
pagView.pause()
pagView.visibility = View.INVISIBLE
pagImageView.visibility = View.VISIBLE
pagImageView.setRepeatCount(0)
pagImageView.setPath(PAG_ASSET_PATH)
pagImageView.play()
}
}, LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f))
}
companion object {
private const val PAG_ASSET_PATH = "assets://pag/3118272043758928896.pag"
}
}
`
这个问题在最近的 release 上修复了吗?
5. 这个问题在最近的 release 上修复了吗?
这个问题应该是修复了一半,某些情况下还是有轻微抖动,还在分析根因;如果您也遇到了上述问题,欢迎您分享下您的情况,也可以用最新的release版本试试,有问题请反馈
6. > 5. 这个问题在最近的 release 上修复了吗?
这个问题应该是修复了一半,某些情况下还是有轻微抖动,还在分析根因;如果您也遇到了上述问题,欢迎您分享下您的情况,也可以用最新的release版本试试,有问题请反馈
@CodeJhF 你好,想问下这个bug有新进展吗
这个问题比较复杂,暂时没有很好的方案彻底修复
8. 这个问题比较复杂,暂时没有很好的方案彻底修复
@CodeJhF 4.4.x版本播放是正常的,想了解下为啥4.5.x会出现这个问题