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

progress插件 使用hooks实现限制进度条向前seek功能不生效 #1685

Open
CreatBeWorld opened this issue Dec 23, 2024 · 1 comment

Comments

@CreatBeWorld
Copy link

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

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

如何复现问题? How to reproduce the problem?
往右拖动进度条(使用文档代码)
https://h5player.bytedance.com/plugins/internalplugins/progress.html#%E4%B8%80%E4%BA%9B%E4%BD%BF%E7%94%A8hook%E7%9A%84%E5%9C%BA%E6%99%AF

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

实际播放器的表现是? What actually happened?
控制台报错:TypeError: Cannot read properties of undefined (reading 'currentTime')

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

@CreatBeWorld
Copy link
Author

player.usePluginHooks('progress', 'dragstart', (plugin, event, data) => {
// 当点击开始的位置计算出来的时间data.currentTime大于当前播放过的时间,则阻止默认行为
if (data.currentTime > currentTime) {
return false
}
return true
})

player.usePluginHooks('progress', 'drag', (plugin, event, data) =>{
// 当拖拽的位置计算出来的时间data.currentTime大于当前播放过的时间,则阻止默认行为
if (data.currentTime > currentTime) {
return false
}
return true
})
以上回调中 data为undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant