Skip to content

Commit 3796736

Browse files
committed
fix(exo-player): crash
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent a003a5c commit 3796736

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/java/com/nextcloud/client/media/BackgroundPlayerService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class BackgroundPlayerService :
7979

8080
private lateinit var exoPlayer: ExoPlayer
8181
private var mediaSession: MediaSession? = null
82-
8382
private var isPlayerReady = false
8483

8584
private val stopReceiver = object : BroadcastReceiver() {
@@ -115,6 +114,7 @@ class BackgroundPlayerService :
115114
0
116115
}
117116
)
117+
118118
return super.onStartCommand(intent, flags, startId)
119119
}
120120

@@ -164,7 +164,6 @@ class BackgroundPlayerService :
164164
}
165165

166166
val realPlayer = createNextcloudExoplayer(this@BackgroundPlayerService, nextcloudClient)
167-
168167
exoPlayer.release()
169168
exoPlayer = realPlayer
170169
isPlayerReady = true
@@ -273,6 +272,7 @@ class BackgroundPlayerService :
273272
}
274273
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
275274
nm.cancel(DefaultMediaNotificationProvider.DEFAULT_NOTIFICATION_ID)
275+
stopForeground(STOP_FOREGROUND_REMOVE)
276276
stopSelf()
277277
}
278278

0 commit comments

Comments
 (0)