2013-01-14 133 views
2

使用FLVPlayback字幕組件我想將字幕文本移動到y位置的某些部分。這在AS3中可能嗎?FLVPlaybackCaptioning +自定義位置

當解析字幕時,我所有的自定義參數都會被忽略,並且使用某種字符來包裝特定的部分將無法執行,因爲我無法在運行時更改文本。

原因是,在我的視頻流中有一些帶有文本內容的框,我不希望字幕放在頂部,而是放在頂部用於閱讀目的。

我正在考慮做一個自己的手動字幕功能或自定義閃光燈提示點,我可以訪問,但想知道是否有人以前這樣做過。

+0

您是否找到解決問題的方法? – Mattias

回答

0

這樣的事情就可以做到。我發現autoLayout已經被字幕xml覆蓋,所以我強迫它每一次「改變」都是false。

public function Init() : void 
{ 
    // captions 
    _captions = new FLVPlaybackCaptioning(); 
    _captions.autoLayout = false; 
    _captions.flvPlayback = _video; 
    _captions.addEventListener(CaptionChangeEvent.CAPTION_CHANGE, onCaptionChange); 
    _captions.source = "mySubs.xml"; 

    addChild(_captions); 
} 

private function onCaptionChange(pEvent : CaptionChangeEvent) : void 
{ 
    if(!_captions.captionTarget) 
     return; 

    _captions.autoLayout = false; // force autoLayout 
    _captions.captionTarget.y = 666; // position of choice 
}