Android VideoView分辨率640 x640仅音频

时间:2016-02-27 06:44:07

标签: android android-videoview

我正在使用以下代码在自定义对话框中播放视频 -

final Dialog dialog = new Dialog(getActivity());// add here your class name
                            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                            dialog.setContentView(R.layout.introvid);//add your own xml with defied with and height of videoview
                            dialog.show();
                            WindowManager.LayoutParams lp = new WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
                            lp.copyFrom(dialog.getWindow().getAttributes());
                            dialog.getWindow().setAttributes(lp);
                            dialog.getWindow().setFormat(PixelFormat.TRANSLUCENT);
                            final VideoView viz = (VideoView) dialog.findViewById(R.id.vid);
                            Uri vidUri = Uri.parse(video_url);
                            viz.setVideoURI(vidUri);
                            viz.start();
                            viz.setZOrderOnTop(true);

一种类型的视频在此方面表现良好,并具有以下属性 -

Frame Rate - 29.97
Display Resolution -640 x 360
Resolution - 640 x 386
Codec - H264-MPEG-4AVC

在第二类视频中,我只获得音频 -

Frame Rate - 29.97
Display Resolution -640 x 642
Resolution - 640 x 640
Codec - H264-MPEG-4AVC

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

你在问题​​上不够具体,所以我只能假设视频分辨率和显示分辨率不能正常工作。我建议使用不同的视频和尺寸进行测试