Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

西瓜播放器内部在触发 ready 时,为什么不使用微任务来触发,反而使用 setTimeout 0 呢 #1724

Open
tianjucun opened this issue Mar 11, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request feature proposal Something that the player not implemented
Milestone

Comments

@tianjucun
Copy link

您使用的西瓜播放器版本是多少? What version of xgplayer are you using?
v3 和 v2

您使用的操作系统和浏览器分别是? What OS and browser are you using?

如何复现问题? How to reproduce the problem?

ready 触发后才会展示播放按钮,如果ready事件触发比较慢,按钮也会展示慢

您期望的播放器正常行为是? What did you expect to happen?

是否可以使用微任务来触发 ready 事件呢

比如:Promise.resolve.then(() => { player.emit('ready') })

实际播放器的表现是? What actually happened?

可填写您所在的公司和相关产品业务,方便我们提供更好的技术支持 You can write your company and product which uses xgplayer, for helping us provide better technical support.

@tianjucun tianjucun changed the title 西瓜播放器内部再触发 ready 时,为什么不使用微任务来触发,反而使用 setTimeout 0 呢 西瓜播放器内部在触发 ready 时,为什么不使用微任务来触发,反而使用 setTimeout 0 呢 Mar 11, 2025
@gemxx gemxx added enhancement New feature or request feature proposal Something that the player not implemented labels Mar 28, 2025
@gemxx
Copy link
Collaborator

gemxx commented Mar 28, 2025

这是个非常好的建议。之前可能是为了兼容性考虑,或者没有极致考虑性能。在3.0.22版本会考虑这个建议,非常感谢

@gemxx gemxx added this to the v3.0.22 milestone Mar 28, 2025
@gemxx gemxx self-assigned this Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature proposal Something that the player not implemented
Projects
None yet
Development

No branches or pull requests

2 participants