android-videoview

First Back button press not caught when playing a video android

蹲街弑〆低调 提交于 2020-01-11 12:06:09
问题 I have a weird error that I cant figure out how to fix . I have a video player - a simple videoview that plays a video. Now I ve implemented logic so that when the user presses the back button - it tells him to press the back button again to exit, and when he does it exits. But the problem is the first back press is not caught! I dont know what is causing this. I Press back once nothing happens, I press again and it shows me the toast that says "Please press back again to exit" and on

Android videoview control is not displaying video, only audio is played

百般思念 提交于 2020-01-11 07:23:07
问题 I am trying to play a video from a url in android, for this I am using videoview control in the fragment class, but while playing there is no video output only audio output is there, the video is in .mp4 format. I have done it the following way- VideoView vv; vv=(VideoView)view.findViewById(R.id.videoView1); String src="video path"; Uri uri=Uri.parse(src); getActivity().getWindow().setFormat(PixelFormat.TRANSLUCENT); MediaController mc=new MediaController(getActivity()); mc.setMediaPlayer(vv)

Android: cannot play mp4 video

限于喜欢 提交于 2020-01-11 05:27:04
问题 I'm trying to play mp4 videos streaming from a server using native VideoView , sadly I keep getting a " Cannot play video " error. The weird thing is that the same video plays well on Froyo but will not play on HoneyComb. I tried the same video with MX Video Player (on HC) and it plays just fine. Another major problem is that I cannot re-encode the videos, so I have to use the videos as they are. What is causing the error? How can I play the video? Should I find a way to include a codec

Problem with back button in VideoView

折月煮酒 提交于 2020-01-11 02:30:46
问题 I am having difficulty getting the back button to actually finish my activity when pressed. I am running a very simple videoview, using a progressdialog to show loading dialog and onpreparedlistener, etc etc. simple stuff. Anyways, currently when I press the back button, it will just cancel the progressdialog, and leave a black screen, and pressed again, the progressdialog restarts!!! and then when I click the back button again, it displays an alert dialog, "video cannot be played." very

Android Video View not playing MP4 file on some devices

不羁的心 提交于 2020-01-10 19:29:52
问题 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

Android Video View not playing MP4 file on some devices

醉酒当歌 提交于 2020-01-10 19:29:26
问题 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

Streaming video with videoview

旧巷老猫 提交于 2020-01-10 09:21:17
问题 My code below to streaming video: VideoView vv = (VideoView)this.findViewById(R.id.screen_video); Uri uri = Uri.parse(URL); vv.setVideoURI(uri); vv.start(); It works. But if the URL video's format not support by android phone or pad. It show a dialog, and not show the screen. But it still streaming with black screen. I want to get the error message, and access as an exception. But I don't know how to get it? Another problem is that the streaming may crash cause by low speed wifi. How to check

Releasing mediaplayer and stopping it onPause and onResume gives error in Android

心不动则不痛 提交于 2020-01-07 02:50:31
问题 i m using videoView and mediaplayer but stopping mediaplayer in onPause and onResume gives me error: static MediaPlayer mediaPlayer; private VideoViewCustom videoView; @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detailvideo); context = this; videoView = (VideoViewCustom) findViewById(R.id.videoplayer); //initialize media player mediaPlayer = new MediaPlayer(); videoView.setOnPreparedListener(new

Could't open file on client side

帅比萌擦擦* 提交于 2020-01-06 15:11:02
问题 I am trying to play a video in Android video view. but when i run the code it opens a media player but don't play the video and give me an error message and log cat shows "could't open the file at client side trying server side." here is my code: public class ExercisesActivity extends Activity { VideoView videoView; String videoUrl; public boolean flage = true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity

Could't open file on client side

时光毁灭记忆、已成空白 提交于 2020-01-06 15:10:06
问题 I am trying to play a video in Android video view. but when i run the code it opens a media player but don't play the video and give me an error message and log cat shows "could't open the file at client side trying server side." here is my code: public class ExercisesActivity extends Activity { VideoView videoView; String videoUrl; public boolean flage = true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity