2011-03-09 97 views
1

HI 我正在開發視頻流應用程序,我需要讓我的應用程序中的進度條(沒有進度對話框)我試圖實現它,我把它的XML文件,並將其設置爲不可見的該onprepared方法,但問題是,進度條放在這使得視頻頂部的視頻尺寸小 我需要讓視頻填充母和進度條也很喜歡的YouTube應用 我該怎麼辦呢?進度條的Android

還我在線流媒體,所以我怎麼能當視頻停止延遲

另一點是我要消失的進度條,當這個視頻的警報canot被現效力顯示緩衝的百分比, ,但我不知道代碼中哪裏應該消失進度條?當此警報出現時?

+0

您可以檢查我的答案[這裏](http://stackoverflow.com/questions/7802645/in-android-how-to-get-the-progress-time -of-the-video-played-video-video) – 2012-01-28 08:06:06

回答

-1

我不確定YouTube如何做他們的菜單,但您可以嘗試一個SlidingDrawer並嵌入您的ProgressBar

-2

看看這段代碼,這可能對你有所幫助。
此代碼還包含必要的評論,以供需要。

public void videoPlayer(String path, String fileName, boolean autoplay){ 

     //get current window information, and set format, set it up differently, if you need some special effects 

     getWindow().setFormat(PixelFormat.TRANSLUCENT); 

     //the VideoView will hold the video 

     VideoView videoHolder = new VideoView(this); 

     //MediaController is the ui control howering above the video (just like in the default youtube player). 

     videoHolder.setMediaController(new MediaController(this)); 

     //assing a video file to the video holder 

     videoHolder.setVideoURI(Uri.parse(path+"/"+fileName)); 

     //get focus, before playing the video. 

     videoHolder.requestFocus(); 

     if(autoplay){ 

      videoHolder.start(); 

     } 

    } 

謝謝...

+0

這並不能回答這個問題! – 2012-02-06 11:37:12