Compare commits
6 Commits
af66d968cc
...
49e0b1ec29
Author | SHA1 | Date |
---|---|---|
Jannik | 49e0b1ec29 | |
Jannik | e8ab11d5ff | |
Jannik | 0bb433b5cb | |
Jannik | b05ecf64a6 | |
Jannik | 7a2f3ad265 | |
Jannik | 4f2bd4fd59 |
|
@ -10,8 +10,8 @@ android {
|
||||||
applicationId "org.mosad.teapod"
|
applicationId "org.mosad.teapod"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 4000 //00.04.000
|
versionCode 4100 //00.04.100
|
||||||
versionName "0.4.0"
|
versionName "0.4.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
resValue "string", "build_time", buildTime()
|
resValue "string", "build_time", buildTime()
|
||||||
|
@ -41,13 +41,13 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2'
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
|
||||||
|
|
||||||
implementation 'androidx.core:core-ktx:1.3.2'
|
implementation 'androidx.core:core-ktx:1.3.2'
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3'
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.3'
|
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
|
||||||
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
|
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
|
|
@ -395,6 +395,7 @@ object AoDParser {
|
||||||
.ignoreContentType(true)
|
.ignoreContentType(true)
|
||||||
.cookies(sessionCookies)
|
.cookies(sessionCookies)
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
|
.timeout(120000) // loading the playlist can take some time
|
||||||
.execute()
|
.execute()
|
||||||
|
|
||||||
//Gson().fromJson(res.body(), AoDObject::class.java)
|
//Gson().fromJson(res.body(), AoDObject::class.java)
|
||||||
|
|
|
@ -48,7 +48,7 @@ class MediaFragment(private val mediaId: Int) : Fragment() {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
binding.frameLoading.visibility = View.VISIBLE
|
binding.frameLoading.visibility = View.VISIBLE
|
||||||
|
|
||||||
// tab layout and pager TODO
|
// tab layout and pager
|
||||||
pagerAdapter = ScreenSlidePagerAdapter(requireActivity())
|
pagerAdapter = ScreenSlidePagerAdapter(requireActivity())
|
||||||
// fix material components issue #1878, if more tabs are added increase
|
// fix material components issue #1878, if more tabs are added increase
|
||||||
binding.pagerEpisodesSimilar.offscreenPageLimit = 2
|
binding.pagerEpisodesSimilar.offscreenPageLimit = 2
|
||||||
|
|
|
@ -50,9 +50,6 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
private lateinit var timerUpdates: TimerTask
|
private lateinit var timerUpdates: TimerTask
|
||||||
|
|
||||||
private var wasInPiP = false
|
private var wasInPiP = false
|
||||||
private var playWhenReady = true
|
|
||||||
private var currentWindow = 0
|
|
||||||
private var playbackPosition: Long = 0
|
|
||||||
private var remainingTime: Long = 0
|
private var remainingTime: Long = 0
|
||||||
|
|
||||||
private val rwdTime: Long = 10000.unaryMinus()
|
private val rwdTime: Long = 10000.unaryMinus()
|
||||||
|
@ -64,12 +61,6 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
setContentView(R.layout.activity_player)
|
setContentView(R.layout.activity_player)
|
||||||
hideBars() // Initial hide the bars
|
hideBars() // Initial hide the bars
|
||||||
|
|
||||||
savedInstanceState?.let {
|
|
||||||
currentWindow = it.getInt(getString(R.string.state_resume_window))
|
|
||||||
playbackPosition = it.getLong(getString(R.string.state_resume_position))
|
|
||||||
playWhenReady = it.getBoolean(getString(R.string.state_is_playing))
|
|
||||||
}
|
|
||||||
|
|
||||||
model.loadMedia(
|
model.loadMedia(
|
||||||
intent.getIntExtra(getString(R.string.intent_media_id), 0),
|
intent.getIntExtra(getString(R.string.intent_media_id), 0),
|
||||||
intent.getIntExtra(getString(R.string.intent_episode_id), 0)
|
intent.getIntExtra(getString(R.string.intent_episode_id), 0)
|
||||||
|
@ -110,34 +101,21 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
if (isInPiPMode()) { return }
|
|
||||||
|
|
||||||
if (Util.SDK_INT <= 23) {
|
if (isInPiPMode()) { return }
|
||||||
video_view?.onPause()
|
if (Util.SDK_INT <= 23) { onPauseOnStop() }
|
||||||
releasePlayer()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
super.onStop()
|
super.onStop()
|
||||||
if (Util.SDK_INT > 23) {
|
|
||||||
video_view?.onPause()
|
|
||||||
releasePlayer()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (Util.SDK_INT > 23) { onPauseOnStop() }
|
||||||
// if the player was in pip, it's on a different task
|
// if the player was in pip, it's on a different task
|
||||||
if (wasInPiP) { navToLauncherTask() }
|
if (wasInPiP) { navToLauncherTask() }
|
||||||
// if the player is in pip, remove the task, else we'll get a zombie
|
// if the player is in pip, remove the task, else we'll get a zombie
|
||||||
if (isInPiPMode()) { finishAndRemoveTask() }
|
if (isInPiPMode()) { finishAndRemoveTask() }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
|
||||||
outState.putInt(getString(R.string.state_resume_window), currentWindow)
|
|
||||||
outState.putLong(getString(R.string.state_resume_position), playbackPosition)
|
|
||||||
outState.putBoolean(getString(R.string.state_is_playing), playWhenReady)
|
|
||||||
super.onSaveInstanceState(outState)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* used, when the player is in pip and the user selects a new media
|
* used, when the player is in pip and the user selects a new media
|
||||||
*/
|
*/
|
||||||
|
@ -209,7 +187,6 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
* set play when ready and listeners
|
* set play when ready and listeners
|
||||||
*/
|
*/
|
||||||
private fun initExoPlayer() {
|
private fun initExoPlayer() {
|
||||||
model.player.playWhenReady = playWhenReady
|
|
||||||
model.player.addListener(object : Player.EventListener {
|
model.player.addListener(object : Player.EventListener {
|
||||||
override fun onPlaybackStateChanged(state: Int) {
|
override fun onPlaybackStateChanged(state: Int) {
|
||||||
super.onPlaybackStateChanged(state)
|
super.onPlaybackStateChanged(state)
|
||||||
|
@ -233,7 +210,7 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
})
|
})
|
||||||
|
|
||||||
// start playing the current episode, after all needed player components have been initialized
|
// start playing the current episode, after all needed player components have been initialized
|
||||||
model.playEpisode(model.currentEpisode, true, playbackPosition)
|
model.playEpisode(model.currentEpisode, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
@ -308,10 +285,8 @@ class PlayerActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun releasePlayer() {
|
private fun onPauseOnStop() {
|
||||||
playbackPosition = model.player.currentPosition
|
video_view?.onPause()
|
||||||
currentWindow = model.player.currentWindowIndex
|
|
||||||
playWhenReady = model.player.playWhenReady
|
|
||||||
model.player.pause()
|
model.player.pause()
|
||||||
timerUpdates.cancel()
|
timerUpdates.cancel()
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,9 @@ data class Media(
|
||||||
fun getEpisodeById(id: Int) = episodes.first { it.id == id }
|
fun getEpisodeById(id: Int) = episodes.first { it.id == id }
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO all val?
|
/**
|
||||||
|
* uses var, since the values are written in different steps
|
||||||
|
*/
|
||||||
data class Info(
|
data class Info(
|
||||||
var title: String = "",
|
var title: String = "",
|
||||||
var posterUrl: String = "",
|
var posterUrl: String = "",
|
||||||
|
@ -98,7 +100,6 @@ data class Stream(
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this class is used for tmdb responses
|
* this class is used for tmdb responses
|
||||||
* TODO why is runtime var?
|
|
||||||
*/
|
*/
|
||||||
data class TMDBResponse(
|
data class TMDBResponse(
|
||||||
val id: Int = 0,
|
val id: Int = 0,
|
||||||
|
@ -106,7 +107,7 @@ data class TMDBResponse(
|
||||||
val overview: String = "",
|
val overview: String = "",
|
||||||
val posterUrl: String = "",
|
val posterUrl: String = "",
|
||||||
val backdropUrl: String = "",
|
val backdropUrl: String = "",
|
||||||
var runtime: Int = 0
|
val runtime: Int = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
* Ein Fehler beim laden einiger Serien wurde behoben (#36)
|
After Width: | Height: | Size: 401 KiB |
After Width: | Height: | Size: 419 KiB |
After Width: | Height: | Size: 393 KiB |
After Width: | Height: | Size: 261 KiB |
|
@ -0,0 +1 @@
|
||||||
|
* fixed a issue where some tv shows could not be loaded (#36)
|