bytedance / xgplayer

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

播放器时是否支持自义定进度条? #1516

Open maxid opened 3 days ago

maxid commented 3 days ago

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

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

如何复现问题? How to reproduce the problem? 使用播放器实现24小时录像回放,每5分钟一个文件

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

image

能否开放实现自定义虚拟进度条的API(类似自定义控件的render机制,传入真实的进条属性,返回计算后的进条属性,主要为进度条位置(当时播放时间),进度条总时长度(总播放时间))

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

image

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

gemxx commented 1 day ago

@maxid 可以看一下progress插件中的这部分代码,然后在播放器配置中自定义一下进度条时长 customDuration

const player = new Player({
  customDuration: xxx
})

// 设置一下currentTime的偏移
player.offsetCurrentTime = xxx