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

进度条禁用失效 #1401

Open
3246567702 opened this issue Apr 22, 2024 · 4 comments
Open

进度条禁用失效 #1401

3246567702 opened this issue Apr 22, 2024 · 4 comments

Comments

@3246567702
Copy link

3246567702 commented Apr 22, 2024

您使用的西瓜播放器版本是多少? What version of xgplayer are you using?
"xgplayer": "^3.0.10",
"xgplayer-mp4": "3.0.10"

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

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

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

player.value.usePluginHooks('progress', 'drag', (_plugin: any, _event: any, data: any) => {
// return false
// 当拖拽的位置计算出来的时间data.currentTime大于当前播放过的时间,则阻止默认行为
if (data.currentTime > player.value.currentTime && data.currentTime > time) {
return false
}
return true
})
需求:学习视频,不可前拖进度条 ,可以回拖进度条
问题: 若直接前托到达指定范围可以禁止拖动 是ok的
若先后拖在前拖 , 进度条样式是禁止状态, 松手后禁止状态失效 ,依然可以拖动到指定位置

您期望的播放器正常行为是? What did you expect to happen?
禁止后拖进度条

实际播放器的表现是? What actually happened?
先后拖 在前拖 禁用效果失效

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

@3246567702
Copy link
Author

直接 后拖 禁止拖动成功
先触发一次前拖 在后拖 样式禁止 实际禁止失效

@3246567702
Copy link
Author

bug

@All8926
Copy link

All8926 commented May 15, 2024

您使用的西瓜播放器版本是多少? 您使用的西瓜播放器是什么版本? "xgplayer": "^3.0.10", "xgplayer-mp4": "3.0.10"

您使用的操作系统和浏览器分别是? 您使用什么操作系统和浏览器? win11 铬

如何重现问题?

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

player.value.usePluginHooks('progress', 'drag', (_plugin:any, _event:any,data:any) => { // return false //拖拽的位置出来计算的时间data.currentTime大于当前播放过的时间,则阻止默认行为 if (data.currentTime > player.value.currentTime && data.currentTime > time) { return false } return true }) 需求:学习视频,不可前拖进度条,可以拖回进度条条 问题:若直接前托到达指定范围可以禁止拖动 是ok的 若前置拖在前拖 ,进度条样式是禁止状态,松手后禁止状态无效可以 ,依然拖动到指定位置

您期望的播放器的正常行为是?您期望发生什么? 禁止后拖图纸条

实际播放器的表现是? 到底发生了什么? 前置 拖板在前拖取消效果失效

可填写您所在的公司及相关产品业务,方便我们提供更好的技术支持 您可以填写您所在的公司及产品使用的xgplayer,以帮助我们提供更好的技术支持。 漏洞 漏洞

请问解决了吗,我也有这个业务场景

@zhcsyncer
Copy link

基于官方示例添加一个 dragend 事件就完备了

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

3 participants