From d53ebda6dc96bc6ba1239707f3e05eee494d98ac Mon Sep 17 00:00:00 2001 From: kabel2 Date: Sat, 19 Oct 2024 13:35:25 +0200 Subject: [PATCH 1/9] Add skip forward length setting --- .../preference/UserSettingPreferences.kt | 2 +- .../ui/playback/overlay/CustomSeekProvider.kt | 9 +++------ .../overlay/LeanbackOverlayFragment.java | 5 ++++- .../screen/PlaybackPreferencesScreen.kt | 19 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt b/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt index 0eb28839c5..8933e67b23 100644 --- a/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt +++ b/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt @@ -15,7 +15,7 @@ class UserSettingPreferences( ) { companion object { val skipBackLength = intPreference("skipBackLength", 10_000) - val skipForwardLength = intPreference("skipForwardLength", 30_000) + val skipForwardLength = intPreference("skipForwardLength", 10_000) val homesection0 = enumPreference("homesection0", HomeSectionType.LIBRARY_TILES_SMALL) val homesection1 = enumPreference("homesection1", HomeSectionType.RESUME) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt index 25ce490bdb..c46ffbb581 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt @@ -6,16 +6,13 @@ import kotlin.math.min class CustomSeekProvider( private val videoPlayerAdapter: VideoPlayerAdapter, + private val forwardTime: Int ) : PlaybackSeekDataProvider() { - companion object { - private const val SEEK_LENGTH = 10000L - } - override fun getSeekPositions(): LongArray { if (!videoPlayerAdapter.canSeek()) return LongArray(0) val duration = videoPlayerAdapter.duration - val size = ceil(duration.toDouble() / SEEK_LENGTH.toDouble()).toInt() + 1 - return LongArray(size) { i -> min(i * SEEK_LENGTH, duration) } + val size = ceil(duration.toDouble() / forwardTime.toDouble()).toInt() + 1 + return LongArray(size) { i -> min(i * forwardTime.toLong(), duration) } } } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java index b451db913b..e7f7cf6b5b 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java @@ -6,9 +6,11 @@ import androidx.leanback.app.PlaybackSupportFragment; +import org.jellyfin.androidtv.preference.UserSettingPreferences; import org.jellyfin.androidtv.ui.playback.CustomPlaybackOverlayFragment; import org.jellyfin.androidtv.ui.playback.PlaybackController; import org.jellyfin.androidtv.ui.playback.PlaybackControllerContainer; +import org.koin.java.KoinJavaComponent; import kotlin.Lazy; import timber.log.Timber; @@ -18,6 +20,7 @@ public class LeanbackOverlayFragment extends PlaybackSupportFragment { private VideoPlayerAdapter playerAdapter; private boolean shouldShowOverlay = true; private Lazy playbackControllerContainer = inject(PlaybackControllerContainer.class); + private final Integer skipForwardLength = KoinJavaComponent.get(UserSettingPreferences.class).get(UserSettingPreferences.Companion.getSkipForwardLength()); @Override public void onCreate(Bundle savedInstanceState) { @@ -76,7 +79,7 @@ public void mediaInfoChanged() { playerGlue.invalidatePlaybackControls(); playerGlue.setSeekEnabled(playerAdapter.canSeek()); - playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter) : null); + playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter, skipForwardLength) : null); recordingStateChanged(); playerAdapter.updateDuration(); } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/preference/screen/PlaybackPreferencesScreen.kt b/app/src/main/java/org/jellyfin/androidtv/ui/preference/screen/PlaybackPreferencesScreen.kt index 09c2ca0425..a2222a8911 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/preference/screen/PlaybackPreferencesScreen.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/preference/screen/PlaybackPreferencesScreen.kt @@ -2,6 +2,7 @@ package org.jellyfin.androidtv.ui.preference.screen import org.jellyfin.androidtv.R import org.jellyfin.androidtv.preference.UserPreferences +import org.jellyfin.androidtv.preference.UserSettingPreferences import org.jellyfin.androidtv.preference.constant.AudioBehavior import org.jellyfin.androidtv.preference.constant.NEXTUP_TIMER_DISABLED import org.jellyfin.androidtv.preference.constant.NextUpBehavior @@ -16,13 +17,18 @@ import org.jellyfin.androidtv.ui.preference.dsl.link import org.jellyfin.androidtv.ui.preference.dsl.list import org.jellyfin.androidtv.ui.preference.dsl.optionsScreen import org.jellyfin.androidtv.ui.preference.dsl.seekbar +import org.jellyfin.preference.store.PreferenceStore import org.jellyfin.sdk.model.api.MediaSegmentType import org.koin.android.ext.android.inject class PlaybackPreferencesScreen : OptionsFragment() { private val userPreferences: UserPreferences by inject() + private val userSettingPreferences: UserSettingPreferences by inject() private val mediaSegmentRepository: MediaSegmentRepository by inject() + override val stores: Array> + get() = arrayOf(userSettingPreferences) + override val screen by optionsScreen { setTitle(R.string.pref_playback) @@ -60,6 +66,19 @@ class PlaybackPreferencesScreen : OptionsFragment() { setContent(R.string.sum_enable_cinema_mode) bind(userPreferences, UserPreferences.cinemaModeEnabled) } + + @Suppress("MagicNumber") + seekbar { + setTitle(R.string.skip_forward_length) + setContent(R.string.skip_forward_length) + min = 5_000 + max = 30_000 + increment = 5_000 + valueFormatter = object : DurationSeekBarPreference.ValueFormatter() { + override fun display(value: Int) = "${value / 1000}s" + } + bind(userSettingPreferences, UserSettingPreferences.skipForwardLength) + } } category { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1299959c38..4085dfb23a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -528,6 +528,7 @@ Previews Recaps Unknown segments + Skip forward length %1$s second %1$s seconds From 3fb01ab52a8c5d079a9d31ee53f562224a056c00 Mon Sep 17 00:00:00 2001 From: kabel2 Date: Tue, 29 Oct 2024 23:04:33 +0100 Subject: [PATCH 2/9] Change default skipForwardLength to 30 seconds --- .../org/jellyfin/androidtv/preference/UserSettingPreferences.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt b/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt index 8933e67b23..0eb28839c5 100644 --- a/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt +++ b/app/src/main/java/org/jellyfin/androidtv/preference/UserSettingPreferences.kt @@ -15,7 +15,7 @@ class UserSettingPreferences( ) { companion object { val skipBackLength = intPreference("skipBackLength", 10_000) - val skipForwardLength = intPreference("skipForwardLength", 10_000) + val skipForwardLength = intPreference("skipForwardLength", 30_000) val homesection0 = enumPreference("homesection0", HomeSectionType.LIBRARY_TILES_SMALL) val homesection1 = enumPreference("homesection1", HomeSectionType.RESUME) From fe47f85b9bec5cc3d09c2f31be613ba4d40c8f87 Mon Sep 17 00:00:00 2001 From: kabel2 Date: Tue, 29 Oct 2024 23:05:24 +0100 Subject: [PATCH 3/9] Add variable for skipForwardLength --- .../ui/playback/overlay/LeanbackOverlayFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java index e7f7cf6b5b..3b7ddb07c7 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java @@ -20,7 +20,7 @@ public class LeanbackOverlayFragment extends PlaybackSupportFragment { private VideoPlayerAdapter playerAdapter; private boolean shouldShowOverlay = true; private Lazy playbackControllerContainer = inject(PlaybackControllerContainer.class); - private final Integer skipForwardLength = KoinJavaComponent.get(UserSettingPreferences.class).get(UserSettingPreferences.Companion.getSkipForwardLength()); + private final Lazy userSettingPreferences = inject(UserSettingPreferences.class); @Override public void onCreate(Bundle savedInstanceState) { @@ -79,7 +79,10 @@ public void mediaInfoChanged() { playerGlue.invalidatePlaybackControls(); playerGlue.setSeekEnabled(playerAdapter.canSeek()); + + Integer skipForwardLength = userSettingPreferences.getValue().get(UserSettingPreferences.Companion.getSkipForwardLength()); playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter, skipForwardLength) : null); + recordingStateChanged(); playerAdapter.updateDuration(); } From 0fccfd58c56dcb9e3948d83adb1d5fe45ee0bad6 Mon Sep 17 00:00:00 2001 From: kabel2 Date: Wed, 6 Nov 2024 19:30:12 +0100 Subject: [PATCH 4/9] Fix merge --- .../androidtv/ui/playback/overlay/CustomSeekProvider.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt index 15aa85993c..929fc828a2 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt @@ -23,6 +23,9 @@ class CustomSeekProvider( private val trickPlayEnabled: Boolean, private val forwardTime: Int ) : PlaybackSeekDataProvider() { + companion object { + private const val SEEK_LENGTH = 10000L + } private val imageRequests = mutableMapOf() override fun getSeekPositions(): LongArray { From a920da7593b3a4d0b93d9422335005badc95db63 Mon Sep 17 00:00:00 2001 From: kabel2 Date: Wed, 6 Nov 2024 19:38:07 +0100 Subject: [PATCH 5/9] Fix merge --- .../androidtv/ui/playback/overlay/CustomSeekProvider.kt | 5 +---- .../ui/playback/overlay/LeanbackOverlayFragment.java | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt index 929fc828a2..9647f78a0a 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt @@ -23,9 +23,6 @@ class CustomSeekProvider( private val trickPlayEnabled: Boolean, private val forwardTime: Int ) : PlaybackSeekDataProvider() { - companion object { - private const val SEEK_LENGTH = 10000L - } private val imageRequests = mutableMapOf() override fun getSeekPositions(): LongArray { @@ -51,7 +48,7 @@ class CustomSeekProvider( val trickPlayInfo = trickPlayResolutions?.values?.firstOrNull() if (trickPlayInfo == null) return - val currentTimeMs = (index * SEEK_LENGTH).coerceIn(0, videoPlayerAdapter.duration) + val currentTimeMs = (index * forwardTime.toLong()).coerceIn(0, videoPlayerAdapter.duration) val currentTile = currentTimeMs.floorDiv(trickPlayInfo.interval).toInt() val tileSize = trickPlayInfo.tileWidth * trickPlayInfo.tileHeight diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java index fdd75c7f97..32a8f0175f 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java @@ -104,10 +104,9 @@ public void mediaInfoChanged() { playerGlue.setSeekEnabled(playerAdapter.canSeek()); Integer skipForwardLength = userSettingPreferences.getValue().get(UserSettingPreferences.Companion.getSkipForwardLength()); - playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter, skipForwardLength) : null); boolean enableTrickPlay = userPreferences.getValue().get(UserPreferences.Companion.getTrickPlayEnabled()); - playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter, imageLoader.getValue(), api.getValue(), requireContext(), enableTrickPlay) : null); + playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter, imageLoader.getValue(), api.getValue(), requireContext(), enableTrickPlay, skipForwardLength) : null); recordingStateChanged(); playerAdapter.updateDuration(); } From f785d6e4a34a60702f5cec424969fede2e0b39b2 Mon Sep 17 00:00:00 2001 From: kabel2 Date: Wed, 6 Nov 2024 19:54:21 +0100 Subject: [PATCH 6/9] Try fix tests --- .../kotlin/ui/playback/overlay/CustomSeekProviderTests.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt b/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt index 29917b5b39..d5d2366ac0 100644 --- a/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt +++ b/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt @@ -11,7 +11,7 @@ class CustomSeekProviderTests : FunSpec({ every { canSeek() } returns true every { duration } returns 30000L } - val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false) + val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, mockk()) customSeekProvider.seekPositions shouldBe arrayOf(0L, 10000L, 20000L, 30000L) } @@ -21,7 +21,7 @@ class CustomSeekProviderTests : FunSpec({ every { canSeek() } returns true every { duration } returns 45000L } - val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false) + val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, mockk()) customSeekProvider.seekPositions shouldBe arrayOf(0L, 10000, 20000, 30000, 40000, 45000) } @@ -30,7 +30,7 @@ class CustomSeekProviderTests : FunSpec({ val videoPlayerAdapter = mockk { every { canSeek() } returns false } - val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false) + val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, mockk()) customSeekProvider.seekPositions.size shouldBe 0 } From 4304026ffa7ff6d60be19925c66764412dc08cb3 Mon Sep 17 00:00:00 2001 From: kabel2 Date: Wed, 6 Nov 2024 20:38:51 +0100 Subject: [PATCH 7/9] Fix test --- .../kotlin/ui/playback/overlay/CustomSeekProviderTests.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt b/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt index d5d2366ac0..fc3ac5c844 100644 --- a/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt +++ b/app/src/test/kotlin/ui/playback/overlay/CustomSeekProviderTests.kt @@ -11,7 +11,7 @@ class CustomSeekProviderTests : FunSpec({ every { canSeek() } returns true every { duration } returns 30000L } - val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, mockk()) + val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, 10_000) customSeekProvider.seekPositions shouldBe arrayOf(0L, 10000L, 20000L, 30000L) } @@ -21,7 +21,7 @@ class CustomSeekProviderTests : FunSpec({ every { canSeek() } returns true every { duration } returns 45000L } - val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, mockk()) + val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, 10_000) customSeekProvider.seekPositions shouldBe arrayOf(0L, 10000, 20000, 30000, 40000, 45000) } @@ -30,7 +30,7 @@ class CustomSeekProviderTests : FunSpec({ val videoPlayerAdapter = mockk { every { canSeek() } returns false } - val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, mockk()) + val customSeekProvider = CustomSeekProvider(videoPlayerAdapter, mockk(), mockk(), mockk(), false, 10_000) customSeekProvider.seekPositions.size shouldBe 0 } From 87afdad4f5085996cbef8196188ce96286b239c6 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Sun, 10 Nov 2024 14:36:01 +0100 Subject: [PATCH 8/9] Fix seekbar preference with minimum value above 100 --- .../jellyfin/androidtv/ui/preference/dsl/OptionsItemSeekbar.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/preference/dsl/OptionsItemSeekbar.kt b/app/src/main/java/org/jellyfin/androidtv/ui/preference/dsl/OptionsItemSeekbar.kt index 7c78faf734..2191401ddf 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/preference/dsl/OptionsItemSeekbar.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/preference/dsl/OptionsItemSeekbar.kt @@ -31,8 +31,9 @@ class OptionsItemSeekbar( it.isEnabled = dependencyCheckFun() && enabled it.isVisible = visible it.title = title - it.min = min + // Max must be set before min because the setter of min checks if the value is below the current value of max it.max = max + it.min = min it.seekBarIncrement = increment it.value = binder.get() it.showSeekBarValue = true From 5853d2298646230f7b62037fb40db122cb02947e Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Sun, 10 Nov 2024 14:39:34 +0100 Subject: [PATCH 9/9] Use long for forwardTime --- .../androidtv/ui/playback/overlay/CustomSeekProvider.kt | 6 +++--- .../ui/playback/overlay/LeanbackOverlayFragment.java | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt index 9647f78a0a..725f9a473f 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomSeekProvider.kt @@ -21,7 +21,7 @@ class CustomSeekProvider( private val api: ApiClient, private val context: Context, private val trickPlayEnabled: Boolean, - private val forwardTime: Int + private val forwardTime: Long ) : PlaybackSeekDataProvider() { private val imageRequests = mutableMapOf() @@ -30,7 +30,7 @@ class CustomSeekProvider( val duration = videoPlayerAdapter.duration val size = ceil(duration.toDouble() / forwardTime.toDouble()).toInt() + 1 - return LongArray(size) { i -> min(i * forwardTime.toLong(), duration) } + return LongArray(size) { i -> min(i * forwardTime, duration) } } override fun getThumbnail(index: Int, callback: ResultCallback) { @@ -48,7 +48,7 @@ class CustomSeekProvider( val trickPlayInfo = trickPlayResolutions?.values?.firstOrNull() if (trickPlayInfo == null) return - val currentTimeMs = (index * forwardTime.toLong()).coerceIn(0, videoPlayerAdapter.duration) + val currentTimeMs = (index * forwardTime).coerceIn(0, videoPlayerAdapter.duration) val currentTile = currentTimeMs.floorDiv(trickPlayInfo.interval).toInt() val tileSize = trickPlayInfo.tileWidth * trickPlayInfo.tileHeight diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java index 32a8f0175f..02f3133155 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/playback/overlay/LeanbackOverlayFragment.java @@ -9,12 +9,11 @@ import androidx.annotation.Nullable; import androidx.leanback.app.PlaybackSupportFragment; -import org.jellyfin.androidtv.preference.UserSettingPreferences; import org.jellyfin.androidtv.preference.UserPreferences; +import org.jellyfin.androidtv.preference.UserSettingPreferences; import org.jellyfin.androidtv.ui.playback.CustomPlaybackOverlayFragment; import org.jellyfin.androidtv.ui.playback.PlaybackController; import org.jellyfin.androidtv.ui.playback.PlaybackControllerContainer; -import org.koin.java.KoinJavaComponent; import org.jellyfin.sdk.api.client.ApiClient; import coil.ImageLoader; @@ -103,8 +102,7 @@ public void mediaInfoChanged() { playerGlue.invalidatePlaybackControls(); playerGlue.setSeekEnabled(playerAdapter.canSeek()); - Integer skipForwardLength = userSettingPreferences.getValue().get(UserSettingPreferences.Companion.getSkipForwardLength()); - + long skipForwardLength = userSettingPreferences.getValue().get(UserSettingPreferences.Companion.getSkipForwardLength()).longValue(); boolean enableTrickPlay = userPreferences.getValue().get(UserPreferences.Companion.getTrickPlayEnabled()); playerGlue.setSeekProvider(playerAdapter.canSeek() ? new CustomSeekProvider(playerAdapter, imageLoader.getValue(), api.getValue(), requireContext(), enableTrickPlay, skipForwardLength) : null); recordingStateChanged();