2017-02-14 235 views
0

我想获得videojs进度条的当前宽度。我目前这样做获取videojs进度条的宽度

player.getChild('ControlBar').getChild('ProgressControl').currentWidth() 

但是,这给了我一个整数(在我的情况下40),这显然不是px。我想在px的宽度。我该怎么做?这40个字是什么意思?

回答

0

docs

宽度(NUM,skipListeners) - 设置或获取组件的宽度(CSS值)

因此,所有你需要的是这样的:

player.getChild('ControlBar').getChild('ProgressControl').width(); //gets the width of the component 
+0

是给我0 – ApurvG