2017-02-14 236 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