mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
Basic vlc implementation
This commit is contained in:
+2
-3
@@ -10,7 +10,6 @@ package com.margelo.nitro.omni
|
||||
import androidx.annotation.Keep
|
||||
import com.facebook.jni.HybridData
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.margelo.nitro.core.NullType
|
||||
import com.margelo.nitro.core.HybridObject
|
||||
|
||||
/**
|
||||
@@ -115,11 +114,11 @@ abstract class HybridOmniPlayerSpec: HybridObject() {
|
||||
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
abstract fun selectSubtitle(subtitle: Track): Unit
|
||||
abstract fun selectSubtitle(subtitle: Track?): Unit
|
||||
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
abstract fun selectRendition(rendition: Variant_NullType_Rendition?): Unit
|
||||
abstract fun selectRendition(rendition: Rendition?): Unit
|
||||
|
||||
// Default implementation of `HybridObject.toString()`
|
||||
override fun toString(): String {
|
||||
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
///
|
||||
/// Variant_NullType_Rendition.kt
|
||||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
||||
/// https://github.com/mrousavy/nitro
|
||||
/// Copyright © Marc Rousavy @ Margelo
|
||||
///
|
||||
|
||||
package com.margelo.nitro.omni
|
||||
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.margelo.nitro.core.NullType
|
||||
|
||||
/**
|
||||
* Represents the TypeScript variant "NullType | Rendition".
|
||||
*/
|
||||
@Suppress("ClassName")
|
||||
@DoNotStrip
|
||||
sealed class Variant_NullType_Rendition {
|
||||
@DoNotStrip
|
||||
data class First(@DoNotStrip val value: NullType): Variant_NullType_Rendition()
|
||||
@DoNotStrip
|
||||
data class Second(@DoNotStrip val value: Rendition): Variant_NullType_Rendition()
|
||||
|
||||
val isFirst: Boolean
|
||||
get() = this is First
|
||||
val isSecond: Boolean
|
||||
get() = this is Second
|
||||
|
||||
fun asFirstOrNull(): NullType? {
|
||||
val value = (this as? First)?.value ?: return null
|
||||
return value
|
||||
}
|
||||
fun asSecondOrNull(): Rendition? {
|
||||
val value = (this as? Second)?.value ?: return null
|
||||
return value
|
||||
}
|
||||
|
||||
inline fun <R> match(first: (NullType) -> R, second: (Rendition) -> R): R {
|
||||
return when (this) {
|
||||
is First -> first(value)
|
||||
is Second -> second(value)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@DoNotStrip
|
||||
fun create(value: NullType): Variant_NullType_Rendition = First(value)
|
||||
@JvmStatic
|
||||
@DoNotStrip
|
||||
fun create(value: Rendition): Variant_NullType_Rendition = Second(value)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user