I developed one application. My application includes video recording and playing.

I have to play video what i have recorded from mobile. This is working in most of devices(Samsung galaxy ace,Motorola Droid x, etc.,) and not working in some of devices(Droid x2,Nexus,etc.,).

i used below code for video playing

String temp_path=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+"/MySaveCellData/dbz_115.3gp";
    //Toast.makeText(this,getSaveCellPath(),Toast.LENGTH_LONG).show();
    if(temp_path!=null) {
            //int width = myView.getMeasuredWidth();
          //  int height = myView.getMeasuredHeight();
            //we add 10 pixels to the current size of the video view every time you touch     
            //the media controller.
        Display display = getWindowManager().getDefaultDisplay(); 
        int width = display.getWidth();
        int height = display.getHeight();
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(myView);
        myView.setMediaController(mediaController);

        myView.setKeepScreenOn(true);

        //myView.setVideoAspect(width,height);
        //myView.setVideo
        myView.setVideoPath(temp_path);
        myView.start();
        myView.requestFocus();
    }
    else 
        Toast.makeText(this,"Video Path Not Found, or is set to null",Toast.LENGTH_LONG).show();        
}

can anyone tell me what is the problem and solution also.

Thanks in advance.

Best Regards.

有帮助吗?

解决方案

The problem is not in video playing.The problem in video recording.When i record the video the hardware of device is not supporting to my code. So i changed the code of video recorder. It is working well in all devices.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top