Search code examples
androidexoplayerexoplayer2.x

ExoPlayer: Control skip-interval for forward and rewind buttons


I'm looking for a way to set a skip interval for "forward" and "rewind" buttons. By default pressing forward skips 15 seconds of video, but pressing rewind skips only 5 seconds. I'd like to set both to 5 seconds but I can't find any API to do so.

Question: How to override skip-interval for "forward" and "rewind" buttons in ExoPlayer 2?


Solution

  • It should be app:fastforward_increment="5000" and app:rewind_increment="5000"

    <com.google.android.exoplayer2.ui.SimpleExoPlayerView
                        android:id="@+id/item_comment_exo_player_view"
                        android:layout_width="match_parent"
                        android:layout_height="250dp"
                        android:layout_gravity="center"
                        android:background="@color/black"
                        android:fitsSystemWindows="true"
                        android:paddingBottom="0dp"
                        android:paddingEnd="0dp"
                        android:paddingStart="0dp"
                        android:paddingTop="0dp"
                        app:controller_layout_id="@layout/custom_playback_control"
                        app:fastforward_increment="5000"
                        app:rewind_increment="5000"
                        app:show_timeout="2000" />