Compare commits

...

3 Commits

Author SHA1 Message Date
Stefan 3775e589f6 docs: update file Authentication.md link to packageHttp 2024-07-08 21:26:42 +01:00
Kai DeLorenzo 3631cfe365 fix unstable api error 2024-07-05 12:06:32 -05:00
Koen 8766ae176e Updated Spotify and possible fix for media session being killed after 10 minutes of inactivity. 2024-07-04 10:49:59 +02:00
5 changed files with 19 additions and 4 deletions
@@ -161,6 +161,7 @@ import java.time.OffsetDateTime
import kotlin.math.abs
import kotlin.math.roundToLong
@androidx.media3.common.util.UnstableApi
class VideoDetailView : ConstraintLayout {
private val TAG = "VideoDetailView"
@@ -15,7 +15,9 @@ import android.media.AudioManager
import android.media.AudioManager.OnAudioFocusChangeListener
import android.media.MediaMetadata
import android.os.Build
import android.os.Handler
import android.os.IBinder
import android.os.Looper
import android.os.SystemClock
import android.support.v4.media.MediaMetadataCompat
import android.support.v4.media.session.MediaSessionCompat
@@ -57,6 +59,15 @@ class MediaPlaybackService : Service() {
private var _audioFocusLossTime_ms: Long? = null
private var _playbackState = PlaybackStateCompat.STATE_NONE;
private val _updateIntervalMs: Long = 5 * 60 * 1000
private val _handler: Handler = Handler(Looper.getMainLooper())
private val _updateRunnable: Runnable = object : Runnable {
override fun run() {
updateMediaSession(null)
_handler.postDelayed(this, _updateIntervalMs)
}
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
Logger.v(TAG, "onStartCommand");
@@ -74,6 +85,8 @@ class MediaPlaybackService : Service() {
_callOnStarted?.invoke(this);
_instance = this;
_handler.postDelayed(_updateRunnable, _updateIntervalMs)
}
catch(ex: Throwable) {
Logger.e(TAG, "Failed to start MediaPlaybackService due to: " + ex.message, ex);
@@ -143,6 +156,7 @@ class MediaPlaybackService : Service() {
override fun onDestroy() {
Logger.v(TAG, "onDestroy");
_instance = null;
_handler.removeCallbacks(_updateRunnable)
MediaControlReceiver.onPauseReceived.emit();
super.onDestroy();
}
+2 -2
View File
@@ -8,7 +8,7 @@ The goal of the authentication system is to provide plugins the ability to make
>
>You should always only login (and install for that matter) plugins you trust.
How to actually use the authenticated client is described in the Http package documentation (See [Package: Http](_blank)).
How to actually use the authenticated client is described in the Http package documentation (See [Package: Http](./packages/packageHttp.md)).
This documentation will exclusively focus on configuring authentication and how it behaves.
## How it works
@@ -58,5 +58,5 @@ Headers are exclusively applied to the domains they are retrieved from. A plugin
By default, when authentication requests are made, the authenticated client will behave similar to that of a normal browser. Meaning that if the server you are communicating with sets new cookies, the client will use those cookies instead. These new cookies are NOT saved to disk, meaning that whenever that plugin reloads the cookies will revert to those assigned at login.
This behavior can be modified by using custom http clients as described in the http package documentation.
(See [Package: Http](_blank))
(See [Package: Http](./packages/packageHttp.md))