feat(android): allow both exoplayer and vlc

This commit is contained in:
2026-07-26 13:26:56 +02:00
parent 7f733d8ef2
commit 6423ed0bc5
17 changed files with 418 additions and 21 deletions
@@ -0,0 +1,23 @@
///
/// AndroidBackend.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 "AndroidBackend".
*/
@DoNotStrip
@Keep
enum class AndroidBackend(@DoNotStrip @Keep val value: Int) {
VLC(0),
EXOPLAYER(1);
companion object
}
@@ -30,7 +30,7 @@ abstract class HybridOmniPlayerFactorySpec: HybridObject() {
// Methods
@DoNotStrip
@Keep
abstract fun createPlayer(props: Source?): HybridOmniPlayerSpec
abstract fun createPlayer(props: Source?, backend: PlayerBackend?): HybridOmniPlayerSpec
// Default implementation of `HybridObject.toString()`
override fun toString(): String {
@@ -0,0 +1,51 @@
///
/// PlayerBackend.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
import java.util.Objects
/**
* Represents the JavaScript object/struct "PlayerBackend".
*/
@DoNotStrip
@Keep
data class PlayerBackend(
@DoNotStrip
@Keep
val android: AndroidBackend?
) {
/* primary constructor */
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is PlayerBackend) return false
return Objects.deepEquals(this.android, other.android)
}
override fun hashCode(): Int {
return arrayOf<Any?>(
android
).contentDeepHashCode()
}
companion object {
/**
* Constructor called from C++
*/
@DoNotStrip
@Keep
@Suppress("unused")
@JvmStatic
private fun fromCpp(android: AndroidBackend?): PlayerBackend {
return PlayerBackend(android)
}
}
}