2011-03-09 84 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