Android视频视图-可以在播放视频时为MP4着色/添加色调



当MP4正在播放时,我正在尝试为VideoView着色/添加色调。例如,应该添加蓝色色调,并且在播放时视频将保持可见。这可能吗?

<VideoView
    android:id="@+id/myVideo"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:visibility="visible"
    android:layout_centerInParent="true" />

我相信您可以使用帧布局将带有drawable的视图覆盖到视频上。您可以将视频顶部视图的背景设置为具有alpha通道的背景。类似于:

<FrameLayout 
    android:layout_height="wrap_content"
    android:layout_width="wrap_content">
    <VideoView
         android:id="@+id/myVideo"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:visibility="visible"
         android:layout_centerInParent="true"/>
    <View 
         android:layout_height="match_parent"
         android:layout_width="match_parent"
         android:background="@color/semi_transparent_blue"/>
<FrameLayout/>

最新更新