bytedance / xgplayer

A HTML5 video player with a parser that saves traffic
https://h5player.bytedance.com/
MIT License
8.06k stars 845 forks source link

进度条禁用失效 #1401

Open 3246567702 opened 3 months ago

3246567702 commented 3 months ago

您使用的西瓜播放器版本是多少? 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 commented 3 months ago

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

3246567702 commented 3 months ago

bug

All8926 commented 2 months ago

您使用的西瓜播放器版本是多少? 您使用的西瓜播放器是什么版本? "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 commented 2 months ago

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

shawyw commented 1 month ago

以前的版本有allowSeekPlayed 现在没有了