android-videoview

Android VideoView: Video view is much darker in a dialog view

我怕爱的太早我们不能终老 提交于 2019-11-28 05:55:26
Hi all I have a problem with embedding a video view inside a dialog view everything works fine except that the video displayed in the Dialog is much darker that if displayed in the rest of the activity any ideas ? here is some code button1main.setOnClickListener(new OnClickListener() { public VideoView videoView = null; @Override public void onClick(View v) { //set up dialog Dialog dialog = new Dialog(CustomDialog.this); dialog.setContentView(R.layout.maindialog); //dialog.setTitle("This is my custom dialog box"); dialog.setCancelable(true); this.videoView = (VideoView) dialog.findViewById(R

Control the playback speed of video in android

三世轮回 提交于 2019-11-28 04:16:29
问题 I am using a VideoView to play a video file kept in res/raw. I couldnt find a way to control the playback speed of the video. Basically i want to reduce and increase the playback while moving a scroll bar. Is there any work around for implementing this? 回答1: No, you cannot change the playback rate by simply using VideoView . VideoView and MediaPlayer only provide limited media functions. You have to use some third party library, e.g., PVPlayer, and implement that yourself. That's also why

Position Video Inside a VideoView

好久不见. 提交于 2019-11-28 03:47:41
So I have extended VideoView's onMeasure to scale up the video to fit inside a fullscreen view. here is how: public void setVideoAspect(int w,int h){ wVideo=w; hVideo=h; onMeasure(w, h); } @Override protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if(wVideo!=0 && hVideo!=0) setMeasuredDimension(wVideo,hVideo); } I call setVideoAspect() with the display metrics (width, hight) of the screen. The problem is that this method stretches the video to fit inside the screen. I want to be able to keep the aspect ratio. (I have

What is the difference between MediaPlayer and VideoView in Android

邮差的信 提交于 2019-11-28 03:31:25
I was wondering if there's a difference between them when it comes to streaming videos. I know VideoView can be used for streaming and what is Mediaplayer for? As far as I know, MediaPlayer can do the same thing as VideoView right? Can anyone give me the answer? And if I want to stream video from the server by using RTSP to Android, which one should I start with? VideoView or MediaPlayer ? Any suggestion? mishkin Was asking the same question and as I understood from what Mark (CommonsWare) advised on numerous threads here, VideoView is a wrapper (200 hundred lines of code) for MediaPlayer and

java.lang.StringIndexOutOfBoundsException while playing video in videoView : Android v 4.2.1

浪尽此生 提交于 2019-11-28 02:39:02
问题 I am getting this crash when I play video on videoView in Android version 4.2.1. I found this out specifically on Micromax Canvas A210 device. It is not showing any message where the error is occurring. Is this a bug or something wrong in application? The crash log is as below: 09-18 11:05:53.245: E/AndroidRuntime(2323): FATAL EXCEPTION: main 09-18 11:05:53.245: E/AndroidRuntime(2323): java.lang.StringIndexOutOfBoundsException: length=11; regionStart=0; regionLength=-1 09-18 11:05:53.245: E

Android Google Music app stops when my intro video plays

最后都变了- 提交于 2019-11-28 01:58:42
问题 I'm using a VideoView in my Android app to display the intro animation. If the Google Music App is playing music in the background, calling videoview.start() stops music playing in Google Music App in the background. Is there a way to make sure any music in the background will keep playing at the same time with my intro video? (it has no audio) Thank you! 回答1: Turns out Google Music App and a few other apps will stop their music when any video starts playing. In order to make sure I'm not

How to put a video file in android custom content provider

一笑奈何 提交于 2019-11-28 01:40:51
I have a video file. i want to store it in a custom content provider. and after that i want to read it and want to play it through Uri. Below is my code. package com.videocon.nds; public class FileProvider extends ContentProvider { public static final Uri CONTENT_URI=Uri.parse("content://com.videocon.nds/"); private static final HashMap<String, String> MIME_TYPES=new HashMap<String, String>(); static { MIME_TYPES.put(".mp4", "video/mp4"); } @Override public boolean onCreate() { File f=new File(getContext().getFilesDir(), "Holy.mp4"); if (!f.exists()) { AssetManager assets=getContext()

Video View not playing youtube video

别等时光非礼了梦想. 提交于 2019-11-28 00:23:44
I am trying to play a youtube video in a Video View. I have laid out the xml like this: <VideoView android:id="@+id/VideoView" android:layout_height="fill_parent" android:layout_width="fill_parent" /> and the code is like this: setContentView(R.layout.webview); VideoView vv = (VideoView) findViewById(R.id.VideoView); MediaController mc=new MediaController(this); mc.setEnabled(true); mc.show(0); vv.setMediaController(mc); vv.setVideoURI(Uri.parse("http://www.youtube.com/watch?v=XS998HaGk9M")); vv.requestFocus(); vv.showContextMenu(); vv.start(); I have added the permission within the manifest.

Couldn't open file on client side, trying server side Error in Android

梦想与她 提交于 2019-11-28 00:07:55
问题 I have tried to play a youtube video by its URL by my android program. I have used setVideoURI(uri); function also to set URI, as suggested by other POSTs in stackoverflow regarding this. But I am getting Couldn't open file on client side, trying server side error. Can you please figure out what is the problem with my code. But I am able to play any local video by commented code. Here is my android code- public class VideoActivity extends Activity { //MediaPlayer song= new MediaPlayer();

Sorry, this video is not valid for streaming to this device in Http streaming android

与世无争的帅哥 提交于 2019-11-27 22:37:45
I can stream some videos from URL (server) successfully, But the others (my video up to my server) is not . You can see both in my code (Working/Not working) I'm on stuck with this problem. "Sorry, this video is not valid for streaming to this device" The following code : String url = null; // url = "rtsp://v5.cache5.c.youtube.com/CiILENy73wIaGQmC00ZlwwIDOxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"; // Working // url = "http://daily3gp.com/vids/747.3gp"; // Working url = "http://www.ooklnet.com/files/381/381489/video.mp4"; // Working // url = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";