android-videoview

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

心已入冬 提交于 2019-11-27 01:07:03
问题 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

Can a videoview play a video stored on internal storage?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 01:03:31
I'm trying to provide my users with the ability to use either external or internal storage. I'm displaying both images and videos (of a scientific nature). When storing the media on the SD card, all is fine. But when I store the media internally, only the images will display. No matter what I try I get various errors when trying to load and display the media stored under the applicationcontext.getFilesDir(). Is there a trick to setting a videoview's content to such a file? Can a ContentResolver help me? On a related note, is it considered bad form to assume that external storage exists? Thanks

how to play video from url

≯℡__Kan透↙ 提交于 2019-11-27 00:54:17
I am beginner in android development and try to play video from link. But it's giving error "sorry,we can't play this video" . I tried so many links but for all links its show same error. My code is the following public class VideoDemo extends Activity { private static final String path ="http://demo.digi-corp.com/S2LWebservice/Resources/SampleVideo.mp4"; private VideoView video; private MediaController ctlr; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFormat(PixelFormat.TRANSLUCENT); setContentView(R.layout.videoview); video = (VideoView)

What is the difference between MediaPlayer and VideoView in Android

别说谁变了你拦得住时间么 提交于 2019-11-27 00:05:02
问题 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? 回答1: Was asking the same question and as I understood from what Mark (CommonsWare)

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

风格不统一 提交于 2019-11-26 23:11:44
问题 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

Load Video from Firebase Storage to videoView

荒凉一梦 提交于 2019-11-26 22:25:54
问题 I want to play a video from Firebase storage with a videoview I'm trying like this: storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { //Toast.makeText(Chat.this, uri.toString(), Toast.LENGTH_SHORT).show(); MediaController mc = new MediaController(Chat.this); videoView.setMediaController(mc); videoView.setVideoURI(uri); videoView.requestFocus(); //videoView.start(); } }); But it wont play. The video is empty. 回答1:

VideoView to match parent height and keep aspect ratio

一世执手 提交于 2019-11-26 22:14:01
I have a VideoView which is set up like this: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/player" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <VideoView android:id="@+id/video" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_centerInParent="true" android:layout_centerVertical="true" /> <ProgressBar android:id="@+id/loader" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout

Video View not playing youtube video

烂漫一生 提交于 2019-11-26 21:41:16
问题 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"));

How to prevent VideoView/MediaPlayer from stopping other apps' audio?

拈花ヽ惹草 提交于 2019-11-26 21:37:01
问题 In one screen I have a looping background video (upon which normal UI elements are shown), implemented with VideoView like this: String resPath = "android.resource://" + getPackageName() + "/" + R.raw.bg_video; videoView.setVideoURI(Uri.parse(resPath)); // Hide controls: MediaController controller = new MediaController(getActivity()); controller.setVisibility(View.GONE); videoView.setMediaController(controller); // Use looping: videoView.setOnPreparedListener(new MediaPlayer

Rotating an android VideoView

蓝咒 提交于 2019-11-26 20:32:40
My application offers only Portrait mode. In a portrait activity I have a fullscreen VideoView. What I want to do is rotate the VideoView ( the actual video, videobuffer) 90 degrees at Landscape mode. Enabling activity to be on Lanscape mode is not an option. Extending VideoView and canvas rotate will not work as it is a SurfaceView not an actual view. Is there any way to achieve that with a videoView? VideoView does not support rotation of video even if composition matrix is set correctly and rotation attribute is used. What you can do is to use TextureView and set its attribute rotation="90"