seekbar

使用VideoView播放视频

女生的网名这么多〃 提交于 2019-12-28 08:17:31
VideoView,用于播放一段视频媒体,它继承了SurfaceView,位于"android.widget.VideoView",是一个视频控件。 既然是播放一段视频,那么不可避免的要涉及到一些开始、暂停、停止等操作,VideoView也为开发人员提供了对应的方法,这里简单介绍一些常用的: int getCurrentPosition():获取当前播放的位置。 int getDuration():获取当前播放视频的总长度。 isPlaying():当前VideoView是否在播放视频。 void pause():暂停 void seekTo(int msec):从第几毫秒开始播放。 void resume():重新播放。 void setVideoPath(String path):以文件路径的方式设置VideoView播放的视频源。 void setVideoURI(Uri uri):以Uri的方式设置VideoView播放的视频源,可以是网络Uri或本地Uri。 void start():开始播放。 void stopPlayback():停止播放。 setMediaController(MediaController controller):设置MediaController控制器。 setOnCompletionListener(MediaPlayer

Android--使用VideoView播放视频

三世轮回 提交于 2019-12-28 08:17:07
前言   之前有讲过如何使用SurfaceView配合MediaPlayer播放视频,其实Android还为开发人员提供了另外一种更简单的播放视频媒体的方式,那就是VideoView,本篇博客就来讲讲VideoView如何播放视频,最后将以一个简单的Demo演示。   本篇博客的主要内容如下: VideoView VideoView简单的Demo MediaController MediaController简单的Demo VideoView   VideoView,用于播放一段视频媒体,它继承了SurfaceView,位于"android.widget.VideoView",是一个视频控件。   既然是播放一段视频,那么不可避免的要涉及到一些开始、暂停、停止等操作,VideoView也为开发人员提供了对应的方法,这里简单介绍一些常用的: int getCurrentPosition():获取当前播放的位置。 int getDuration():获取当前播放视频的总长度。 isPlaying():当前VideoView是否在播放视频。 void pause():暂停 void seekTo(int msec):从第几毫秒开始播放。 void resume():重新播放。 void setVideoPath(String path):以文件路径的方式设置VideoView播放的视频源

Android--使用VideoView播放视频

可紊 提交于 2019-12-28 08:16:52
前言   之前有讲过如何使用SurfaceView配合MediaPlayer播放视频,其实Android还为开发人员提供了另外一种更简单的播放视频媒体的方式,那就是VideoView,本篇博客就来讲讲VideoView如何播放视频,最后将以一个简单的Demo演示。   本篇博客的主要内容如下: VideoView VideoView简单的Demo MediaController MediaController简单的Demo VideoView   VideoView,用于播放一段视频媒体,它继承了SurfaceView,位于"android.widget.VideoView",是一个视频控件。   既然是播放一段视频,那么不可避免的要涉及到一些开始、暂停、停止等操作,VideoView也为开发人员提供了对应的方法,这里简单介绍一些常用的: int getCurrentPosition():获取当前播放的位置。 int getDuration():获取当前播放视频的总长度。 isPlaying():当前VideoView是否在播放视频。 void pause():暂停 void seekTo(int msec):从第几毫秒开始播放。 void resume():重新播放。 void setVideoPath(String path):以文件路径的方式设置VideoView播放的视频源

VideoView播放视频——Android

喜你入骨 提交于 2019-12-28 08:16:39
Android为开发人员提供了一种简单的播放视频媒体的方式,那就是VideoView,本篇博客就来讲讲VideoView如何播放视频,最后将以一个简单的Demo演示。 VideoView   VideoView,用于播放一段视频媒体,它继承了SurfaceView,位于"android.widget.VideoView",是一个视频控件。   既然是播放一段视频,那么不可避免的要涉及到一些开始、暂停、停止等操作,VideoView也为开发人员提供了对应的方法,这里简单介绍一些常用的: int getCurrentPosition():获取当前播放的位置。 int getDuration():获取当前播放视频的总长度。 isPlaying():当前VideoView是否在播放视频。 void pause():暂停 void seekTo(int msec):从第几毫秒开始播放。 void resume():重新播放。 void setVideoPath(String path):以文件路径的方式设置VideoView播放的视频源。 void setVideoURI(Uri uri):以Uri的方式设置VideoView播放的视频源,可以是网络Uri或本地Uri。 void start():开始播放。 void stopPlayback():停止播放。

Android SeekBar setOnSeekBarChangeListener

本小妞迷上赌 提交于 2019-12-28 05:56:08
问题 I'm wondering about the behavior of the android SeekBars OnSeekBarChangeListener. In particular, is the onProgressChanged-method notified only for the first and the last touch on the seekbar? I'm trying to refresh a TextView that should show the current progress of the SeekBar. But the TextView is just updated on first touch and last touch. Debugging this confirms my assumption that this method is called just twice :( What I would like to have is that the TextView shows every progress change

Draw custom Seekbar on Android

僤鯓⒐⒋嵵緔 提交于 2019-12-25 19:54:49
问题 I know there are a lot of libraries about that on GitHub and several questions on stack overflow about this argument. But no of those fit my needs. I just need to draw something like this : The progress line must be yellow with no thumb. Thank you in advance. 回答1: You can use something similar to what I explained here. Just use a rectangle instead of a circle. Use on-size changed to compute the actual size of the rectangle and have a method to change the percentage and re-compute your

Draw custom Seekbar on Android

夙愿已清 提交于 2019-12-25 19:54:46
问题 I know there are a lot of libraries about that on GitHub and several questions on stack overflow about this argument. But no of those fit my needs. I just need to draw something like this : The progress line must be yellow with no thumb. Thank you in advance. 回答1: You can use something similar to what I explained here. Just use a rectangle instead of a circle. Use on-size changed to compute the actual size of the rectangle and have a method to change the percentage and re-compute your

Android SeekBar [ProgressBar] style - how to set custom background drawable

你离开我真会死。 提交于 2019-12-25 11:48:08
问题 I want to make seekbar like this: http://img687.imageshack.us/img687/2371/volumec.png The thing is, that I ve already found customizing seekbars over here http://groups.google.com/group/android-developers/browse _thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don t know how to manage that. Would you be so kind some of you, I`ll appreciate it very much. Thanks in advance, wishing all the best! this is my resources style.xml file

using 2 seekbars in the same activity

人盡茶涼 提交于 2019-12-25 09:29:54
问题 I have 2 seekbars A and B and i have 2 textviews C and D. A edits the value of C when moved and B edits the value of D when moved. My code works fine. However I want it so that when the user is using A then seekbar B becomes disabled and likewise when seekbar B is being used by the user A becomes disabled. The way the seekbars become undisabled is when a user clicks on it to use it again. So if i were using seekbar A then B would be disabled then if i touched seekbar B it would be enabled and

Android resizing SeekBar thumb width from maximum value

≯℡__Kan透↙ 提交于 2019-12-25 02:16:36
问题 Is there a function (or an XML tag) which allows to change the width of thumb in the seekBar dynamically , when the maxValue is changed . For example if the maxValue == 2 the Thumb takes the half of the whole Seekbar , then if maxValue is 3 , it takes the 1/3-th of the width , and so on . 回答1: The SeekBar thumb can only be set in XML, not dynamically. What you are looking for is akin to a scrollbar. Views which are scrollable, like ListView, have these built in, so you don't need to do