2016-07-25 119 views
0

我想添加一個選框到VLCJ媒體播放器。但是,無論何時啓動MediaPlayer,我都無法在任何地方看到Marquee。VLCJ - 字幕沒有顯示

僅供參考我一直跟隨以下鏈接教程:http://capricasoftware.co.uk/#/projects/vlcj/tutorial/marquee

設立JFrame中的代碼可以在下面找到。

final MediaPlayerComponent mediaPlayerComponent = new EmbeddedMediaPlayerComponent(); 
add(mediaPlayerComponent); 

setVisible(true); 

Marquee.marquee() 
.text("Marquee!") 
.size(20) 
.colour(Color.white) 
.opacity(0.7f) 
.position(libvlc_marquee_position_e.centre) 
.location(5,5) 
.timeout(5000) 
.enable() 
.apply(mediaPlayerComponent.getMediaPlayer()); 

mediaPlayerComponent.getMediaPlayer().prepareMedia(WORKING_DIR + "view.mp4"); 

注意:WORKING_DIR是一個靜態String,它包含當前工作目錄路徑。

設置後,當按下播放按鈕時,將調用mediaplayer上的播放方法。

我覺得我已經完成了本教程所要做的一切,並且我所有的在線搜索都沒有結果。如果任何人都可以幫助它,將不勝感激。

回答

0

很可能您必須等到媒體播放器實際開始播放後才能設置選取框。

檢查vlcj源文件中的MarqueeTest是否適合您。

+0

我得出結論,我覺得這是VLC本身的問題。即使直接使用VLC媒體播放器,我也不能僅僅添加一個Marquee就會拋出偏好設置,我不得不添加文字效果,這似乎會變成跑馬燈,然後我可以在偏好設置中更改選取框設置。作爲參考,我正在使用VLC Media Player 2.2.4。最後,我再次重申了覆蓋範例,重新創建了可以啓用/禁用的文本覆蓋 – JayDev