Skip to content

Commit

Permalink
handle audio focus and becoming noisy
Browse files Browse the repository at this point in the history
Signed-off-by: parneet-guraya <[email protected]>
  • Loading branch information
parneet-guraya committed Jan 9, 2024
1 parent a301062 commit fb6faa2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package com.nextcloud.client.media

import android.content.Context
import androidx.annotation.OptIn
import androidx.media3.common.AudioAttributes
import androidx.media3.common.util.UnstableApi
import androidx.media3.datasource.DefaultDataSource
import androidx.media3.datasource.okhttp.OkHttpDataSource
Expand Down Expand Up @@ -53,6 +54,8 @@ object NextcloudExoPlayer {
return ExoPlayer
.Builder(context)
.setMediaSourceFactory(mediaSourceFactory)
.setAudioAttributes(AudioAttributes.DEFAULT, true)
.setHandleAudioBecomingNoisy(true)
.setSeekForwardIncrementMs(FIVE_SECONDS_IN_MILLIS)
.build()
}
Expand Down

0 comments on commit fb6faa2

Please sign in to comment.