package com.mrousavy.camera.types

enum class StreamSegmentType(override val unionValue: String) : JSUnionValue {
  FRAGMENTED_MP4("FRAGMENTED_MP4"),
  RB_CHUNKED_MP4("RB_CHUNKED_MP4");

  companion object : JSUnionValue.Companion<StreamSegmentType> {
    override fun fromUnionValue(unionValue: String?): StreamSegmentType =
      when (unionValue) {
        "FRAGMENTED_MP4" -> FRAGMENTED_MP4
        "RB_CHUNKED_MP4" -> RB_CHUNKED_MP4
        else -> FRAGMENTED_MP4 // Default to fMP4
      }
  }
}
