2014-09-11 52 views
0

我已經成功創建了帶有視頻標籤和JavaScript命令的網頁,並在其中顯示的視頻中添加了字幕。在html視頻文本中縮小字幕

但是,默認模式會製作相當大的字幕,並且它們在視頻上也很高。 我想讓它們變小一點,變小一點。

我的代碼通常是這樣的:

cue1 = new TextTrackCue(33.633,35.193,"Anita and Zoe stare at the candles."); 
cue1.id = '1'; 

myTextTrack.addCue(cue1); 

,或者,如果我想提出一個回車,在字幕,我這樣做:

cue2 = new TextTrackCue(47.397,52.409,"Why is there so much care" + String.fromCharCode(10) + "Should we all beware?"); 
cue2.id = '2'; 
myTextTrack.addCue(cue2); 

回答

0

沒有短最終的答案。但是你可以嘗試::cue pseudoelement選擇:

::cue { 
    font-size: 60%; 
} 

另外,你應該(如果可用),而不使用TextTrackCue構造的VTTCue構造。你可以做這樣的事情:

if(!window.VTTCue){ 
    window.VTTCue = window.TextTrackCue; 
} 

這裏是一個演示:http://www.jsfiddle.net/trixta/QZJTM/