mirror of
https://github.com/recloudstream/cloudstream.git
synced 2026-06-19 20:05:41 +00:00
Compare commits
2 commits
master
...
OnlyPlayer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfabda0e1c |
||
|
|
accbf4d806 |
2 changed files with 46 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ import com.lagradost.cloudstream3.actions.temp.MpvPackage
|
||||||
import com.lagradost.cloudstream3.actions.temp.MpvRxPackage
|
import com.lagradost.cloudstream3.actions.temp.MpvRxPackage
|
||||||
import com.lagradost.cloudstream3.actions.temp.MpvYTDLPackage
|
import com.lagradost.cloudstream3.actions.temp.MpvYTDLPackage
|
||||||
import com.lagradost.cloudstream3.actions.temp.NextPlayerPackage
|
import com.lagradost.cloudstream3.actions.temp.NextPlayerPackage
|
||||||
|
import com.lagradost.cloudstream3.actions.temp.OnlyPlayer
|
||||||
import com.lagradost.cloudstream3.actions.temp.PlayInBrowserAction
|
import com.lagradost.cloudstream3.actions.temp.PlayInBrowserAction
|
||||||
import com.lagradost.cloudstream3.actions.temp.PlayMirrorAction
|
import com.lagradost.cloudstream3.actions.temp.PlayMirrorAction
|
||||||
import com.lagradost.cloudstream3.actions.temp.ViewM3U8Action
|
import com.lagradost.cloudstream3.actions.temp.ViewM3U8Action
|
||||||
|
|
@ -65,6 +66,7 @@ object VideoClickActionHolder {
|
||||||
MpvYTDLPackage(),
|
MpvYTDLPackage(),
|
||||||
MpvKtPackage(),
|
MpvKtPackage(),
|
||||||
MpvKtPreviewPackage(),
|
MpvKtPreviewPackage(),
|
||||||
|
OnlyPlayer(),
|
||||||
MpvRxPackage(),
|
MpvRxPackage(),
|
||||||
// Always Ask option
|
// Always Ask option
|
||||||
AlwaysAskAction(),
|
AlwaysAskAction(),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.lagradost.cloudstream3.actions.temp
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.core.net.toUri
|
||||||
|
import com.lagradost.cloudstream3.actions.OpenInAppAction
|
||||||
|
import com.lagradost.cloudstream3.ui.result.LinkLoadingResult
|
||||||
|
import com.lagradost.cloudstream3.ui.result.ResultEpisode
|
||||||
|
import com.lagradost.cloudstream3.utils.txt
|
||||||
|
|
||||||
|
/** https://github.com/Kindness-Kismet/only_player/tree/main
|
||||||
|
* https://github.com/Kindness-Kismet/only_player/blob/main/feature/player/src/main/java/one/only/player/feature/player/PlayerActivity.kt */
|
||||||
|
class OnlyPlayer : OpenInAppAction(
|
||||||
|
txt("Only Player"),
|
||||||
|
"one.only.player",
|
||||||
|
intentClass = "one.only.player.feature.player.PlayerActivity"
|
||||||
|
) {
|
||||||
|
override val oneSource = true
|
||||||
|
override suspend fun putExtra(
|
||||||
|
context: Context,
|
||||||
|
intent: Intent,
|
||||||
|
video: ResultEpisode,
|
||||||
|
result: LinkLoadingResult,
|
||||||
|
index: Int?
|
||||||
|
) {
|
||||||
|
/** https://github.com/Kindness-Kismet/only_player/blob/d3f55049a2913fa762d31b311146073cc2da46cb/app/src/main/java/one/only/player/navigation/CloudNavGraph.kt#L39 */
|
||||||
|
intent.apply {
|
||||||
|
val link = result.links[index!!]
|
||||||
|
setData(link.url.toUri())
|
||||||
|
|
||||||
|
putExtra("headers", Bundle().apply {
|
||||||
|
for ((key, value) in link.headers) {
|
||||||
|
putExtra(key, value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResult(activity: Activity, intent: Intent?) {
|
||||||
|
/* onResult does not get called */
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue