android-videoview

Android VideoView - Detect point of time in video

笑着哭i 提交于 2019-12-06 03:10:58
问题 I am using a VideoView to display a video. I am using setOnPreparedListener and setOnCompletionListener to do stuff before and after the video starts and ends. I was wondering how I could go about detecting some point of time in the video. For eg, say I want to write log to a file when the video has played for 10s. How can I detect the 10s mark? Thanks Chris 回答1: Step #1: Use postDelayed() or something to get control every second or so. Step #2: Check getCurrentPosition() and see if it is

VideoView force close on Micromax Canvas magnus

a 夏天 提交于 2019-12-06 02:49:49
问题 Why VideoView force closes on Micromax Canvas magnus ? java.lang.StringIndexOutOfBoundsException: length=11; regionStart=0; regionLength=-1 at java.lang.String.startEndAndLength(String.java:583) at java.lang.String.substring(String.java:1464) at android.widget.VideoView.openVideo(VideoView.java:407) at android.widget.VideoView$6.surfaceCreated(VideoView.java:730) at android.view.SurfaceView.updateWindow(SurfaceView.java:606) at android.view.SurfaceView.access$000(SurfaceView.java:88) at

How To toggle FullScreen with VideoView Android

与世无争的帅哥 提交于 2019-12-06 02:47:41
问题 I am using video view for live streaming, and I want to make this VideoView to toggle fullscreen and back to small screen like MXPlayer or YouTube players do without stopping the streams. <ScrollView android:id="@+id/scrollview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/ad_container" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:background="@android:color/transparent" > <RelativeLayout android

Issue displaying thumbnail image in VideoView

China☆狼群 提交于 2019-12-06 02:12:43
I'm using VideoView for a web video, and I also have a bitmap object contains the corresponding thumbnail image. Now how should I set the bitmap to the VideoView for displaying the thumnail? I'm using videoView.setBackgroundDrawable(new BitmapDrawable(getResources(), bitmap)); But then when I play this video, the video doesn't show, instead it always show this static thumbnail image. Any hints would be appreciated. Thanks. VideoView is a subclass of SurfaceView , which has some special behaviors in terms of its display. SurfaceView contents are actually drawn in a window underneath the view

I want to get the video size in MB from videoview from internet path

99封情书 提交于 2019-12-06 01:24:13
I'm trying to get the video file size and display it in the layout before starting the video. I have tried many thing but it wont work video_player_view = (VideoView) findViewById(R.id.videoView2); media_Controller = new MediaController(this); dm = new DisplayMetrics(); this.getWindowManager().getDefaultDisplay().getMetrics(dm); int height = dm.heightPixels; int width = dm.widthPixels; try { video_player_view.setMinimumWidth(width); video_player_view.setMinimumHeight(height); } catch (Exception e) {} video_player_view.setMediaController(media_Controller); video_player_view.setVideoPath(path);

seekTo in VideoView

橙三吉。 提交于 2019-12-06 01:20:46
问题 I'm having problems with seeking video. My application should resume video from place where it was stopped last time. So I do this: videoView.seekTo(bookmark); videoView.start(); However when it plays I hear sounds form beginning of video for about 1-2 sec. And only after that video seeks to the right position. This behavior is reproducible on HTC Nexus One, HTC G1, HTC evo. But on Samsung galaxy tab all plays normally. Anybody had similar problems? Is this bug HTC-specific? Thanks in advance

Android Vitamio library makes apk too big

倖福魔咒の 提交于 2019-12-06 01:19:32
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 dialog that I have to install the Vitamio app first to continue :/ Deleting the libarm.so file will

RTSP 1080p live-streaming android client gets error (100,0)

我是研究僧i 提交于 2019-12-06 00:27:47
问题 My new surveillance camera just arrived, so I'm trying to write an app to live stream the video from it. Since it came with basically no documentation, I installed the 'onvifer' android app which allows you to browse the camera's capabilities. This app works fine - gets the video and allows PTZ controls, etc. It reports the streaming url as: rtsp://192.1.0.193:554/mpeg4 I tested the stream in the VLC windows client, and it's able to stream video from that URL as well. This makes me

android play movie inside expansion file

*爱你&永不变心* 提交于 2019-12-05 21:13:27
问题 My app is trying to deliver lots of contents to users, so the app's size is much greater than 50mb. There is no way we could reduce or remove some of the content, so we decided to go with the expansion approach. I am trying to follow this tutorial: Android APK Expansion Files, and have been successful up to putting the expansion file into my device for testing. I could get the input stream of any video file inside the expansion. But when I try to setVideoUri for the videoView, it starts

How to make VideoView full screen

杀马特。学长 韩版系。学妹 提交于 2019-12-05 21:02:22
I want to play a video in my Activity using a VideoView ,and make it fullscreen and landscape mode (with hiding virtual button and status bar)when I click a Button . But it can not hide the virtual button and it has a white line in bottom. This my activity code: public class VideoActivity extends Activity { private VideoView mVideoView; private String mUrl; private Button mFullScreen; private static String TAG = VideoActivity.class.getName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG,"onCreate"); setContentView(R.layout.video);