mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-17 13:32:38 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3775e589f6 | |||
| 3631cfe365 | |||
| 8766ae176e |
+1
@@ -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();
|
||||
}
|
||||
|
||||
Submodule app/src/stable/assets/sources/spotify updated: 4e826dcb6a...c700081466
Submodule app/src/unstable/assets/sources/spotify updated: 4e826dcb6a...c700081466
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user