android-videoview

MediaController Positioning - bind to VideoView

核能气质少年 提交于 2019-12-03 12:05:57
There have been a lot of discussions about how to position a MediaController and most answers are to use the setAnchorView -Method. At the first glance this solution seems to work but in my case it doesn't. According to this Post setAnchorView only acts as a reference for initial positioning of the MediaController , but actually creates a new floating Window on top. So what I want is a MediaController that is really bound to a parent View (e.g. VideoView). For example if you have a LinearLayout within a ScrollView and you have to scroll down to your VideoView where the MediaController is

VideoView with Cookies (or Headers)

℡╲_俬逩灬. 提交于 2019-12-03 11:56:10
I am trying to use android.widget.VideoView to stream content. I need to ensure that when using setVideoURI(Uri) that VideoView will include Cookies from prior HttpClient calls. I see in the source that there is setVideoUri(Uri,Headers) but this has a @hide JavaDoc annotation and won't compile. So, anyway to pass cookies or headers with the HTTP requests made by VideoView? Thanks. Extract classes VideoView and Metadata from SDK. Then, you will be able to call setVideoURI(Uri uri, Map<String, String> headers) on your own VideoView class. Note that metadata are not extracted because mp

android videoview error 1, -2147483648

笑着哭i 提交于 2019-12-03 08:43:51
I am getting error while playing video from asset folder and raw folder. MediaPlayer error (1, -2147483648) VideoView error 1, -2147483648. I tried from asset folder as. private String SrcPath = "file:///android_asset/aaa.mp4"; //also tried aaaa.mp3 VideoView vv = (VideoView)findViewById(R.id.videoView1); vv.setVideoPath(SrcPath); MediaController controller = new MediaController(this); controller.setAnchorView(vv); vv.setMediaController(controller); vv.requestFocus(); vv.start(); and for raw folder i used URI as : Uri video = Uri.parse("android.resource://com.usecontentprovider/raw/aaa.mp4");

Video Frame by Frame seeking

帅比萌擦擦* 提交于 2019-12-03 08:33:43
Is there a way to step through a video file frame by frame? I've tried using a VideoView and I've had minor success. I can get the video the step through key frames but not individual frames. I figured this would be the default settings, especially with the way video compression works. Is there a way to override this default behavior or a configuration I can change? The default behaviour in stagefright media framework is always to seek to key frame. (As opposed to the earlier framework's - opencore whose default seeking behaviour was to seek to time.) You cannot do frame by frame seeking by

Android: Why can't I give an onClickListener to a VideoView?

可紊 提交于 2019-12-03 08:02:32
问题 I have written these lines of code: mVideoView = (VideoView) findViewById(R.id.video_view); mVideoView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.v("LOG_TAG, click"); } }); However, when I run my application, the click event is never called. So I wonder, is it impossible to register an OnClickListener on a VideoView? And, if so, why is that the case? 回答1: use VideoView.setOnTouchListener(..) it works for VideoView 回答2: Here's how I solved the pause

Android: VideoView within Fragment only playing audio, not displaying video

孤街醉人 提交于 2019-12-03 03:52:20
I have a fragment that allows users to select from a mixed list of video and image content. When selecting a multimedia item, display is toggled between an ImageView and VideoView depending on the media type. The problem is, when the user selects a video, only the audio is played, and the VideoView remains black. This is the code for displaying video: (Most of the code at the bottom is trial-and-error to see if something is missing to fix this issue) mainVideo.setVisibility(View.VISIBLE); mainImage.setVisibility(View.INVISIBLE); getActivity().getWindow().setFormat(PixelFormat.TRANSLUCENT);

Does Android support scaling Video?

人盡茶涼 提交于 2019-12-03 03:10:17
问题 Using a VideoView is it possible to set a scale factor for Android? By Default the video view resizes itself to fit the encoded resolution of the Video. Can I force Android to render a video into a smaller or larger rect? 回答1: By Default the video view resizes itself to fit the encoded resolution of the Video. VideoView (or the SurfaceView for use with MediaPlayer ) will be the size you tell it to be in your layout. Within that space , the video will play back as large as possible while

Android TextureView vs VideoView Performance

拜拜、爱过 提交于 2019-12-03 03:08:02
问题 I need to be able to rotate a video on screen, so I created a custom TextureView which provides a convenience layer over a MediaPlayer similar to how the current implementation of VideoView does. This Android blog post says the following about TextureView: Because a SurfaceView’s content does not live in the application’s window, it cannot be transformed (moved, scaled, rotated) efficiently. This makes it difficult to use a SurfaceView inside a ListView or a ScrollView. SurfaceView also

Android: Why can't I give an onClickListener to a VideoView?

…衆ロ難τιáo~ 提交于 2019-12-02 21:34:42
I have written these lines of code: mVideoView = (VideoView) findViewById(R.id.video_view); mVideoView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.v("LOG_TAG, click"); } }); However, when I run my application, the click event is never called. So I wonder, is it impossible to register an OnClickListener on a VideoView? And, if so, why is that the case? newdev use VideoView.setOnTouchListener(..) it works for VideoView Here's how I solved the pause/play of VideoViews using onTouch: // Class variables private boolean bVideoIsBeingTouched = false; private

how to play .3GP video file in android

旧巷老猫 提交于 2019-12-02 20:57:54
问题 HI i want to play a .3GP video file in android phone. i tried below code but it shows cant play video.so please tell me what i will do This is my code public class VideoPlay extends Activity { private String path ; private VideoView mVideoView; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.videoplay); path="http://www.boodang.com/api/videobb/101009_Pure.3gp"; mVideoView = (VideoView) findViewById(R.id.video); if (path == "") { // Tell the user