make seekbar auto seek optional

This commit is contained in:
Bnyro 2022-07-20 14:05:17 +02:00
parent 97e3cfd283
commit 260e3d6111
5 changed files with 28 additions and 2 deletions

View File

@ -163,6 +163,7 @@ class PlayerFragment : Fragment() {
private var videoFormatPreference = "WEBM"
private var defRes = ""
private var bufferingGoal = 50000
private var seekBarPreview = false
/**
* for autoplay
@ -298,6 +299,11 @@ class PlayerFragment : Fragment() {
PreferenceKeys.BUFFERING_GOAL,
"50"
)?.toInt()!! * 1000
seekBarPreview = PreferenceHelper.getBoolean(
PreferenceKeys.SEEKBAR_PREVIEW,
false
)
}
private fun setSponsorBlockPrefs() {
@ -912,7 +918,7 @@ class PlayerFragment : Fragment() {
playerBinding.exoTitle.text = response.title
enableSeekbarPreview()
if (seekBarPreview) enableSeekbarPreview()
enableDoubleTapToSeek()
// init the chapters recyclerview

View File

@ -51,6 +51,7 @@ object PreferenceKeys {
const val PLAYER_VIDEO_FORMAT = "player_video_format"
const val DEFAULT_RESOLUTION = "default_res"
const val BUFFERING_GOAL = "buffering_goal"
const val SEEKBAR_PREVIEW = "seekbar_preview"
/**
* Download

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#FF000000"
android:pathData="M24,31.5q3.55,0 6.025,-2.475Q32.5,26.55 32.5,23q0,-3.55 -2.475,-6.025Q27.55,14.5 24,14.5q-3.55,0 -6.025,2.475Q15.5,19.45 15.5,23q0,3.55 2.475,6.025Q20.45,31.5 24,31.5ZM24,28.6q-2.35,0 -3.975,-1.625T18.4,23q0,-2.35 1.625,-3.975T24,17.4q2.35,0 3.975,1.625T29.6,23q0,2.35 -1.625,3.975T24,28.6ZM24,38q-7.3,0 -13.2,-4.15Q4.9,29.7 2,23q2.9,-6.7 8.8,-10.85Q16.7,8 24,8q7.3,0 13.2,4.15Q43.1,16.3 46,23q-2.9,6.7 -8.8,10.85Q31.3,38 24,38Z" />
</vector>

View File

@ -232,7 +232,7 @@
<string name="chapters">Chapters</string>
<string name="change_playback_speed">Playback speed</string>
<string name="require_restart">Restart required</string>
<string name="require_restart_message">This change requires an app restart. Do you want to restart the app now? Otherwise the changes will be applied on the next app restart.</string>
<string name="require_restart_message">These changes might not be applied without restarting the app. Do you want to restart the app now?</string>
<string name="navLabelVisibility">Navbar label visibility</string>
<string name="always">Always</string>
<string name="selected">Selected</string>
@ -253,4 +253,6 @@
<string name="captions">Captions</string>
<string name="none">None</string>
<string name="update_now">Do you want to update the app now?</string>
<string name="seekbar_preview">Seekbar preview</string>
<string name="seekbar_preview_summary">Preview the video by seeking to the position when scrubbing the seekbar.</string>
</resources>

View File

@ -71,6 +71,13 @@
app:key="pause_screen_off"
app:title="@string/pauseOnScreenOff" />
<SwitchPreferenceCompat
android:defaultValue="false"
android:icon="@drawable/ic_visibility"
android:summary="@string/seekbar_preview_summary"
android:title="@string/seekbar_preview"
app:key="seekbar_preview" />
<SwitchPreferenceCompat
android:icon="@drawable/ic_rotating_circle"
android:summary="@string/autoRotatePlayer_summary"