From 1c3f5613c99472e3ed1fd370992a91898ed3e4e0 Mon Sep 17 00:00:00 2001 From: Abdallah <54363735+abdallahmehiz@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:28:22 +0100 Subject: [PATCH] feat(player): Support for external sub/audio (#1206) Co-authored-by: Quickdesh Co-authored-by: jmir1 --- .../tachiyomi/ui/player/PlayerActivity.kt | 80 ++++---- .../tachiyomi/ui/player/PlayerViewModel.kt | 14 +- .../settings/sheets/StreamsCatalogSheet.kt | 188 ++++++++++++++++++ .../settings/sheets/TracksListingSheet.kt | 124 ------------ .../sheets/subtitle/SubtitleDelayPage.kt | 12 +- .../sheets/subtitle/SubtitleSettingsSheet.kt | 2 +- .../ui/player/viewer/PlayerControlsView.kt | 2 +- app/src/main/res/layout/player_controls.xml | 8 +- i18n/src/main/res/values/strings-aniyomi.xml | 4 + 9 files changed, 251 insertions(+), 183 deletions(-) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/StreamsCatalogSheet.kt delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/TracksListingSheet.kt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt index 919b4ab4b..8971cb2ba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt @@ -55,7 +55,7 @@ import eu.kanade.tachiyomi.ui.player.settings.dialogs.SkipIntroLengthDialog import eu.kanade.tachiyomi.ui.player.settings.dialogs.SpeedPickerDialog import eu.kanade.tachiyomi.ui.player.settings.sheets.PlayerSettingsSheet import eu.kanade.tachiyomi.ui.player.settings.sheets.ScreenshotOptionsSheet -import eu.kanade.tachiyomi.ui.player.settings.sheets.TracksCatalogSheet +import eu.kanade.tachiyomi.ui.player.settings.sheets.StreamsCatalogSheet import eu.kanade.tachiyomi.ui.player.settings.sheets.VideoChaptersSheet import eu.kanade.tachiyomi.ui.player.settings.sheets.subtitle.SubtitleSettingsSheet import eu.kanade.tachiyomi.ui.player.settings.sheets.subtitle.toHexString @@ -247,22 +247,19 @@ class PlayerActivity : BaseActivity() { private val animationHandler = Handler(Looper.getMainLooper()) + private val streams: PlayerViewModel.VideoStreams + get() = viewModel.state.value.videoStreams + private var currentVideoList: List