android-videoview

Android VideoView Playback Controls Show “Play” Initially Instead of “Pause” Even Though File is Already Playing

99封情书 提交于 2020-01-03 09:44:14
问题 Good afternoon/morning! Hoping someone could help me out with a small problem I'm having. I'm playing a remote .mp3 file using a VideoView and a custom MediaController . My MediaController looks like this: public class MyMediaController extends MediaController { public MyMediaController(Context context) { super(context); } // Do nothing on the overridden hide method so the playback controls will never go away. @Override public void hide() { } // Override the dispatchKeyEvent function to

Android VideoView not playing Portrait Orientation

大憨熊 提交于 2020-01-03 07:08:08
问题 THE PLATFORM: Developing in Eclipse using Android SDK 16. THE PROBLEM: I have a VideoView element that is supposed to fill the entire screen in 480x800 (PORTRAIT ORIENTATION) and it plays fine, but will not orient to portrait. It sticks in landscape mode and the aspect ratio is skewed to fit that way. WHAT I HAVE ATTEMPTED: using android:screenOrientation="portrait" in manifest using android:orientation="vertical" in the container and the VideoView itself using setRequestedOrientation

Android VideoView not playing Portrait Orientation

独自空忆成欢 提交于 2020-01-03 07:07:04
问题 THE PLATFORM: Developing in Eclipse using Android SDK 16. THE PROBLEM: I have a VideoView element that is supposed to fill the entire screen in 480x800 (PORTRAIT ORIENTATION) and it plays fine, but will not orient to portrait. It sticks in landscape mode and the aspect ratio is skewed to fit that way. WHAT I HAVE ATTEMPTED: using android:screenOrientation="portrait" in manifest using android:orientation="vertical" in the container and the VideoView itself using setRequestedOrientation

how to play video from sub folder of assets folder in android

好久不见. 提交于 2020-01-03 03:23:06
问题 I am trying to play video from sub-folder's of Assets folder. I have created one folder xyz in assets folder. this is my code: String uriPath = "android.resource://"+ getPackageName() + "/assets/xyz/"+"age.mp4"; videoView.setVideoURI(Uri.parse(uri)); // videoView.setMediaController(new MediaController(this)); videoView.setMediaController(null); videoView.requestFocus(); videoView.start(); But it is giving me error E/MediaPlayer(11068): error (1, -2147483648) also tried this code: public void

Encoding video for Android

孤街浪徒 提交于 2020-01-03 00:34:08
问题 How do I properly encode video for Android? I've seen the supported media formats but I don't really know where to start with producing a video with those settings. I'm not yet streaming these videos. These are just for local playback. What's the correct process for encoding videos to maximize compatibility across Android devices? 回答1: Here's the line that I use to convert videos suitable for Android. I've had good luck playing it on all devices running Android >= 4. Note that this matched

How to solve MediaPlayer error (100, 0) in nexus 5?

我与影子孤独终老i 提交于 2020-01-02 19:14:07
问题 I am getting the following error in nexus 5 when I play the video for 5-10 minutes.This error is not occurring always.It is working in nexus 9 and samsung duos. 10-08 09:03:14.033 14588-14599 W/AudioSystem﹕ AudioFlinger server died! 10-08 09:03:14.033 14588-14778 W/IMediaDeathNotifier﹕ media server died 10-08 09:03:14.043 14588-14778 E/MediaPlayer﹕ error (100, 0) 10-08 09:03:14.043 14588-14588 D/AndroidRuntime﹕ Shutting down VM 10-08 09:03:14.043 14588-14588 W/dalvikvm﹕ threadid=1: thread

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

十年热恋 提交于 2020-01-02 04:11:11
问题 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

How to display video in VideoView in the center of the screen?

断了今生、忘了曾经 提交于 2020-01-01 19:22:11
问题 I am creating ViewPager with two VideoViews . On sliding pages, video on current page start playing. One problem: how to display video in VideoView in the center of the screen ? Here is my code, MainActivity.java: public class MainActivity extends Activity{ private class MyViewPagerAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener { private Vector<View> pages; private ViewGroup myContainer; private int currentPageId; private boolean flag; public MyViewPagerAdapter(Context

Support different video sizes for Android

*爱你&永不变心* 提交于 2019-12-31 05:18:14
问题 I am creating an App that is playing a video (as splash screen) but I am confused which are the correct sizes for each different screen. I have already checked a lot of answers (this link was indeed helpful but still not clear) and official documentations but it is still confusing me. I created the following folders: raw-ldpi, raw-mdpi, raw-hdpi, raw-xhdpi, raw-xxhdpi, raw-xxxhdpi BUT what are the correct video sizes for each of the above different folder? For example for raw-ldpi what are

Back button won't work when VideoView is playing video

﹥>﹥吖頭↗ 提交于 2019-12-31 00:59:07
问题 I have a VideoView in one of my Activities and if I try to press the back Button it doesn't take me to the previous Activity and it doesn't give any error messages in the log cat either. I have tried overriding the onBackPressed() method and I have tried calling the prev Activity using an Intent , but even then the back Button didn't do anything. This problem only occurs when the video is playing and even after it is finished playing. The only time the back Button works is before the video