hms-ml-demo icon indicating copy to clipboard operation
hms-ml-demo copied to clipboard

Why the VideoView inside LensEnginePreview is always Stretched

Open Ali-cryptoo opened this issue 4 years ago • 1 comments

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>

Ali-cryptoo avatar Jun 02 '21 23:06 Ali-cryptoo

You may need to rotate it 90 degrees and resize it.Better landscape effect.

SoftwareGift avatar Jun 03 '21 02:06 SoftwareGift