Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Video Zoom not remembered between player sessions #1007

Merged
merged 2 commits into from
Jul 26, 2024
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 @@ -12,5 +12,6 @@ fun MediumEntity.toVideoState(): VideoState {
subtitleTrackIndex = subtitleTrackIndex,
playbackSpeed = playbackSpeed,
externalSubs = UriListConverter.fromStringToList(externalSubs),
videoScale = videoScale,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ data class VideoState(
val subtitleTrackIndex: Int?,
val playbackSpeed: Float?,
val externalSubs: List<Uri>,
val videoScale: Float,
)
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class LocalMediaRepository @Inject constructor(
subtitleTrackIndex: Int?,
playbackSpeed: Float?,
externalSubs: List<Uri>,
videoScale: Float,
) {
Timber.d(
"save state for [$uri]: [$position, $audioTrackIndex, $subtitleTrackIndex, $playbackSpeed]",
Expand All @@ -63,6 +64,7 @@ class LocalMediaRepository @Inject constructor(
playbackSpeed = playbackSpeed,
externalSubs = UriListConverter.fromListToString(externalSubs),
lastPlayedTime = System.currentTimeMillis(),
videoScale = videoScale,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ interface MediaRepository {
fun getVideosFlow(): Flow<List<Video>>
fun getVideosFlowFromFolderPath(folderPath: String): Flow<List<Video>>
fun getFoldersFlow(): Flow<List<Folder>>
suspend fun saveVideoState(uri: String, position: Long, audioTrackIndex: Int?, subtitleTrackIndex: Int?, playbackSpeed: Float?, externalSubs: List<Uri>)
suspend fun saveVideoState(
uri: String,
position: Long,
audioTrackIndex: Int?,
subtitleTrackIndex: Int?,
playbackSpeed: Float?,
externalSubs: List<Uri>,
videoScale: Float,
)
suspend fun getVideoState(uri: String): VideoState?
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class FakeMediaRepository : MediaRepository {
subtitleTrackIndex: Int?,
playbackSpeed: Float?,
externalSubs: List<Uri>,
videoScale: Float,
) {
}

Expand Down
Loading
Loading