Skip to content

Commit

Permalink
fix: exoplayer initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelonion committed Apr 19, 2024
1 parent 865b96a commit 386e02a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ output.json

#other
scripts/

#crowdin
crowdin.yml
3 changes: 2 additions & 1 deletion app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,8 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
}
}.show()
dialog.window?.setDimAmount(0.8f)
} else buildExoplayer()
}
if (!this::exoPlayer.isInitialized) buildExoplayer()

val isDisabled = (subtitle == null && hasExtSubtitles)
exoPlayer.trackSelectionParameters = exoPlayer.trackSelectionParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class SettingsAddonActivity : AppCompatActivity() {
private val downloadAddonManager: DownloadAddonManager = Injekt.get()
private val torrentAddonManager: TorrentAddonManager = Injekt.get()

@OptIn(DelicateCoroutinesApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ThemeManager(this).applyTheme()
Expand Down Expand Up @@ -193,7 +192,7 @@ class SettingsAddonActivity : AppCompatActivity() {
Injekt.get<TorrentAddonManager>().extension?.let {
if (isChecked) {
lifecycleScope.launchIO {
if (!ServerService.isRunning()) {
if (!ServerService.isRunning() && torrentAddonManager.isAvailable()) {
ServerService.start()
}
}
Expand Down

0 comments on commit 386e02a

Please sign in to comment.