android-videoview

VideoView: Fullscreen on doubleTap

房东的猫 提交于 2019-12-10 15:17:31
问题 Basically, what I want to do in my application is displaying a video. The best tool to achieve this goal seem to be a VideoView. So I used this code: <VideoView android:id="@+id/videoview" android:layout_width="50dip" android:layout_height="50dip"></VideoView> and in my Activity: VideoView videoHolder = (VideoView)findViewById(R.id.videoview); videoHolder.setMediaController(new MediaController(this)); videoHolder.setVideoURI(Uri.parse("android.resource://com.blabla.blabla/" + R.raw.blabla));

Where to put the Video file in android Project

↘锁芯ラ 提交于 2019-12-10 14:42:49
问题 I have a video, I need to know where to place and how to get the path of that video. I know how to add the video form URL, Uri uri=Uri.parse("www.abc.com/myVid.mp4"); videoView = (VideoView) findViewById(R.id.videoView); videoView.setVideoURI(uri); This works fine, but now the video file is in my project, I need to know how to get the path from the folder structure Kindly guide me. Thanks 回答1: You can create asset folder inside your project and store your video in that folder. Then you can

Android VideoView setVideoURI blocks UI thread

耗尽温柔 提交于 2019-12-10 14:26:21
问题 The setVideoURI method of VideoView in Android seems to be blocking the UI thread. As soon as I call this method, the UI get's laggy, even on fast devices. Is there a way to improve performance here? The only other thread with that topic I could find here: https://groups.google.com/forum/#!topic/android-developers/eAAEAEDcksM but it's quite old and doesn't have a satisfying answer. 回答1: What i did was place the setVideoUri() method into a handler with a looper i.e. new Handler(Looper.myLooper

VideoView and Progressive download

冷暖自知 提交于 2019-12-10 13:59:12
问题 In my application I need to provide the user with a preview on a progressive download (video file). In order to achieve this, I'm using VideoView component to show the content of the video (.mp4, .3gpp) which is being downloaded. The problem is that I can't access remote media via http:// or rtsp:// protocol, so I'm forced to use VideoView.setVideoPath to play local copy of the video while downloading. Unfortunately it seems like on Android devices that can't use StageFright framework (so

Rotating the actual videobuffer in Videoview

风格不统一 提交于 2019-12-10 13:06:00
问题 I am currently developing an App specifically for android's GoogleTV devices where using or forcing the orientation of the app to anything other than landscape is not enabled, and will not be enabled in the future from what i have figured, in actuality the app simply crashes upon trying to run setRequestedOrientation() ; Videoviews inherit the positional properties from normal views, Stuff like SetX , SetY and namely SetRotation . You can set the videoview's rotation to 90 degrees, but the

Android back button not working while playing video in VideoView

自闭症网瘾萝莉.ら 提交于 2019-12-10 12:39:09
问题 Android back button is not working while playing the video in VideoView. But it works before playing the video. I am using a custom MediaController for VideoView. I tried using dispatchKeyEvent , its not working. Code of Activity that am using VideoView: mc = new CustomMediaController(mVideo.getContext(), screenIcon) { @Override public void hide(){ } @Override public boolean dispatchKeyEvent(KeyEvent event){ if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { super.hide(); ((Activity)

Usable VideoView source code for Android 2.2

我的梦境 提交于 2019-12-10 11:43:54
问题 I am building my own view for displaying videos, and I would like to base the custom view on the built-in Android VideoView. I'm therefore looking for the source code to VideoView. Most posts I've found on Stackoverflow and elsewhere point to grepcode. Unfortunately, the code on grepcode doesn't seem to be the code documented on developer.android.com and isn't very usable. For example, the VideoView.java on grepcode references an mContext object which is inherited from View, but not available

Android Vitamio library makes apk too big

僤鯓⒐⒋嵵緔 提交于 2019-12-10 10:19:08
问题 I'm trying to use Vitamio library. My apk without Vitamio is about 400k , and when I add Vitamio's library it become more than 11 MB ! I just want to use Vitamio's videoView. Is it any way to customize the library ? I started copying and pasting necessary classes from the library but they are a lot! Please give me some advice and thanks in advance. EDIT: Also I insert the jar file in libs folder instead of adding the library and it's just about 50kb. This time when I run the app, it says in a

android get screenshot of current videoview

一个人想着一个人 提交于 2019-12-10 07:00:53
问题 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()

How to detect when VideoView starts playing (Android)?

余生颓废 提交于 2019-12-10 02:38:54
问题 Here's the problem, I want to change play button to pause button when the video stream starts playing in videoview but I don't know how to detect that event? 回答1: There is a great article about MediaPlayer in here - http://www.malmstein.com/blog/2014/08/09/how-to-use-a-textureview-to-display-a-video-with-custom-media-player-controls/ You can set infoListener on your VideoView setOnInfoListener(new MediaPlayer.OnInfoListener() { @Override public boolean onInfo(MediaPlayer mp, int what, int