mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
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
|
?: return null
|
||||||
|
|
||||||
val m3u8 = "$mainUrl/m3u8/${data[1]}/${data[2]}/master.txt?s=1&cache=${data[4]}"
|
val m3u8 = "$mainUrl/m3u8/${data[1]}/${data[2]}/master.txt?s=1&cache=${data[4]}"
|
||||||
println("shiv : $m3u8")
|
//println("shiv : $m3u8")
|
||||||
return M3u8Helper.generateM3u8(
|
return M3u8Helper.generateM3u8(
|
||||||
name,
|
name,
|
||||||
m3u8,
|
m3u8,
|
||||||
|
|
|
@ -46,7 +46,6 @@ open class YoutubeExtractor : ExtractorApi() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
println("TRYING TO ExTRACT: $url")
|
|
||||||
if (ytVideos[url].isNullOrEmpty()) {
|
if (ytVideos[url].isNullOrEmpty()) {
|
||||||
val link =
|
val link =
|
||||||
YoutubeStreamLinkHandlerFactory.getInstance().fromUrl(
|
YoutubeStreamLinkHandlerFactory.getInstance().fromUrl(
|
||||||
|
|
|
@ -585,6 +585,11 @@ class HomeFragment : Fragment() {
|
||||||
setPageTransformer(HomeScrollTransformer())
|
setPageTransformer(HomeScrollTransformer())
|
||||||
val callback: OnPageChangeCallback = object : OnPageChangeCallback() {
|
val callback: OnPageChangeCallback = object : OnPageChangeCallback() {
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
|
|
||||||
|
// home_search?.isIconified = true
|
||||||
|
//home_search?.isVisible = true
|
||||||
|
//home_search?.clearFocus()
|
||||||
|
|
||||||
(home_preview_viewpager?.adapter as? HomeScrollAdapter)?.apply {
|
(home_preview_viewpager?.adapter as? HomeScrollAdapter)?.apply {
|
||||||
if (position >= itemCount - 1 && hasMoreItems) {
|
if (position >= itemCount - 1 && hasMoreItems) {
|
||||||
hasMoreItems = false // dont make two requests
|
hasMoreItems = false // dont make two requests
|
||||||
|
|
|
@ -587,7 +587,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
updateLockUI()
|
updateLockUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateUIVisibility() {
|
fun updateUIVisibility() {
|
||||||
val isGone = isLocked || !isShowing
|
val isGone = isLocked || !isShowing
|
||||||
var togglePlayerTitleGone = isGone
|
var togglePlayerTitleGone = isGone
|
||||||
context?.let {
|
context?.let {
|
||||||
|
@ -1306,12 +1306,6 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
showTracksDialogue()
|
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
|
// 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 ->
|
player_holder?.setOnTouchListener { callView, event ->
|
||||||
return@setOnTouchListener handleMotionEvent(callView, event)
|
return@setOnTouchListener handleMotionEvent(callView, event)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.lagradost.cloudstream3.ui.result
|
package com.lagradost.cloudstream3.ui.result
|
||||||
|
|
||||||
|
import android.animation.ValueAnimator
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
|
@ -7,9 +8,11 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
import androidx.core.view.isGone
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import com.discord.panels.PanelsChildGestureRegionObserver
|
import com.discord.panels.PanelsChildGestureRegionObserver
|
||||||
import com.lagradost.cloudstream3.R
|
import com.lagradost.cloudstream3.R
|
||||||
|
import com.lagradost.cloudstream3.ui.player.CSPlayerEvent
|
||||||
import com.lagradost.cloudstream3.ui.player.SubtitleData
|
import com.lagradost.cloudstream3.ui.player.SubtitleData
|
||||||
import com.lagradost.cloudstream3.utils.IOnBackPressed
|
import com.lagradost.cloudstream3.utils.IOnBackPressed
|
||||||
import kotlinx.android.synthetic.main.fragment_result.*
|
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.fragment_trailer.*
|
||||||
import kotlinx.android.synthetic.main.trailer_custom_layout.*
|
import kotlinx.android.synthetic.main.trailer_custom_layout.*
|
||||||
|
|
||||||
|
|
||||||
open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreenPlayer(),
|
open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreenPlayer(),
|
||||||
PanelsChildGestureRegionObserver.GestureRegionsListener, IOnBackPressed {
|
PanelsChildGestureRegionObserver.GestureRegionsListener, IOnBackPressed {
|
||||||
|
|
||||||
|
@ -60,14 +64,43 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
|
||||||
result_smallscreen_holder?.isVisible = !isFullScreenPlayer
|
result_smallscreen_holder?.isVisible = !isFullScreenPlayer
|
||||||
result_fullscreen_holder?.isVisible = isFullScreenPlayer
|
result_fullscreen_holder?.isVisible = isFullScreenPlayer
|
||||||
|
|
||||||
|
val to = sw * h / w
|
||||||
|
|
||||||
player_background?.apply {
|
player_background?.apply {
|
||||||
isVisible = true
|
isVisible = true
|
||||||
layoutParams =
|
layoutParams =
|
||||||
FrameLayout.LayoutParams(
|
FrameLayout.LayoutParams(
|
||||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
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 showMirrorsDialogue() {}
|
||||||
override fun showTracksDialogue() {}
|
override fun showTracksDialogue() {}
|
||||||
|
|
||||||
override fun openOnlineSubPicker(context: Context, imdbId: Long?, dismissCallback: () -> Unit) {}
|
override fun openOnlineSubPicker(
|
||||||
|
context: Context,
|
||||||
|
imdbId: Long?,
|
||||||
|
dismissCallback: () -> Unit
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
override fun subtitlesChanged() {}
|
override fun subtitlesChanged() {}
|
||||||
|
|
||||||
|
@ -124,6 +162,13 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
|
||||||
}
|
}
|
||||||
updateFullscreen(isFullScreenPlayer)
|
updateFullscreen(isFullScreenPlayer)
|
||||||
uiReset()
|
uiReset()
|
||||||
|
|
||||||
|
player_intro_play?.setOnClickListener {
|
||||||
|
player_intro_play?.isGone = true
|
||||||
|
player.handleEvent(CSPlayerEvent.Play)
|
||||||
|
updateUIVisibility()
|
||||||
|
fixPlayerSize()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed(): Boolean {
|
override fun onBackPressed(): Boolean {
|
||||||
|
|
|
@ -267,10 +267,10 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>-->
|
</FrameLayout>-->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/result_top_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp">
|
android:layout_height="200dp">
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/result_smallscreen_holder"
|
android:id="@+id/result_smallscreen_holder"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -279,10 +279,12 @@
|
||||||
|
|
||||||
<include layout="@layout/fragment_trailer" />
|
<include layout="@layout/fragment_trailer" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/result_poster_background_holder"
|
android:id="@+id/result_poster_background_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/result_poster_background"
|
android:id="@+id/result_poster_background"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -330,6 +332,7 @@
|
||||||
android:contentDescription="@string/result_poster_img_des"
|
android:contentDescription="@string/result_poster_img_des"
|
||||||
android:foreground="@drawable/outline_drawable"
|
android:foreground="@drawable/outline_drawable"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
tools:src="@drawable/example_poster" />
|
tools:src="@drawable/example_poster" />
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:id="@+id/player_background"
|
android:id="@+id/player_background"
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start|bottom"
|
android:layout_gravity="start|bottom"
|
||||||
android:padding="10dp"
|
android:padding="15dp"
|
||||||
android:text="@string/trailer"
|
android:text="@string/trailer"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
<item name="android:textColor">@color/chip_color_text</item>
|
<item name="android:textColor">@color/chip_color_text</item>
|
||||||
<item name="checkedIconTint">@color/chip_color_text</item>
|
<item name="checkedIconTint">@color/chip_color_text</item>
|
||||||
<item name="fontFamily">@font/google_sans</item>
|
<item name="fontFamily">@font/google_sans</item>
|
||||||
|
<item name="chipIconTint">@color/chip_color_text</item>
|
||||||
<item name="android:fontFamily">@font/google_sans</item>
|
<item name="android:fontFamily">@font/google_sans</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue