Android VideoView Resolution 640 x640 only audio
<p>I'm playing video in custom dialog using the following code -</p>

<pre><code>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);
</code></pre>

<p>One type of video plays good on this and has the following properties -</p>

<pre><code>Frame Rate - 29.97
Display Resolution -640 x 360
Resolution - 640 x 386
Codec - H264-MPEG-4AVC
</code></pre>

<p>In the second type of video, I get only audio - </p>

<pre><code>Frame Rate - 29.97
Display Resolution -640 x 642
Resolution - 640 x 640
Codec - H264-MPEG-4AVC
</code></pre>

<p>How do I fix this?</p>