MpvKtPreviewPackage

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val appName: UiText
Link copied to clipboard
open override val isPlayer: Boolean = true

if true, this action could be selected as default player (one press action) in settings

Link copied to clipboard
open override val name: UiText
Link copied to clipboard
open override val oneSource: Boolean = true

if true, the app will show dialog to select source - result.linksindex

Link copied to clipboard
Link copied to clipboard

Determines which plugin a given provider is from. This is the full path to the plugin.

Link copied to clipboard
open override val sourceTypes: Set<ExtractorLinkType>

Which type of sources this action can handle.

Functions

Link copied to clipboard
suspend fun launch(intent: Intent?, bundle: Bundle? = null)

Internally uses startActivity, use this when you don't have any result that needs to be stored when exiting the activity

Link copied to clipboard
suspend fun launchResult(intent: Intent?, options: <Error class: unknown class>? = null)

Internally uses activityResultLauncher, use this when the activity has a result like watched position

Link copied to clipboard
open override fun onResult(activity: Activity, intent: Intent?)

This function is called when the app is opened again after the intent was sent. You can use it to for example update duration and position.

Link copied to clipboard
fun onResultSafe(activity: Activity, intent: Intent?)

Safe version of onResult, we don't trust extension devs to not crash the app

Link copied to clipboard
open suspend override fun putExtra(context: Context, intent: Intent, video: ResultEpisode, result: LinkLoadingResult, index: Int?)

Before intent is sent, this function is called to put extra data into the intent.

Link copied to clipboard
open suspend override fun runAction(context: Context?, video: ResultEpisode, result: LinkLoadingResult, index: Int?)

This function is called when the action is clicked.

Link copied to clipboard
fun runActionSafe(context: Context?, video: ResultEpisode, result: LinkLoadingResult, index: Int?): Job

Safe version of runAction, as we don't trust extension devs to handle exceptions

Link copied to clipboard
open override fun shouldShow(context: Context?, video: ResultEpisode?): Boolean
Link copied to clipboard
fun shouldShowSafe(context: Context?, video: ResultEpisode?): Boolean

Safe version of shouldShow, as we don't trust extension devs to handle exceptions, however no dev should throw in shouldShow

Link copied to clipboard
suspend fun <T> uiThread(callable: Callable<T>): T?

Even if VideoClickAction should not run any UI code, startActivity requires it, this is a wrapper for runOnUiThread in a suspended safe context that bubble up exceptions

Link copied to clipboard