diff --git a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt index 24d057bd..17775248 100644 --- a/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +++ b/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt @@ -1208,13 +1208,12 @@ class JsonConverter { /** * Converts any [BufferType] value into its json representation. * @param bufferType [BufferType] value. - * @return The produced JS string, or `null` if not recognized. + * @return The produced JS string. */ @JvmStatic - fun fromBufferType(bufferType: BufferType?): String? = when (bufferType) { + fun fromBufferType(bufferType: BufferType): String = when (bufferType) { BufferType.ForwardDuration -> "forwardDuration" BufferType.BackwardDuration -> "backwardDuration" - else -> null } @JvmStatic diff --git a/ios/RCTConvert+BitmovinPlayer.swift b/ios/RCTConvert+BitmovinPlayer.swift index 45790355..b2074293 100644 --- a/ios/RCTConvert+BitmovinPlayer.swift +++ b/ios/RCTConvert+BitmovinPlayer.swift @@ -1190,16 +1190,14 @@ extension RCTConvert { /** * Converts any `BufferType` value into its json representation. * - Parameter bufferType: `BufferType` value. - * - Returns: The produced JS string, or `nil` if not recognized. + * - Returns: The produced JS string. */ - static func toJson(bufferType: BufferType) -> String? { + static func toJson(bufferType: BufferType) -> String { switch bufferType { case .forwardDuration: return "forwardDuration" case .backwardDuration: return "backwardDuration" - default: - return nil } }