Merge pull request #3479 from Bnyro/master

Preference to not play videos automatically
This commit is contained in:
Bnyro 2023-04-02 18:33:40 +02:00 committed by GitHub
commit 31a0acf4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -95,6 +95,7 @@ object PreferenceKeys {
const val AUTOPLAY_COUNTDOWN = "autoplay_countdown"
const val LBRY_HLS = "lbry_hls"
const val AUTO_FULLSCREEN_SHORTS = "auto_fullscreen_shorts"
const val PLAY_AUTOMATICALLY = "play_automatically"
/**
* Background mode

View File

@ -736,7 +736,9 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
trySeekToTimeStamp()
exoPlayer.prepare()
if (!DataSaverMode.isEnabled(requireContext())) exoPlayer.play()
if (PreferenceHelper.getBoolean(PreferenceKeys.PLAY_AUTOMATICALLY, true)) {
exoPlayer.play()
}
if (binding.playerMotionLayout.progress != 1.0f) {
// show controllers when not in picture in picture mode

View File

@ -460,6 +460,8 @@
<string name="new_group">New</string>
<string name="group_name">Group name</string>
<string name="edit_group">Edit group</string>
<string name="play_automatically">Play automatically</string>
<string name="play_automatically_summary">Start playing video automatically when selecting</string>
<!-- Notification channel strings -->
<string name="download_channel_name">Download Service</string>

View File

@ -13,6 +13,13 @@
app:key="data_saver_mode_key"
app:title="@string/data_saver_mode" />
<SwitchPreferenceCompat
android:defaultValue="true"
android:icon="@drawable/ic_play_circle"
android:summary="@string/play_automatically_summary"
app:key="play_automatically"
app:title="@string/play_automatically" />
<com.github.libretube.ui.views.SliderPreference
android:icon="@drawable/ic_download"
android:key="max_concurrent_downloads"