Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ import com.lagradost.cloudstream3.utils.PLAYREADY_DRM_UUID
import com.lagradost.cloudstream3.utils.SubtitleHelper.fromTagToLanguageName
import com.lagradost.cloudstream3.utils.WIDEVINE_DRM_UUID
import com.lagradost.cloudstream3.utils.videoskip.VideoSkipStamp
import com.lagradost.cloudstream4.AppSettings
import kotlinx.coroutines.delay
import okhttp3.Interceptor
import org.chromium.net.CronetEngine
Expand Down Expand Up @@ -1389,10 +1390,17 @@ class CS3IPlayer : IPlayer {
context.getString(if (context.isUsingMobileData()) R.string.quality_pref_mobile_data_key else R.string.quality_pref_key),
Int.MAX_VALUE
)
val settings = AppSettings(context)

try {
hasUsedFirstRender = false

val playWhenReady = if (settings.player.startPaused.get()) {
false
} else {
isPlaying // this keep the current state of the player
}

// ye this has to be a val for whatever reason
// this makes no sense
exoPlayer = buildExoPlayer(
Expand All @@ -1404,7 +1412,7 @@ class CS3IPlayer : IPlayer {
playBackSpeed,
cacheSize = cacheSize,
videoBufferMs = videoBufferMs,
playWhenReady = isPlaying, // this keep the current state of the player
playWhenReady = playWhenReady,
subtitleOffset = currentSubtitleOffset,
maxVideoHeight = maxVideoHeight,
audioSources = audioSources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ object SettingsPlayerScreen : SearchableSettings {
subtitle = stringResource(R.string.autoplay_next_settings_des),
icon = painterResource(R.drawable.skip_next_24px),
),
Preference.PreferenceItem.SwitchPreference(
preference = settings.player.startPaused,
title = stringResource(R.string.start_paused_settings),
subtitle = stringResource(R.string.start_paused_settings_des),
icon = painterResource(R.drawable.pause_24px),
),
Preference.PreferenceItem.SwitchPreference(
preference = settings.player.skipOpEnabled,
title = stringResource(R.string.video_skip_op),
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/pause_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="#fff">
<path
android:fillColor="#fff"
android:pathData="M520,760L520,200L760,200L760,760L520,760ZM200,760L200,200L440,200L440,760L200,760ZM600,680L680,680L680,280L600,280L600,680ZM280,680L360,680L360,280L280,280L280,680ZM280,280L280,280L280,680L280,680L280,280ZM600,280L600,280L600,680L600,680L600,280Z"/>
</vector>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@
<string name="swipe_to_change_settings_des">Slide up or down on the left or right side to change brightness or volume</string>
<string name="autoplay_next_settings">Autoplay next episode</string>
<string name="autoplay_next_settings_des">Start the next episode when the current one ends</string>
<string name="start_paused_settings">Start videos paused</string>
<string name="start_paused_settings_des">Reduce stress when selecting sources</string>
<string name="double_tap_to_seek_settings">Double tap to seek</string>
<string name="double_tap_to_pause_settings">Double tap to pause</string>
<string name="double_tap_to_seek_amount_settings">Player seek amount (Seconds)</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class PlayerPreferences(preferences: PreferenceStore) {
val speedEnabled = preferences.getBoolean("playback_speed_enabled_key", false)
val tiktokEnabled = preferences.getBoolean("speedup_key", false)
val autoPlayEnabled = preferences.getBoolean("autoplay_next_key", true)
val startPaused = preferences.getBoolean("start_paused_key", false)
val skipOpEnabled = preferences.getBoolean("enable_skip_op_from_database", true)
val autoRotateEnabled = preferences.getBoolean("auto_rotate_video_key", true)
val rotateButtonEnabled = preferences.getBoolean("rotate_video_key", false)
Expand Down