android-videoview

Android: What video format/encoding should I use to support most of the android devices

时光总嘲笑我的痴心妄想 提交于 2019-12-05 20:59:24
I have a collection of video clips which user should be able play from inside my app (not external video player). I am using VideoView with MediaController. Everything works as expected on my Desire HD and Nexus S (both running Android 2.3.3). However they won't play on order devices. I get "Sorry, this video cannot be played" error message. All videos are mp4, encoded with H.264, 720w/480h, 25fps . I have also used H.263(3gp) but with no luck. I want to support as many Android devices as possible. At least starting from 2.1 Does any one had the same problems? What videos are you using in your

VideoView SeekTo working abnormally on different devices - Android

你离开我真会死。 提交于 2019-12-05 20:20:47
I am using this code on video view to seek to custom position but it is working fine on samsung devices but on sony devices the video seeks to the start position(beginning) I want to get video to the position where it was last time paused Creating Video View: VideoView mVideoPlayer.setVideoPath(ViDpath); MediaController mCd = new MediaController(this); mVideoPlayer.setMediaController(mCd); mVideoPlayer.requestFocus(); Pause and Play works fine: mVideoPlayer.pause(); mVideoPlayer.start(); This works abnormally: mVideoPlayer.seekTo(anyCustomPosition); Testing: I tested it further on different

How to play rtmp video in videoview in android?

ぐ巨炮叔叔 提交于 2019-12-05 17:37:04
I want to play rtmp video in videoview , so how i can play rtmp video in my app? String host = "rtmp://example.com"; String fileName = "www.mp4"; int port = 1935; Connection string rtmp://example/cfx/st How i can play video ? Regards, girish Colin Pickard You can do it using Flash (at least for devices with 2.2+ android and Flash-supported CPUs) http://www.wowza.com/forums/showthread.php?13087-Android-RTMP-Live-Streaming The easiest way to play an audio RTMP stream in Android 来源: https://stackoverflow.com/questions/10412305/how-to-play-rtmp-video-in-videoview-in-android

How Do I Play Video in ListView like Instagram and Vine?

五迷三道 提交于 2019-12-05 16:05:20
问题 I'm new to android development and I am trying to play multiple videos in a listview. Currently, each listview row item is a VideoView. This approach has not worked as the VideoViews act abnormally when I begin to scroll. I've researched here, here, here and discovered that VideoViews and TextureViews don't work well within ListViews and ScrollViews. How are apps like vine and instagram able to play videos in listviews? Any help is greatly appreciated? 回答1: Although the answer is late but i

Android VideoView live tv stream (HLS)

北战南征 提交于 2019-12-05 14:56:54
I'am trying to develop app for tv streaming (HLS). Using code below I tested stream on 2.3.3, 3.0 and 4.0.1 version Android devices, but encountered several problems. On Android 2.3.3 stream plays for >1 minute and then just stops. On Android 3.0 it plays well and on Android 4.0.3 it displays message 'This file cannot be played' (if I remember correctly). So my question would be: How can I play stream on ether of these devices, without having stream playing problems? Or where can I read more about solutions to these problems (tried to search but found nothing useful)? Code in Main_Activity:

How to take a screenshot of Android's VideoView from rtsp streaming?

前提是你 提交于 2019-12-05 12:19:37
v = new VideoView(this){ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(vWi,vHe); } }; v.setVideoURI(Uri.parse("rtsp://xxxxxxxxx")); v.requestFocus(); v.start(); How to take a screenshot? I try take screenshot, but picture is black. Umer Kiani This is how it goes to capture screenshot of current frame in videoview public class MainActivity extends Activity { MediaMetadataRetriever mediaMetadataRetriever; MediaController myMediaController; VideoView myVideoView; String viewSource = "/storage/sdcard0/DCIM/100MEDIA/VIDEO0009.mp4"; @Override

android get screenshot of current videoview

别来无恙 提交于 2019-12-05 12:18:29
I've seen a lot of old questions about this, maybe now there are some solutions. I want to take a screenshot of the current frame of my videoview. Videoview shows a real-time video using a rtsp-stream. I try to take bitmap, but it's always black public static Bitmap loadBitmapFromView(View v) { Bitmap b = Bitmap.createBitmap(v.getLayoutParams().width , v.getLayoutParams().height, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height); v.draw(c); return b; } EDIT : MediaMetadataRetriever does not work with stream url, maybe

How to automatically play video in listview on android app

倖福魔咒の 提交于 2019-12-05 09:41:11
I want to play video in listview from online server as like VINE app. And plays only one video at a time.But videoview cann't show in listview. I can view all others like text, links. But VideoView cann't show in listview row. show all without videoview. when try without listview it works fine and play video from online my listview adapter code snippet like this: mViewHolder.mVideoView.setVisibility(View.VISIBLE); MediaController mComtroller = new MediaController(mContext); mViewHolder.mVideoView.setMediaController(mComtroller); mViewHolder.mVideoView.setVideoURI(Uri.parse("myLink"));

How to start(play) video once buffer reaches 20% in android video view

南楼画角 提交于 2019-12-05 09:14:47
I have a video view to play video by using url which comes from server. I want video to be played once buffering reaches 20% . So i have added listener for setOnBufferingUpdateListener to mediaplayer like below. Uri video = Uri.parse(videoUrl); videoView.setVideoURI(video); videoView.requestFocus(); videoView.setOnPreparedListener(new OnPreparedListener() { public void onPrepared(MediaPlayer mp) { mp.setOnBufferingUpdateListener(Activity); progressVideoView.setVisibility(View.GONE); videoView.start(); } }); videoView.setOnErrorListener(new OnErrorListener() { @Override public boolean onError

Calling MediaPlayer.PrepareAsync from VideoView

时光怂恿深爱的人放手 提交于 2019-12-05 08:30:24
I am trying to implement a playlist of videos so they have a smooth transition from one video to the next. The mediaPlayer object has a prepareasync() method that would seem to prebuffer the video so it's ready to play. How do I invoke the prepareasync method from the VideoView object? The examples I found for mediaPlayer either don't use VideoView and seem to create the surface from scratch. Or the examples use mediaPlayer as return parameter on videoview eventlisteners which seem to occur only after the videoview.play(). I would like have access to videoview's mediaplayer before invoking the