android-videoview

Android getDuration for video gets different value on different versions

别说谁变了你拦得住时间么 提交于 2019-12-11 14:49:45
问题 I'm trying to play the following video on all devices. The problem is that with Android 4.1.2 the getDuration is 1476000 AKA 24:36 minutes. With Android 5.0.2 the getDuration returns 1546347 AKA 25:46 minutes. So on Android 4.1.2 the real problem is that the video continues to play after "being finished". But the reality is that the video should have a getDuration like on Android 5.0.2. Does anyone here have any clue? To see the UI problem: http://i.stack.imgur.com/tRAg5.jpg Code below:

Error Codes Media Player syntax and definition

主宰稳场 提交于 2019-12-11 14:19:59
问题 I cannot find any documentation on error codes with regard to Android. I am putting together an app that seemed to be working on a lower level API setup but not on a higher one. The error occurs when trying to play an audio file and like I said it all worked in a lower version. The error code I see is in the log are: MediaPlayer info/warning (1, 32) MediaPlayer Info (1,32) MediaPlayer info/warning (1,26) MediaPlayer Info (1,26) MediaPlayer error(351, -4) MediaPlayer Error(351,-4) VideoView

Android Mediaplayer throws an error while playing a youtube video with video view

被刻印的时光 ゝ 提交于 2019-12-11 14:00:39
问题 Here is the code for playing a url with vedio view String urlVideo = "http://www.youtube.com/cp/vjVQa1PpcFPLrLo9hkR90zKx_XHP5kMNaNb-_bE3v0s="; VideoView video = (VideoView) findViewById(R.id.videoView1); Log.d("You", urlVideo); video.setVideoURI(Uri.parse(urlVideo)); MediaController mc = new MediaController(this); video.setMediaController(mc); video.requestFocus(); video.start(); mc.show(); It throws error and can not start the video Here is the logcat message ERROR/MediaPlayer(1765): error

Unable to pause/forward/backward video using mediacontroller in android

无人久伴 提交于 2019-12-11 12:19:34
问题 Iam unable to pause / forward / backward the video using MediaController and it is happening only in the LG devices. Below is the code which am using and it is working in the rest of all the devices : VideoView video=(VideoView)findViewById(R.id.video); MediaController mediaController = new MediaController(this); mediaController.setAnchorView(video); video.setMediaController(mediaController); video.setVideoURI(uri); video.start(); Please help me on this. 回答1: Finally I found a solution... In

Video does not resume in VideoView

為{幸葍}努か 提交于 2019-12-11 11:53:52
问题 Many posts are there for this issue.But the solutions are available for when the activity gets paused. I tried all it doesn't work. My problem is little bit different I have a videoview and when the user clicks the videoview ,video will be paused and if he clicks again it should be resumed. My code snippet in ontouchlistener is, videopath = getIntent().getStringExtra("path"); imageView = ((VideoView) findViewById(R.id.imageView)); imageView.setVideoPath(videopath); imageView.start();

does onDraw in a surfaceview container causes video to be invalidated?

非 Y 不嫁゛ 提交于 2019-12-11 11:23:34
问题 I have a video view . This view is contained inside a custom FrameLayout called VideoStructure , where I can put also a channel logo or things alike. Under normal conditions, the video is hardware accelerated, so the view is (i suppose) really a transparent "black hole", while the video is decoded & rendered by the relevant hardware. My question is, if I override draw() in the Video View's container (the VideoStructure extends FrameLayout in the image) to draw some stuff (ie. the circle in

Smooth Scrubbing video in Android

自作多情 提交于 2019-12-11 11:12:31
问题 I am trying to achieve smooth video scrubbing with Android VideoView . The seekTo method of MediaPlayer is not doing exactly what i want. It does not exactly seek to millisecond i passed in it, it actually plays from/jumps to the nearest position, not the exact I seeked to. Also the frames are showing with a large gaps. Not the exact frame for millisecond. I came on searching around and found that SEEK_CLOSEST_SYNC can only seek to the nearest sync frame not the EXACT. It depends on the way

How to maintain aspect-ratio when playing RTSP streaming video in Android?

≡放荡痞女 提交于 2019-12-11 11:03:11
问题 I have a streaming RTSP video link which I am playing with the help of VideoView. In the portrait mode the Video resolution and aspect ratio is perfect. But when I try switching to the landscape mode the video stretches and looks elongated. This distorts the quality to a great deal. Any tips of how to make the videoview to maintain the same aspect ratio in both orientation modes? If i need to write my own media player extending the VideoView .. How exactly should I override the onMeasure(...)

Can i loop multiple videos stored on raw folder in videoview?

无人久伴 提交于 2019-12-11 10:45:30
问题 What im trying to achieve is to play multiple videos stored on raw folder to be played on loop and sequentially one after the other? I can play only one in loop in videoview but cant access other ones. Thanks in advance. Here is my videoview. private VideoView myVideo1; String path = "http://192.168.0.22/output/files/video/"; Uri uri=Uri.parse(path); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

RTSP stream will not play with VideoView; No content provider error

寵の児 提交于 2019-12-11 10:41:38
问题 I want to open RTSP link in my android application. I used video view for it but when I run the application I receive the error "no content provider". I've read the mass of threads and tuturials but nowhere can I find the answer why. Everything is ok when I open this link via VLC software. Btw. I have this stream from my raspberry pi camera. 来源: https://stackoverflow.com/questions/30572745/rtsp-stream-will-not-play-with-videoview-no-content-provider-error