mirror of
				https://github.com/recloudstream/cloudstream.git
				synced 2024-08-15 01:53:11 +00:00 
			
		
		
		
	fix quality on chromecast
This commit is contained in:
		
							parent
							
								
									c37a552ebf
								
							
						
					
					
						commit
						659d146dfe
					
				
					 5 changed files with 7 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -36,6 +36,7 @@ import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
 | 
			
		|||
import com.lagradost.cloudstream3.utils.DataStore.toKotlinObject
 | 
			
		||||
import com.lagradost.cloudstream3.utils.DataStoreHelper
 | 
			
		||||
import com.lagradost.cloudstream3.utils.ExtractorLink
 | 
			
		||||
import com.lagradost.cloudstream3.utils.Qualities
 | 
			
		||||
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
 | 
			
		||||
import org.json.JSONObject
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -182,7 +183,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
 | 
			
		|||
                    val contentUrl = (remoteMediaClient?.currentItem?.media?.contentUrl
 | 
			
		||||
                        ?: remoteMediaClient?.currentItem?.media?.contentId)
 | 
			
		||||
 | 
			
		||||
                    val sortingMethods = items.map { it.name }.toTypedArray()
 | 
			
		||||
                    val sortingMethods = items.map { "${it.name} ${Qualities.getStringByInt(it.quality)}" }.toTypedArray()
 | 
			
		||||
                    val sotringIndex = items.indexOfFirst { it.url == contentUrl }
 | 
			
		||||
 | 
			
		||||
                    val arrayAdapter =
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,7 +48,6 @@ class CS3IPlayer : IPlayer {
 | 
			
		|||
    private val seekActionTime = 30000L
 | 
			
		||||
 | 
			
		||||
    private var ignoreSSL: Boolean = true
 | 
			
		||||
    private var simpleCache: SimpleCache? = null
 | 
			
		||||
    private var playBackSpeed: Float = 1.0f
 | 
			
		||||
 | 
			
		||||
    private var lastMuteVolume: Float = 1.0f
 | 
			
		||||
| 
						 | 
				
			
			@ -306,6 +305,8 @@ class CS3IPlayer : IPlayer {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    companion object {
 | 
			
		||||
        private var simpleCache: SimpleCache? = null
 | 
			
		||||
 | 
			
		||||
        var requestSubtitleUpdate: (() -> Unit)? = null
 | 
			
		||||
 | 
			
		||||
        private fun createOnlineSource(link: ExtractorLink): DataSource.Factory {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -872,7 +872,6 @@ class ResultFragment : Fragment(), PanelsChildGestureRegionObserver.GestureRegio
 | 
			
		|||
                )
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            suspend fun requireLinks(isCasting: Boolean, displayLoading: Boolean = true): Boolean {
 | 
			
		||||
                val skipLoading = getApiFromName(apiName).instantLinkLoading
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,9 +30,9 @@ object CastHelper {
 | 
			
		|||
        movieMetadata.putString(
 | 
			
		||||
            MediaMetadata.KEY_SUBTITLE,
 | 
			
		||||
            if (holder.isMovie)
 | 
			
		||||
                link.name
 | 
			
		||||
                "${link.name} ${Qualities.getStringByInt(link.quality)}"
 | 
			
		||||
            else
 | 
			
		||||
                (epData.name ?: "Episode ${epData.episode}") + " - ${link.name}"
 | 
			
		||||
                (epData.name ?: "Episode ${epData.episode}") + " - ${link.name} ${Qualities.getStringByInt(link.quality)}"
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        holder.title?.let {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1113,13 +1113,7 @@ object VideoDownloadManager {
 | 
			
		|||
        logcatPrint("initialised the HLS downloader.")
 | 
			
		||||
 | 
			
		||||
        val m3u8 = M3u8Helper.M3u8Stream(
 | 
			
		||||
            link.url, when (link.quality) {
 | 
			
		||||
                -2 -> 360
 | 
			
		||||
                -1 -> 480
 | 
			
		||||
                1 -> 720
 | 
			
		||||
                2 -> 1080
 | 
			
		||||
                else -> null
 | 
			
		||||
            }, mapOf("referer" to link.referer)
 | 
			
		||||
            link.url, link.quality, mapOf("referer" to link.referer)
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        var realIndex = startIndex ?: 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue