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 Dec 21, 2023
1 parent 2df8096 commit 7b336da
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 com.google.android.exoplayer2.ExoPlayer
import com.google.android.exoplayer2.audio.AudioAttributes
import com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory
import com.google.android.exoplayer2.upstream.DefaultDataSource
Expand Down Expand Up @@ -50,6 +51,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 7b336da

Please sign in to comment.