J'utilise google officiel sample pour contourner l'enregistrement vidéo en utilisant Camera API 2. mais le problème est que je ne suis pas en mesure de le faire en plein écran que j'ai limité l'orientation de l'écran uniquement à portrait.Voici le xml j'ai édité et le official xml.Appareil photo 2: Impossible d'enregistrer la vidéo en plein écran?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<AutoFitTextureView
android:id="@+id/texture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<Button
android:id="@+id/video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/label_record" />
<ImageView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:contentDescription="Description"
android:padding="20dp"
android:src="@drawable/ic_more" />
</FrameLayout>
</RelativeLayout>
Je pense ici est le réglage de la taille de l'écran vidéo par rapport d'aspect à la TextureView
mais je ne pouvais pas le faire à plein écran. Toute aide est grandement appréciée.
mVideoSize = chooseVideoSize(map.getOutputSizes(MediaRecorder.class));
mPreviewSize = chooseOptimalSize(map.getOutputSizes(SurfaceTexture.class), width, height, mVideoSize);
int orientation = getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
mTextureView.setAspectRatio(mPreviewSize.getWidth(), mPreviewSize.getHeight());
} else {
mTextureView.setAspectRatio(mPreviewSize.getHeight(), mPreviewSize.getWidth());
}
Oui .. Il est working..thanks :) – Stella