forked from recloudstream/cloudstream
small fixes
This commit is contained in:
parent
1a58734b7d
commit
64ce14e290
6 changed files with 50 additions and 20 deletions
|
@ -88,7 +88,7 @@ dependencies {
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
implementation 'androidx.core:core-ktx:1.7.0'
|
implementation 'androidx.core:core-ktx:1.7.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
implementation 'com.google.android.material:material:1.4.0'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0-beta02'
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0-beta02'
|
||||||
|
@ -118,9 +118,9 @@ dependencies {
|
||||||
// implementation "androidx.leanback:leanback-paging:1.1.0-alpha09"
|
// implementation "androidx.leanback:leanback-paging:1.1.0-alpha09"
|
||||||
|
|
||||||
// Exoplayer
|
// Exoplayer
|
||||||
implementation 'com.google.android.exoplayer:exoplayer:2.15.1'
|
implementation 'com.google.android.exoplayer:exoplayer:2.16.1'
|
||||||
implementation 'com.google.android.exoplayer:extension-cast:2.15.1'
|
implementation 'com.google.android.exoplayer:extension-cast:2.16.1'
|
||||||
implementation "com.google.android.exoplayer:extension-mediasession:2.15.1"
|
implementation "com.google.android.exoplayer:extension-mediasession:2.16.1"
|
||||||
//implementation "com.google.android.exoplayer:extension-leanback:2.14.0"
|
//implementation "com.google.android.exoplayer:extension-leanback:2.14.0"
|
||||||
|
|
||||||
// Bug reports
|
// Bug reports
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
|
||||||
<data android:scheme="https" android:host="gogoanime.vc" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="gogoanime.vc" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="allanime.site" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="animeflick.net" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="animeflick.net" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="kawaiifu.com" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="kawaiifu.com" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="tenshi.moe" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="tenshi.moe" android:pathPrefix="/"/>
|
||||||
|
@ -57,11 +58,16 @@
|
||||||
<data android:scheme="https" android:host="hdm.to" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="hdm.to" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="www.vmovee.watch" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="www.vmovee.watch" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="www.wcostream.com" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="www.wcostream.com" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="allmoviesforyou.co" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="allmoviesforyou.net" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="asiaflix.app" android:pathPrefix="/"/>
|
|
||||||
<data android:scheme="https" android:host="www.thenos.org" android:pathPrefix="/"/>
|
|
||||||
<data android:scheme="https" android:host="vidembed.cc" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="vidembed.cc" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="vf-film.me" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="vf-serie.org" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="asianembed.io" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="sflix.to" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="dopebox.to" android:pathPrefix="/"/>
|
||||||
<data android:scheme="https" android:host="trailers.to" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="trailers.to" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="zoro.to" android:pathPrefix="/"/>
|
||||||
|
<data android:scheme="https" android:host="asiaflix.app" android:pathPrefix="/"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
|
|
|
@ -221,8 +221,8 @@ class HomeFragment : Fragment() {
|
||||||
) { callback ->
|
) { callback ->
|
||||||
handleSearchClickCallback(activity, callback)
|
handleSearchClickCallback(activity, callback)
|
||||||
}
|
}
|
||||||
home_main_poster_recyclerview.post {
|
home_main_poster_recyclerview?.post {
|
||||||
(home_main_poster_recyclerview.layoutManager as CenterZoomLayoutManager?)?.let { manager ->
|
(home_main_poster_recyclerview?.layoutManager as CenterZoomLayoutManager?)?.let { manager ->
|
||||||
manager.updateSize(forceUpdate = true)
|
manager.updateSize(forceUpdate = true)
|
||||||
if (randomSize > 2) {
|
if (randomSize > 2) {
|
||||||
manager.scrollToPosition(randomSize / 2)
|
manager.scrollToPosition(randomSize / 2)
|
||||||
|
@ -409,7 +409,7 @@ class HomeFragment : Fragment() {
|
||||||
LinearSnapHelper().attachToRecyclerView(home_main_poster_recyclerview) // snap
|
LinearSnapHelper().attachToRecyclerView(home_main_poster_recyclerview) // snap
|
||||||
val centerLayoutManager = CenterZoomLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
val centerLayoutManager = CenterZoomLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
||||||
centerLayoutManager.setOnSizeListener { index ->
|
centerLayoutManager.setOnSizeListener { index ->
|
||||||
(home_main_poster_recyclerview.adapter as HomeChildItemAdapter?)?.cardList?.get(index)?.let { random ->
|
(home_main_poster_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList?.get(index)?.let { random ->
|
||||||
home_main_play.setOnClickListener {
|
home_main_play.setOnClickListener {
|
||||||
activity.loadSearchResult(random, START_ACTION_RESUME_LATEST)
|
activity.loadSearchResult(random, START_ACTION_RESUME_LATEST)
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ class HomeFragment : Fragment() {
|
||||||
} else ""
|
} else ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
home_main_poster_recyclerview.layoutManager = centerLayoutManager // scale
|
home_main_poster_recyclerview?.layoutManager = centerLayoutManager // scale
|
||||||
|
|
||||||
reloadStored()
|
reloadStored()
|
||||||
val apiName = context?.getKey<String>(HOMEPAGE_API)
|
val apiName = context?.getKey<String>(HOMEPAGE_API)
|
||||||
|
|
|
@ -119,6 +119,7 @@ const val EXTRA_CONTROL_TYPE = "control_type"
|
||||||
const val PLAYBACK_SPEED = "playback_speed"
|
const val PLAYBACK_SPEED = "playback_speed"
|
||||||
const val RESIZE_MODE_KEY = "resize_mode" // Last used resize mode
|
const val RESIZE_MODE_KEY = "resize_mode" // Last used resize mode
|
||||||
const val PLAYBACK_SPEED_KEY = "playback_speed" // Last used playback speed
|
const val PLAYBACK_SPEED_KEY = "playback_speed" // Last used playback speed
|
||||||
|
const val PREFERRED_SUBS_KEY = "preferred_subtitles" // Last used resize mode
|
||||||
|
|
||||||
const val OPENING_PERCENTAGE = 50
|
const val OPENING_PERCENTAGE = 50
|
||||||
const val AUTOLOAD_NEXT_EPISODE_PERCENTAGE = 80
|
const val AUTOLOAD_NEXT_EPISODE_PERCENTAGE = 80
|
||||||
|
@ -1428,6 +1429,10 @@ class PlayerFragment : Fragment() {
|
||||||
playbackPosition = it
|
playbackPosition = it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arguments?.getString(PREFERRED_SUBS_KEY)?.let {
|
||||||
|
setPreferredSubLanguage(it)
|
||||||
|
}
|
||||||
|
|
||||||
sources_btt.visibility =
|
sources_btt.visibility =
|
||||||
if (isDownloadedFile)
|
if (isDownloadedFile)
|
||||||
if (context?.getSubs()?.isNullOrEmpty() != false)
|
if (context?.getSubs()?.isNullOrEmpty() != false)
|
||||||
|
@ -1443,11 +1448,17 @@ class PlayerFragment : Fragment() {
|
||||||
isFullscreen = savedInstanceState.getBoolean(STATE_PLAYER_FULLSCREEN)
|
isFullscreen = savedInstanceState.getBoolean(STATE_PLAYER_FULLSCREEN)
|
||||||
isPlayerPlaying = savedInstanceState.getBoolean(STATE_PLAYER_PLAYING)
|
isPlayerPlaying = savedInstanceState.getBoolean(STATE_PLAYER_PLAYING)
|
||||||
resizeMode = savedInstanceState.getInt(RESIZE_MODE_KEY)
|
resizeMode = savedInstanceState.getInt(RESIZE_MODE_KEY)
|
||||||
|
savedInstanceState.getString(PREFERRED_SUBS_KEY)?.let {
|
||||||
|
setPreferredSubLanguage(it)
|
||||||
|
}
|
||||||
|
savedInstanceState.getString("data")?.let {
|
||||||
|
playerData = mapper.readValue(it)
|
||||||
|
}
|
||||||
playbackSpeed = savedInstanceState.getFloat(PLAYBACK_SPEED)
|
playbackSpeed = savedInstanceState.getFloat(PLAYBACK_SPEED)
|
||||||
}
|
}
|
||||||
|
|
||||||
resizeMode = requireContext().getKey(RESIZE_MODE_KEY, 0)!!
|
resizeMode = context?.getKey(RESIZE_MODE_KEY, 0) ?: 0
|
||||||
playbackSpeed = requireContext().getKey(PLAYBACK_SPEED_KEY, 1f)!!
|
playbackSpeed = context?.getKey(PLAYBACK_SPEED_KEY, 1f) ?: 1f
|
||||||
|
|
||||||
activity?.let {
|
activity?.let {
|
||||||
it.contentResolver?.registerContentObserver(
|
it.contentResolver?.registerContentObserver(
|
||||||
|
@ -1666,7 +1677,7 @@ class PlayerFragment : Fragment() {
|
||||||
|
|
||||||
changeSkip()
|
changeSkip()
|
||||||
|
|
||||||
// initPlayer()
|
initPlayer()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getCurrentUrl(): ExtractorLink? {
|
private fun getCurrentUrl(): ExtractorLink? {
|
||||||
|
@ -1741,7 +1752,7 @@ class PlayerFragment : Fragment() {
|
||||||
if (item.getId() == id) {
|
if (item.getId() == id) {
|
||||||
if (sorted.size > i + 1) {
|
if (sorted.size > i + 1) {
|
||||||
setMirrorId(sorted[i + 1].getId())
|
setMirrorId(sorted[i + 1].getId())
|
||||||
initPlayer()
|
initPlayer(getCurrentUrl())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1769,7 +1780,13 @@ class PlayerFragment : Fragment() {
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
if (!isCurrentlyPlaying) {
|
if (!isCurrentlyPlaying) {
|
||||||
initPlayer()
|
if (isDownloadedFile) {
|
||||||
|
initPlayer(null, uriData.uri)
|
||||||
|
} else {
|
||||||
|
getCurrentUrl()?.let {
|
||||||
|
initPlayer(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (player_view != null) player_view?.onResume()
|
if (player_view != null) player_view?.onResume()
|
||||||
}
|
}
|
||||||
|
@ -1790,7 +1807,13 @@ class PlayerFragment : Fragment() {
|
||||||
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||||
if (Util.SDK_INT <= 23) {
|
if (Util.SDK_INT <= 23) {
|
||||||
if (!isCurrentlyPlaying) {
|
if (!isCurrentlyPlaying) {
|
||||||
initPlayer()
|
if (isDownloadedFile) {
|
||||||
|
initPlayer(null, uriData.uri)
|
||||||
|
} else {
|
||||||
|
getCurrentUrl()?.let {
|
||||||
|
initPlayer(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (player_view != null) player_view?.onResume()
|
if (player_view != null) player_view?.onResume()
|
||||||
}
|
}
|
||||||
|
@ -1864,6 +1887,7 @@ class PlayerFragment : Fragment() {
|
||||||
arguments?.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen)
|
arguments?.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen)
|
||||||
arguments?.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
|
arguments?.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
|
||||||
arguments?.putInt(RESIZE_MODE_KEY, resizeMode)
|
arguments?.putInt(RESIZE_MODE_KEY, resizeMode)
|
||||||
|
arguments?.putString(PREFERRED_SUBS_KEY, preferredSubtitles)
|
||||||
arguments?.putFloat(PLAYBACK_SPEED, playbackSpeed)
|
arguments?.putFloat(PLAYBACK_SPEED, playbackSpeed)
|
||||||
if (!isDownloadedFile && this::playerData.isInitialized) {
|
if (!isDownloadedFile && this::playerData.isInitialized) {
|
||||||
arguments?.putString("data", mapper.writeValueAsString(playerData))
|
arguments?.putString("data", mapper.writeValueAsString(playerData))
|
||||||
|
@ -1880,6 +1904,7 @@ class PlayerFragment : Fragment() {
|
||||||
outState.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen)
|
outState.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen)
|
||||||
outState.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
|
outState.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
|
||||||
outState.putInt(RESIZE_MODE_KEY, resizeMode)
|
outState.putInt(RESIZE_MODE_KEY, resizeMode)
|
||||||
|
outState.putString(PREFERRED_SUBS_KEY, preferredSubtitles)
|
||||||
outState.putFloat(PLAYBACK_SPEED, playbackSpeed)
|
outState.putFloat(PLAYBACK_SPEED, playbackSpeed)
|
||||||
if (!isDownloadedFile && this::playerData.isInitialized) {
|
if (!isDownloadedFile && this::playerData.isInitialized) {
|
||||||
outState.putString("data", mapper.writeValueAsString(playerData))
|
outState.putString("data", mapper.writeValueAsString(playerData))
|
||||||
|
|
|
@ -81,7 +81,6 @@ class CenterZoomLayoutManager : LinearLayoutManager {
|
||||||
if(waitForSnap != null) {
|
if(waitForSnap != null) {
|
||||||
this.getChildAt(snapChild ?: 1)?.let { view ->
|
this.getChildAt(snapChild ?: 1)?.let { view ->
|
||||||
LinearSnapHelper().calculateDistanceToFinalSnap(this,view)?.get(0)?.let { dx ->
|
LinearSnapHelper().calculateDistanceToFinalSnap(this,view)?.get(0)?.let { dx ->
|
||||||
println("DX: $dx")
|
|
||||||
waitForSnap?.invoke(dx)
|
waitForSnap?.invoke(dx)
|
||||||
waitForSnap = null
|
waitForSnap = null
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = "1.4.32"
|
ext.kotlin_version = "1.5.21"
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.android.tools.build:gradle:4.1.1"
|
classpath "com.android.tools.build:gradle:4.1.3"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|
Loading…
Reference in a new issue