android-videoview

How to capture/record clip from Video URL in Android and save to phone

喜你入骨 提交于 2019-11-30 18:51:13
In Android, is it possible to record a short clip (ex: an arbitrary 5-10 seconds in the video) from a Video URL (ex: http://www.test.com/video.mp4 )? For example, I'd like to stream a video (from url) in an Activity and allow the ability to capture/record a short clip from it. Perhaps, allow the user to record an arbitrary Start/End time from the video. If so, is there an API to accomplish this? If not, is there an Android library to support this? Please provide a sample code solution for this. Kiril Aleksandrov You can see this link. In short your server has to support downloading. If it does

VideoView on top of SurfaceView

假装没事ソ 提交于 2019-11-30 16:02:37
I try to show a VideoView on top of a SurfaceView . But it isn't visible but reacts on clicks (MediaController appears and the sound plays). The video seems to be played behind the SurfaceView so I also tried to make use of setZOrderMediaOverlay() and/or setZOrderOnTop() but nothing changed When I go to the home screen I see the VideoView for a split second in the fading animation, so it is really there. I tried it with a xml layout and also completely programmatically but nothing works. Here is my activity: public class VideoTest extends Activity { private RelativeLayout mLayout; private

Center Crop an Android VideoView

谁都会走 提交于 2019-11-30 14:35:28
问题 I am looking for something like the CENTER_CROP in ImageView.ScaleType Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop" but for a VideoView. Does anything like this exist? 回答1: You can only achieve this with a TextureView. (surfaceView won't

Playing a video with JavaCV and FFmpeg

為{幸葍}努か 提交于 2019-11-30 13:31:57
So, I'm developing a custom video player for Android but I need to play more than the android supported video files (mp4, 3gp...), like wmv, avi, flv. At this time I do already convert any video type to .mp4 and I'm able to play them after recoding, but I have no idea how can I play those wmv , avi files without recoding them to mp4 video formats. Is there any way I can play any video on Android without recoding them? JavaCV + FFmpeg library already working, just don't know how to do that. By the way, heres the code that I'm using to recode videos: public static void convert(File file) {

Android Video View not playing MP4 file on some devices

拥有回忆 提交于 2019-11-30 13:07:38
In my app I need to play videos from sdcard. Now it works fine on Galaxy S,Galaxy Tab2, But on some chinese tab Like "Giada" It is not working at all. I have 4 different activities to play videos like. First activity plays a menu video which has navigation link to other activity. Problems I am facing. First Video plays properly but looping failed and app closed. If I navigate to other activity to play another video it says "Can't Play Video" and closed Some time it plays same video but not complete and closed app in between. Video Extension: MP4 Resolution : 1024x600 Playing From : SDCard.

Streaming to VideoView only plays on Wifi when using Samsung phones

三世轮回 提交于 2019-11-30 11:51:50
I am using the following library to stream YouTube videos to an Android application. http://code.google.com/p/android-youtube-player/source/browse/trunk/OpenYouTubeActivity/src/com/keyes/youtube/OpenYouTubePlayerActivity.java?r=3 I am successfully able to play videos on HTC and Motorola phones over 3G and Wifi. However, on Samsung Galaxy (Epic 4G) and Samsung Galaxy II phones I am only able to play using Wifi. 3G gives me this error: "Cannot play video. Sorry this video cannot be played." I have tried forcing low quality YouTube streaming, but this did not help. I see in my log that Start() is

Detect if a VideoVIew is buffering

孤街浪徒 提交于 2019-11-30 11:29:21
Does anyone know if it's possible to detect when a VideoView is buffering? I want to show a ProgressDialog when the video is buffering. So far I tried using a OnPreparedListener, but that only works when the video is first loaded. If a video is playing and the user moves the scrub bar to a different point the video is still "prepared" even though it is buffering. I also tried (I know this is awful) an AsyncThread that just busy waits on isPlaying(): private class BufferTask extends AsyncTask<Void, Void, Void> { protected Void doInBackground(Void...voids) { final VideoView videoView =

Resize/Scaling down a YouTubePlayerFragment while video is playing

三世轮回 提交于 2019-11-30 10:46:55
I am trying to replicate the video minimization in the Youtube app as shown here . In order to achieve this, I've tried using the Draggable Panel library. When I ran the sample, I noticed that the video does not scale but rather crops when minimized during playback. When the video is stopped (not paused) and displaying a thumbnail, the view scales as its supposed to. I read on another question that YouTubePlayerView is implemented with a SurfaceView. I also read in the docs that SurfaceView behaves differently from a normal view because of how it punches a hole in the screen. I believe because

How to catch “Sorry, This video cannot be played” error on VideoView

[亡魂溺海] 提交于 2019-11-30 10:44:46
I have a VideoView and I am streaming videos from a remote server. Most of the times It would play the videos very smoothly. But sometimes, it displays an error message "Sorry, This video cannot be played". I have a hunch that this is more on the supported video formats. However, I don't know which are the supported formats. My question is "How can I catch this error (e.g. Prevent the error message from appearing)"? I am using Android 2.2 on this project. Any advice would be greatly appreciated. :) Try using setOnErrorListener : the documentation says If no listener is specified, or if the

Playing encrypted video files using VideoView

大兔子大兔子 提交于 2019-11-30 09:45:36
Does android native "VideoView" video rendering widget plays encrypted video files? And if yes then how to play it and what all the APIs. I have gone through this link i don't find anything related playing encrypted video. Is it that i need to decrypt my video and then pass it to VideoView? VideoView can't play an encrypted video, you have to decrypt it yourself. There are roughly two ways: generate a temporary clear file from the encrypted one, but this has some inconveniences: a delay before to start the playing and an exposure of the contents in clear. use a streaming scheme, with a local