forked from recloudstream/cloudstream
small fix
This commit is contained in:
parent
b57a7c3772
commit
4a193d5d27
9 changed files with 71 additions and 24 deletions
|
@ -18,7 +18,7 @@ class BullStream : ExtractorApi() {
|
|||
?: return null
|
||||
|
||||
val m3u8 = "$mainUrl/m3u8/${data[1]}/${data[2]}/master.txt?s=1&cache=${data[4]}"
|
||||
println("shiv : $m3u8")
|
||||
//println("shiv : $m3u8")
|
||||
return M3u8Helper.generateM3u8(
|
||||
name,
|
||||
m3u8,
|
||||
|
|
|
@ -46,7 +46,6 @@ open class YoutubeExtractor : ExtractorApi() {
|
|||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
println("TRYING TO ExTRACT: $url")
|
||||
if (ytVideos[url].isNullOrEmpty()) {
|
||||
val link =
|
||||
YoutubeStreamLinkHandlerFactory.getInstance().fromUrl(
|
||||
|
|
|
@ -585,6 +585,11 @@ class HomeFragment : Fragment() {
|
|||
setPageTransformer(HomeScrollTransformer())
|
||||
val callback: OnPageChangeCallback = object : OnPageChangeCallback() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
|
||||
// home_search?.isIconified = true
|
||||
//home_search?.isVisible = true
|
||||
//home_search?.clearFocus()
|
||||
|
||||
(home_preview_viewpager?.adapter as? HomeScrollAdapter)?.apply {
|
||||
if (position >= itemCount - 1 && hasMoreItems) {
|
||||
hasMoreItems = false // dont make two requests
|
||||
|
|
|
@ -587,7 +587,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
|||
updateLockUI()
|
||||
}
|
||||
|
||||
private fun updateUIVisibility() {
|
||||
fun updateUIVisibility() {
|
||||
val isGone = isLocked || !isShowing
|
||||
var togglePlayerTitleGone = isGone
|
||||
context?.let {
|
||||
|
@ -1306,12 +1306,6 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
|||
showTracksDialogue()
|
||||
}
|
||||
|
||||
player_intro_play?.setOnClickListener {
|
||||
player_intro_play?.isGone = true
|
||||
player.handleEvent(CSPlayerEvent.Play)
|
||||
updateUIVisibility()
|
||||
}
|
||||
|
||||
// it is !not! a bug that you cant touch the right side, it does not register inputs on navbar or status bar
|
||||
player_holder?.setOnTouchListener { callView, event ->
|
||||
return@setOnTouchListener handleMotionEvent(callView, event)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.lagradost.cloudstream3.ui.result
|
||||
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Rect
|
||||
|
@ -7,9 +8,11 @@ import android.os.Bundle
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import com.discord.panels.PanelsChildGestureRegionObserver
|
||||
import com.lagradost.cloudstream3.R
|
||||
import com.lagradost.cloudstream3.ui.player.CSPlayerEvent
|
||||
import com.lagradost.cloudstream3.ui.player.SubtitleData
|
||||
import com.lagradost.cloudstream3.utils.IOnBackPressed
|
||||
import kotlinx.android.synthetic.main.fragment_result.*
|
||||
|
@ -19,6 +22,7 @@ import kotlinx.android.synthetic.main.fragment_result_tv.*
|
|||
import kotlinx.android.synthetic.main.fragment_trailer.*
|
||||
import kotlinx.android.synthetic.main.trailer_custom_layout.*
|
||||
|
||||
|
||||
open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreenPlayer(),
|
||||
PanelsChildGestureRegionObserver.GestureRegionsListener, IOnBackPressed {
|
||||
|
||||
|
@ -60,14 +64,43 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
|
|||
result_smallscreen_holder?.isVisible = !isFullScreenPlayer
|
||||
result_fullscreen_holder?.isVisible = isFullScreenPlayer
|
||||
|
||||
val to = sw * h / w
|
||||
|
||||
player_background?.apply {
|
||||
isVisible = true
|
||||
layoutParams =
|
||||
FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
if (isFullScreenPlayer) FrameLayout.LayoutParams.MATCH_PARENT else sw * h / w
|
||||
if (isFullScreenPlayer) FrameLayout.LayoutParams.MATCH_PARENT else to
|
||||
)
|
||||
}
|
||||
|
||||
player_intro_play?.apply {
|
||||
layoutParams =
|
||||
FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
result_top_holder?.measuredHeight ?: FrameLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
}
|
||||
|
||||
if (player_intro_play?.isGone == true) {
|
||||
result_top_holder?.apply {
|
||||
|
||||
val anim = ValueAnimator.ofInt(
|
||||
measuredHeight,
|
||||
if (isFullScreenPlayer) ViewGroup.LayoutParams.MATCH_PARENT else to
|
||||
)
|
||||
anim.addUpdateListener { valueAnimator ->
|
||||
val `val` = valueAnimator.animatedValue as Int
|
||||
val layoutParams: ViewGroup.LayoutParams =
|
||||
layoutParams
|
||||
layoutParams.height = `val`
|
||||
setLayoutParams(layoutParams)
|
||||
}
|
||||
anim.duration = 200
|
||||
anim.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +112,12 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
|
|||
override fun showMirrorsDialogue() {}
|
||||
override fun showTracksDialogue() {}
|
||||
|
||||
override fun openOnlineSubPicker(context: Context, imdbId: Long?, dismissCallback: () -> Unit) {}
|
||||
override fun openOnlineSubPicker(
|
||||
context: Context,
|
||||
imdbId: Long?,
|
||||
dismissCallback: () -> Unit
|
||||
) {
|
||||
}
|
||||
|
||||
override fun subtitlesChanged() {}
|
||||
|
||||
|
@ -124,6 +162,13 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
|
|||
}
|
||||
updateFullscreen(isFullScreenPlayer)
|
||||
uiReset()
|
||||
|
||||
player_intro_play?.setOnClickListener {
|
||||
player_intro_play?.isGone = true
|
||||
player.handleEvent(CSPlayerEvent.Play)
|
||||
updateUIVisibility()
|
||||
fixPlayerSize()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed(): Boolean {
|
||||
|
|
|
@ -267,10 +267,10 @@
|
|||
</LinearLayout>
|
||||
</FrameLayout>-->
|
||||
<FrameLayout
|
||||
android:id="@+id/result_top_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/result_smallscreen_holder"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -279,21 +279,23 @@
|
|||
|
||||
<include layout="@layout/fragment_trailer" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/result_poster_background_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/result_poster_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/background_shadow" />
|
||||
<ImageView
|
||||
android:id="@+id/result_poster_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/background_shadow" />
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
||||
|
@ -330,6 +332,7 @@
|
|||
android:contentDescription="@string/result_poster_img_des"
|
||||
android:foreground="@drawable/outline_drawable"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_gravity="bottom"
|
||||
tools:src="@drawable/example_poster" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/player_background"
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|bottom"
|
||||
android:padding="10dp"
|
||||
android:padding="15dp"
|
||||
android:text="@string/trailer"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
<item name="android:textColor">@color/chip_color_text</item>
|
||||
<item name="checkedIconTint">@color/chip_color_text</item>
|
||||
<item name="fontFamily">@font/google_sans</item>
|
||||
<item name="chipIconTint">@color/chip_color_text</item>
|
||||
<item name="android:fontFamily">@font/google_sans</item>
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in a new issue