save location

This commit is contained in:
LagradOst 2023-11-02 22:08:41 +01:00
parent fca8a55e05
commit bef34c33e9
3 changed files with 6 additions and 3 deletions

View file

@ -265,7 +265,9 @@ abstract class AbstractPlayerFragment(
context?.getString(R.string.no_links_found_toast) + "\n" + message,
Toast.LENGTH_LONG
)
activity?.popCurrentPage()
activity?.runOnUiThread {
activity?.popCurrentPage()
}
}
}

View file

@ -1396,7 +1396,7 @@ class CS3IPlayer : IPlayer {
|| error.errorCode == PlaybackException.ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED
|| error.errorCode == PlaybackException.ERROR_CODE_IO_UNSPECIFIED
) -> {
val position = exoPlayer?.currentPosition ?: 0L
val gid = DownloadListener.sessionIdToGid[aria2cRequestId]
Log.i(TAG, "Aria2 error $error error ${error.errorCode}")
if(gid == null) {
@ -1432,6 +1432,7 @@ class CS3IPlayer : IPlayer {
// shitty solution to release it every time, however we will get timeout otherwise
CommonActivity.activity?.let { act ->
try {
playbackPosition = position
awaitAria2c(act, loadedLink, aria2cRequestId)
} catch (t : Throwable) {
event(ErrorEvent(t))

View file

@ -278,7 +278,7 @@ enum class ExtractorLinkType {
}
private fun inferTypeFromUrl(url: String): ExtractorLinkType {
val path = normalSafeApiCall { URL(url).path }
val path = try { URL(url).path } catch (_ : Throwable) { null }
return when {
path?.endsWith(".m3u8") == true || path?.endsWith(".m3u") == true -> ExtractorLinkType.M3U8
path?.endsWith(".mpd") == true -> ExtractorLinkType.DASH