Skip to content

Is it possible to set up a click or touch event for a UniversalVideoView ? #65

@BoumBam

Description

@BoumBam

I want to handle the click or touch event for the UniversalVideoView.
I tried the below:

`

    <FrameLayout
        android:id="@+id/video_layout"
        android:layout_width="0dp"
        android:layout_height="200dp"
        android:background="@android:color/black"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.universalvideoview.UniversalVideoView
            android:id="@+id/videoView"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="center"
            app:uvv_autoRotation="true"
            app:uvv_fitXY="false" />

        <com.universalvideoview.UniversalMediaController
            android:id="@+id/media_controller"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            app:uvv_scalable="true" />

    </FrameLayout>


videoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(ImgVideoViewerActivity.this, "bien", Toast.LENGTH_SHORT).show();
            }
        });

        video_layout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(ImgVideoViewerActivity.this, "bien", Toast.LENGTH_SHORT).show();
            }
        });`

Bbut not work.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions