Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only Audio player for Exoplayer 2 (No video)

Currently i have created SimpleExoplayer using below https://github.com/googlecodelabs/exoplayer-intro/tree/master/exoplayer-codelab-01

UI for SimpleExoplayer has video view and controls.

Removing and/or customizing video view did not worked properly. Any use case of SimpleExoplayer only with Audio controls and no Video view.

like image 231
kunal.c Avatar asked Sep 02 '25 16:09

kunal.c


1 Answers

You can do this using following...set app:controller_layout_id to your own version of that layout that does not include video layout (and generally gives you more control of layout/style of audio controls as well if needed)

<com.google.android.exoplayer2.ui.SimpleExoPlayerView
    android:id="@+id/audio_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:show_timeout="0"
    app:hide_on_touch="false"
    app:use_artwork="false"
    app:controller_layout_id="@layout/exo_playback_control_view" />
like image 141
John O'Reilly Avatar answered Sep 05 '25 07:09

John O'Reilly