WindowManager.LayoutParams a = dialog.getWindow().getAttributes();a.dimAmount = 
0;
dialog.getWindow().setAttributes(a);

use this my solve the problem


On Tuesday, June 26, 2012 at 2:43:11 AM UTC+5:30, Vance Turnewitsch wrote:
>
> Hi, 
> I am displaying a VideoView in a custom Dialog I am creating. I am 
> attaching a MediaController to the VideoView, but the MediaController 
> won't show up when touching/clicking the screen or VideoView on a 
> device or in the emulator. Below is my code for creating the Dialog: 
>
>   private Dialog createFullScreenVideoDialog(final Bundle args){ 
>     //Create Layout... 
>     FrameLayout holder = new FrameLayout(this); 
>     holder.setId(holder.hashCode()); 
>     holder.setLayoutParams(new 
> ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); 
>
>
>     //Create video view 
>     final VideoView video = new VideoView(this); 
>     video.setId(video.hashCode()); 
>     FrameLayout.LayoutParams videoParams = null; 
>     switch(getResources().getConfiguration().orientation){ 
>     case Configuration.ORIENTATION_LANDSCAPE: 
>       videoParams = new 
> FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, 
> LayoutParams.FILL_PARENT, Gravity.CENTER); 
>       break; 
>     case Configuration.ORIENTATION_PORTRAIT: 
>       videoParams = new 
> FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, 
> LayoutParams.WRAP_CONTENT, Gravity.CENTER); 
>       break; 
>     default: //If the orientation is ORIENTATION_SQUARE or 
> ORIENTATION_UNDEFINED 
>       //or some other value... 
>       videoParams = new 
> FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, 
> LayoutParams.WRAP_CONTENT, Gravity.CENTER); 
>     } 
>
>     holder.addView(video, videoParams); 
>
>     final Dialog dia = new 
> Dialog(this,android.R.style.Theme_NoTitleBar_Fullscreen){ 
>       public void onBackPressed(){ 
>         video.pause(); 
>         super.onBackPressed(); 
>       } 
>     }; 
>
>     dia.setContentView(holder); 
>
>     dia.setOnShowListener(new OnShowListener() { 
>
>       @Override 
>       public void onShow(DialogInterface arg0) { 
>         String path = 
> args.getString(ComponentConstants.VIDEOPLAYER_FULLSCREEN_PATHKEY); 
>
>         MediaController controller = new 
> MediaController(dia.getContext()); 
>         video.setMediaController(controller); 
>         if(path!=null){ 
>           try { 
>             video.setVideoURI(MediaUtil.getVideoPath(getActiveForm(), 
> path)); 
>   
> if(args.getBoolean(ComponentConstants.VIDEOPLAYER_FULLSCREEN_STATEKEY)) 
> { 
>               video.start(); 
>   
> video.seekTo(args.getInt(ComponentConstants.VIDEOPLAYER_FULLSCREEN_CURRENTPOSITIONKEY));
>  
>
>             } 
>           } catch (IOException e) { 
>             // TODO Auto-generated catch block 
>             e.printStackTrace(); 
>           } 
>         } 
>       } 
>     }); 
>     return dia; 
>   } 
>
> The video is playing in the VideoView, but I can't see the 
> MediaController. 
>
> Any ideas? 
> Thanks, 
> Vance

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/19ec2800-6cb6-4458-882a-3ab3086e91ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to