Cleanup source handling

This commit is contained in:
2026-04-10 19:20:45 +02:00
parent 7a5f495b39
commit fd40915bc9
26 changed files with 415 additions and 450 deletions
@@ -30,7 +30,7 @@ abstract class HybridOmniPlayerFactorySpec: HybridObject() {
// Methods
@DoNotStrip
@Keep
abstract fun createPlayer(props: HybridOmniPlayerPropsSpec): HybridOmniPlayerSpec
abstract fun createPlayer(props: Source): HybridOmniPlayerSpec
// Default implementation of `HybridObject.toString()`
override fun toString(): String {
@@ -1,80 +0,0 @@
///
/// HybridOmniPlayerPropsSpec.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 com.margelo.nitro.core.HybridObject
/**
* A Kotlin class representing the OmniPlayerProps HybridObject.
* Implement this abstract class to create Kotlin-based instances of OmniPlayerProps.
*/
@DoNotStrip
@Keep
@Suppress(
"KotlinJniMissingFunction", "unused",
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
)
abstract class HybridOmniPlayerPropsSpec: HybridObject() {
// Properties
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
abstract var src: Array<VideoSrc>
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
abstract var startTime: Double?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
abstract var subtitles: Array<Subtitle>
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
abstract var metadata: Metadata?
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
abstract var mixAudio: MixAudioMode?
// Methods
// Default implementation of `HybridObject.toString()`
override fun toString(): String {
return "[HybridObject OmniPlayerProps]"
}
// C++ backing class
@DoNotStrip
@Keep
protected open class CxxPart(javaPart: HybridOmniPlayerPropsSpec): HybridObject.CxxPart(javaPart) {
// C++ JHybridOmniPlayerPropsSpec::CxxPart::initHybrid(...)
external override fun initHybrid(): HybridData
}
override fun createCxxPart(): CxxPart {
return CxxPart(this)
}
companion object {
protected const val TAG = "HybridOmniPlayerPropsSpec"
}
}
@@ -25,6 +25,12 @@ import com.margelo.nitro.core.HybridObject
)
abstract class HybridOmniPlayerSpec: HybridObject() {
// Properties
@get:DoNotStrip
@get:Keep
@set:DoNotStrip
@set:Keep
abstract var source: Source
@get:DoNotStrip
@get:Keep
abstract val hasPrev: Boolean
@@ -0,0 +1,50 @@
///
/// Source.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 object/struct "Source".
*/
@DoNotStrip
@Keep
data class Source(
@DoNotStrip
@Keep
val src: Array<VideoSrc>,
@DoNotStrip
@Keep
val startTime: Double?,
@DoNotStrip
@Keep
val subtitles: Array<Subtitle>,
@DoNotStrip
@Keep
val metadata: Metadata?,
@DoNotStrip
@Keep
val mixAudio: MixAudioMode?
) {
/* primary constructor */
companion object {
/**
* Constructor called from C++
*/
@DoNotStrip
@Keep
@Suppress("unused")
@JvmStatic
private fun fromCpp(src: Array<VideoSrc>, startTime: Double?, subtitles: Array<Subtitle>, metadata: Metadata?, mixAudio: MixAudioMode?): Source {
return Source(src, startTime, subtitles, metadata, mixAudio)
}
}
}