android - MediaPlayer inside SurfaceView only shows a little peace in Tablet bq 10 inches -


As you can see in the next link:

This was shown only part of my SurfaceView is. The next XML I have defined is SurfaceView:

   

My Java code to make it works is:.

  sv.getHolder () addCallback (new callback () {@Override public void surfaceDestroyed (SurfaceHolder holder) {mediaPlayer.release ();} @Override public void surfaceCreated (SurfaceHolder holder) {mediaPlayer .setVolume (0, 0); playVideoDelay (MediaPlayer, SV, path);} @Override public void surfaceChanged (SurfaceHolder holder, brick format, brick width, brick height) {}}); // method is called: private void playVideoDelay (Last MediaPlayer videoView, last SurfaceView sv, Uri uri) {try {videoView.setDataSource, (getActivity () getApplicationContext (), uri.). Sv.getHolder () setFormat (PixelFormat.OPAQUE); VideoView.setDisplay (sv.getHolder ()); VideoView.prepare (); If (Build.VERSION.SDK_INT> = 16) videoView .setVideoScalingMode (MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); If (currentPositionVid> 0) {videoView.seekTo (currentPositionVid); } VideoView.start (); } Hold (exception e) {e.printStackTrace (); }}  

This works in my old tablet Samsung Galaxy 10.1, but this works in my tablet Beacu Edison 3 (as you see in the previous link).

Finally, by reading many posts, Android documentation and other stuff; When I understood when you use more than two layers Adroid (because each layer images, buttons, visuals, surface view or other advanced graphics components can make my case), you have to be careful to Android Render is sometimes not known with the weight of each layer and the correct sequence with some elements.

So in my case, I tried to show a surface view (with some buttons and images) on a layer with background, some imagebuttones, etc. and sometimes the layer is well Was painted but sometimes not. Indeed, in the form of layer behavior it was really difficult to solve the problem, so I re-created all the interfaces by putting images outside all the buttons and surfaces.

Hope it helps! Regards


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -