hms-ml-demo
hms-ml-demo copied to clipboard
Why the VideoView inside LensEnginePreview is always Stretched
Hi, I've noticed that the VideoView is always stretched, I tried to resize it with a custom height, but it doesn't work.
e.g. :
<com.huawei.mlkit.sample.camera.LensEnginePreview
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<VideoView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.huawei.mlkit.sample.views.overlay.GraphicOverlay
android:id="@+id/graphic"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.huawei.mlkit.sample.camera.LensEnginePreview>
You may need to rotate it 90 degrees and resize it.Better landscape effect.