android-videoview

android: onSeekCompleteListener with VideoView

白昼怎懂夜的黑 提交于 2019-11-28 12:26:25
I am using VideoView to play video files. I am using seekTo function in order to play the video from where it has been left off. However, I wanted to do some operations when the seek operation is finished. For that I need to use onSeekCompleteListener; however, onSeekCompleteListener is not supported with VideoView; it can be used with MediaPlayer. My Question is that "is there any way by which I can use onSeekCompleteListener" with VideoView? Thanks alot public class ObservableVideoView extends VideoView { private IVideoViewActionListener mVideoViewListener; private boolean mIsOnPauseMode =

How to capture screenshot or video frame of VideoView in Android

久未见 提交于 2019-11-28 10:19:55
问题 I've tried the following tutorial from this blog ( http://android-er.blogspot.kr/2013/05/get-current-frame-in-videoview-using.html ), which shows how to capture a video frame using MediaMetadataRetriever from a video source. However , it only works if the video is located locally on the phone. Is there a way to capture a video frame while the VideoView is streaming the video over IP? 回答1: I have found a solution to this problem. It appears that the VideoView does not allow this because of low

How to Play RTSP Video in Android?

三世轮回 提交于 2019-11-28 09:49:01
问题 I want to play Youtube Video on VideoView . I have searched very much & find that VideoView Support rtsp URL Video . But I am getting error: My android device is 2.3.5 & using Wifi. My VideoView Code is: final VideoView videoView = (VideoView) findViewById(R.id.VideoView); Button youtube=(Button)findViewById(R.id.button1); final MediaController mediaController = new MediaController(this); mediaController.setScrollBarStyle(DEFAULT_KEYS_DISABLE); mediaController.setPressed(true);

Video blinks once on onCreate of previous fragment

浪尽此生 提交于 2019-11-28 09:31:15
问题 I have created an app for galaxy tab using fragments.I have a videoview on a fragment to paly video from external storage. Here is the code for that fragment - package com.example.hscroll.demo; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.widget

Android: how to play video from assets?

早过忘川 提交于 2019-11-28 08:55:06
I am making an application in which I have to show video from assets folder in a Fragment . Can anyone help me do this? Do I need to use VideoView in XML? Instead of accessing from assests,You must copy the video into your project's res/raw folder. Create raw folder under res folder. It must be in a supported format (3gp, wmv, mp4 ) and named with lower case, numerics, underscores and dots in its filename likewise:video_file.mp4. VideoView view = (VideoView)findViewById(R.id.videoView); String path = "android.resource://" + getPackageName() + "/" + R.raw.video_file; view.setVideoURI(Uri.parse

VideoView memory leak

痞子三分冷 提交于 2019-11-28 08:16:25
问题 Has any of you encountered a similar memory leak? This is how I'm handling the VideoView at the moment @Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.bind(this); Uri videoUri = Uri.parse(String.format("android.resource://%s/%s", getContext().getPackageName(), videoRes)); videoView.setVideoURI(videoUri); videoView.setOnPreparedListener(mp -> { mp.setLooping(true); videoView.start(); }); } This is what I get on LeakCanary Any help appreciated! 回答1: When using

Android::VideoView inside a ScrollView

泄露秘密 提交于 2019-11-28 07:38:32
I have a VideoView that is inside a scrollView. When I scroll the scrollView, the VideoView does not scroll with it. It is like its position is fixed. How can I scroll the VideoView correctly with the scrolling of all other elements in the scrollView? The display is usually divided into two pipelines Frame buffer pipeline - This is is where all your graphics is displayed. All the UI display elements go into this pipline Video buffer pipeline - This is where your video data is diverted to. Now when you declare a surface view you take up some screen space in the UI saying this is where the video

Editing android VideoView frames

左心房为你撑大大i 提交于 2019-11-28 07:37:22
问题 Environment: Nexus 7 Jelly Bean 4.1.2 Problem: I'm trying to make a Motion Detection application that works with RTSP using VideoView. I wish that there was something like an onNewFrameListener videoView.onNewFrame(Frame frame) I've tried to get access to the raw frames of an RTSP stream via VideoView but couldn't find any support for that in the Android SDK. I found out that VideoView encapsulates the Android's MediaPlayer class. So i dived into the media_jni lib to try and find a way to

VideoView black flash before and after playing

允我心安 提交于 2019-11-28 07:34:29
I have a VideoView which I want to use to play a movieclip. I use it like this to play it and it works. VideoView vv = new VideoView(this); vv.setVideoURI(Uri.parse("android.resource://cortex2.hcbj/raw/intro")); setContentView(vv); vv.start(); However I see a black flash just before and after the movie clip. The flash in itself isn't a big problem, but the blackness of it is. The background is white, so if the flash is white, or if it dissapears it will be okay. Today I had the same problem and found a very bad and hacky workaround for this nasty problem: I realized that one can set a

How to keep playing video while changing to landscape mode android

爷,独闯天下 提交于 2019-11-28 07:29:51
I'm playing video (on VideoView ) on portrait mode (not on full screen) and when I change to landscape mode the video stop. When I change it to landscape that video will appear on full screen and will keep playing. Any Suggestion? Vipul Shah all you need to do is add this to activity in AndroidManifest.xml: android:configChanges="orientation" Your Video activity should look something like this. <activity android:name=".VideoPlayerActivity" android:configChanges="orientation" /> If your target API level 13 or higher, you must include the screenSize value in addition to the orientation value as