feat(state): add state for videos/audios/sub/rend

This commit is contained in:
2026-08-03 19:10:45 +02:00
parent a44cbfbdea
commit 685d3beb2a
28 changed files with 909 additions and 268 deletions
@@ -0,0 +1,80 @@
///
/// Func_void_std__vector_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 androidx.annotation.Keep
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import dalvik.annotation.optimization.FastNative
/**
* Represents the JavaScript callback `(value: array) => void`.
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
* or in Kotlin/Java (in which case it is a native callback).
*/
@DoNotStrip
@Keep
@Suppress("ClassName", "RedundantUnitReturnType")
fun interface Func_void_std__vector_Rendition_: (Array<Rendition>) -> Unit {
/**
* Call the given JS callback.
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
*/
@DoNotStrip
@Keep
override fun invoke(value: Array<Rendition>): Unit
}
/**
* Represents the JavaScript callback `(value: array) => void`.
* This is implemented in C++, via a `std::function<...>`.
* The callback might be coming from JS.
*/
@DoNotStrip
@Keep
@Suppress(
"KotlinJniMissingFunction", "unused",
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
)
class Func_void_std__vector_Rendition__cxx: Func_void_std__vector_Rendition_ {
@DoNotStrip
@Keep
private val mHybridData: HybridData
@DoNotStrip
@Keep
private constructor(hybridData: HybridData) {
mHybridData = hybridData
}
@DoNotStrip
@Keep
override fun invoke(value: Array<Rendition>): Unit
= invoke_cxx(value)
@FastNative
private external fun invoke_cxx(value: Array<Rendition>): Unit
}
/**
* Represents the JavaScript callback `(value: array) => void`.
* This is implemented in Java/Kotlin, via a `(Array<Rendition>) -> Unit`.
* The callback is always coming from native.
*/
@DoNotStrip
@Keep
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
class Func_void_std__vector_Rendition__java(private val function: (Array<Rendition>) -> Unit): Func_void_std__vector_Rendition_ {
@DoNotStrip
@Keep
override fun invoke(value: Array<Rendition>): Unit {
return this.function(value)
}
}
@@ -0,0 +1,80 @@
///
/// Func_void_std__vector_Track_.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 androidx.annotation.Keep
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import dalvik.annotation.optimization.FastNative
/**
* Represents the JavaScript callback `(value: array) => void`.
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
* or in Kotlin/Java (in which case it is a native callback).
*/
@DoNotStrip
@Keep
@Suppress("ClassName", "RedundantUnitReturnType")
fun interface Func_void_std__vector_Track_: (Array<Track>) -> Unit {
/**
* Call the given JS callback.
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
*/
@DoNotStrip
@Keep
override fun invoke(value: Array<Track>): Unit
}
/**
* Represents the JavaScript callback `(value: array) => void`.
* This is implemented in C++, via a `std::function<...>`.
* The callback might be coming from JS.
*/
@DoNotStrip
@Keep
@Suppress(
"KotlinJniMissingFunction", "unused",
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
)
class Func_void_std__vector_Track__cxx: Func_void_std__vector_Track_ {
@DoNotStrip
@Keep
private val mHybridData: HybridData
@DoNotStrip
@Keep
private constructor(hybridData: HybridData) {
mHybridData = hybridData
}
@DoNotStrip
@Keep
override fun invoke(value: Array<Track>): Unit
= invoke_cxx(value)
@FastNative
private external fun invoke_cxx(value: Array<Track>): Unit
}
/**
* Represents the JavaScript callback `(value: array) => void`.
* This is implemented in Java/Kotlin, via a `(Array<Track>) -> Unit`.
* The callback is always coming from native.
*/
@DoNotStrip
@Keep
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
class Func_void_std__vector_Track__java(private val function: (Array<Track>) -> Unit): Func_void_std__vector_Track_ {
@DoNotStrip
@Keep
override fun invoke(value: Array<Track>): Unit {
return this.function(value)
}
}
@@ -118,6 +118,42 @@ abstract class HybridOmniEventMapSpec: HybridObject() {
return __result
}
abstract fun addTracksListener(key: TrackProperty, cb: (value: Array<Track>) -> Unit): Unit
@DoNotStrip
@Keep
private fun addTracksListener_cxx(key: TrackProperty, cb: Func_void_std__vector_Track_): Unit {
val __result = addTracksListener(key, cb)
return __result
}
abstract fun removeTracksListener(key: TrackProperty, cb: (value: Array<Track>) -> Unit): Unit
@DoNotStrip
@Keep
private fun removeTracksListener_cxx(key: TrackProperty, cb: Func_void_std__vector_Track_): Unit {
val __result = removeTracksListener(key, cb)
return __result
}
abstract fun addRenditionsListener(cb: (value: Array<Rendition>) -> Unit): Unit
@DoNotStrip
@Keep
private fun addRenditionsListener_cxx(cb: Func_void_std__vector_Rendition_): Unit {
val __result = addRenditionsListener(cb)
return __result
}
abstract fun removeRenditionsListener(cb: (value: Array<Rendition>) -> Unit): Unit
@DoNotStrip
@Keep
private fun removeRenditionsListener_cxx(cb: Func_void_std__vector_Rendition_): Unit {
val __result = removeRenditionsListener(cb)
return __result
}
abstract fun addOnEndListener(cb: () -> Unit): Unit
@DoNotStrip
@@ -43,22 +43,6 @@ abstract class HybridOmniPlayerSpec: HybridObject() {
@get:Keep
abstract val hasNext: Boolean
@get:DoNotStrip
@get:Keep
abstract val videos: Array<Track>
@get:DoNotStrip
@get:Keep
abstract val audios: Array<Track>
@get:DoNotStrip
@get:Keep
abstract val subtitles: Array<Track>
@get:DoNotStrip
@get:Keep
abstract val rendition: Array<Rendition>
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@@ -112,6 +96,22 @@ abstract class HybridOmniPlayerSpec: HybridObject() {
@get:DoNotStrip
@get:Keep
abstract val castStatus: CastStatus
@get:DoNotStrip
@get:Keep
abstract val videos: Array<Track>
@get:DoNotStrip
@get:Keep
abstract val audios: Array<Track>
@get:DoNotStrip
@get:Keep
abstract val subtitles: Array<Track>
@get:DoNotStrip
@get:Keep
abstract val renditions: Array<Rendition>
// Methods
@DoNotStrip
@@ -0,0 +1,24 @@
///
/// TrackProperty.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 androidx.annotation.Keep
import com.facebook.proguard.annotations.DoNotStrip
/**
* Represents the JavaScript enum/union "TrackProperty".
*/
@DoNotStrip
@Keep
enum class TrackProperty(@DoNotStrip @Keep val value: Int) {
VIDEOS(0),
AUDIOS(1),
SUBTITLES(2);
companion object
}