相关疑难解决方法(0)

在ExoPlayer上静音

我正在使用名为ExoPlayer的谷歌新MediaPlayer,无法找到静音的方法

是否有一种简单的方法可以在Google ExoPlayer上静音音轨?还是改变音量?

android exoplayer

28
推荐指数
4
解决办法
1万
查看次数

如何在 Android 中为 ExoPlayer 设计自定义搜索栏和音量控制

我已经为 ExoPlayer 的 Design Custom Seekbar尝试过这个这个,但没有运气。

我想为 ExoPlayer 设计自定义拇指和进度条。以下是 ExoPlayer 的 XML,我曾尝试在其中放置搜索栏,但没有按预期出现。

<com.google.android.exoplayer.AspectRatioFrameLayout
        android:id="@+id/video_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center">

        <SurfaceView
            android:id="@+id/surface_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"/>

        <View
            android:id="@+id/shutter"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@android:color/black"/>
        <SeekBar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:thumb="@drawable/thumb"/>

        <com.google.android.exoplayer.text.SubtitleLayout
            android:id="@+id/subtitles"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </com.google.android.exoplayer.AspectRatioFrameLayout>
Run Code Online (Sandbox Code Playgroud)

还有一个问题是我如何为 ExoPlayer 设置自定义音量控件,就像我们在MXPlayer 中一样(音量垂直条)。

更新

我已经得到了SeekBar使用这种方法。

SeekBar seekBar = (SeekBar) mediaController.findViewById(getResources().getIdentifier("mediacontroller_progress","id","android"));
seekBar.setThumb(getResources().getDrawable(R.drawable.player_thumb));
Run Code Online (Sandbox Code Playgroud)

现在唯一要做的就是像MXPlayer一样获得垂直音量控制。

android seekbar exoplayer

5
推荐指数
1
解决办法
9334
查看次数

标签 统计

android ×2

exoplayer ×2

seekbar ×1