mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-15 10:23:28 +00:00
fix(provider): make source optional
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ abstract class HybridOmniPlayerFactorySpec: HybridObject() {
|
||||
// Methods
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
abstract fun createPlayer(props: Source): HybridOmniPlayerSpec
|
||||
abstract fun createPlayer(props: Source?): HybridOmniPlayerSpec
|
||||
|
||||
// Default implementation of `HybridObject.toString()`
|
||||
override fun toString(): String {
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ abstract class HybridOmniPlayerSpec: HybridObject() {
|
||||
// Methods
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
abstract fun setSource(src: Source): Unit
|
||||
abstract fun setSource(src: Source?): Unit
|
||||
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
|
||||
@@ -38,6 +38,9 @@ data class Source(
|
||||
val mixAudio: MixAudioMode?,
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
val castId: String?,
|
||||
@DoNotStrip
|
||||
@Keep
|
||||
val castData: Map<String, String>?
|
||||
) {
|
||||
/* primary constructor */
|
||||
@@ -51,6 +54,7 @@ data class Source(
|
||||
&& Objects.deepEquals(this.fonts, other.fonts)
|
||||
&& Objects.deepEquals(this.metadata, other.metadata)
|
||||
&& Objects.deepEquals(this.mixAudio, other.mixAudio)
|
||||
&& Objects.deepEquals(this.castId, other.castId)
|
||||
&& Objects.deepEquals(this.castData, other.castData)
|
||||
}
|
||||
|
||||
@@ -62,6 +66,7 @@ data class Source(
|
||||
fonts,
|
||||
metadata,
|
||||
mixAudio,
|
||||
castId,
|
||||
castData
|
||||
).contentDeepHashCode()
|
||||
}
|
||||
@@ -74,8 +79,8 @@ data class Source(
|
||||
@Keep
|
||||
@Suppress("unused")
|
||||
@JvmStatic
|
||||
private fun fromCpp(src: Array<VideoSrc>, startTime: Double?, subtitles: Array<Subtitle>, fonts: Array<String>?, metadata: Metadata?, mixAudio: MixAudioMode?, castData: Map<String, String>?): Source {
|
||||
return Source(src, startTime, subtitles, fonts, metadata, mixAudio, castData)
|
||||
private fun fromCpp(src: Array<VideoSrc>, startTime: Double?, subtitles: Array<Subtitle>, fonts: Array<String>?, metadata: Metadata?, mixAudio: MixAudioMode?, castId: String?, castData: Map<String, String>?): Source {
|
||||
return Source(src, startTime, subtitles, fonts, metadata, mixAudio, castId, castData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user