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



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

as can see in next link: https://www.dropbox.com/s/5qdu28byz0luxyu/screenshot.png?dl=0

it's shown part of surfaceview. have defined surfaceview next xml:

<relativelayout android:id="@+id/rel_page0" android:layout_width="match_parent" android:layout_height="match_parent" android:focusableintouchmode="true" > <surfaceview android:id="@+id/video0_0p" android:layout_width="fill_parent" android:layout_height="470dp" android:layout_alignparenttop="true" android:adjustviewbounds="true"/> ...

my java code create 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, int format, int width, int height) { } }); //the method called is: private void playvideodelay(final mediaplayer videoview, final surfaceview sv, uri uri) { seek { 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(); } grab (exception e) { e.printstacktrace(); } }

it works in old tablet samsung galaxy 10.1, in tablet bq edison 3 works bad (as see in previous link).

finally, reading lot of posts, android documentation , other stuff; understood when utilize more 2 layers in adroid (each layer can composed images, buttons, views, surfaceview or advance graphic component case), have careful because of android render doesn't know weight of each layer , right order elements.

so in case, tried show surfaceview (with buttons , images on it) on layer background, imagebuttons on them,etc. layer painted not. problem hard solve in layer behaviour form, re-built interface putting buttons , images outside surfaceview.

https://www.dropbox.com/s/pb7hn32cx9y2eak/screenshot_2015-01-12-14-21-29.png?dl=0

hope helps! regards

android media-player surfaceview tablet

Comments

Popular posts from this blog

java - Bypassing "final local variable defined in an enclosing type" -

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -