//
//  LivestreamConstants.swift
//  humand
//

import Foundation
import os.log

private let livestreamLogger = OSLog(subsystem: "com.humand.livestream", category: "Livestream")

func livestreamLog(_ message: String) {
  os_log("%{public}@", log: livestreamLogger, type: .default, "[LivestreamManager] \(message)")
}

enum LivestreamConstants {
  enum RNEvents {
    static let livestreamStateChanged = "LIVESTREAM_STATE_CHANGED_EVENT"
    static let livestreamParticipantsChanged = "LIVESTREAM_PARTICIPANTS_CHANGED_EVENT"
    static let livestreamMediaStateChanged = "LIVESTREAM_MEDIA_STATE_CHANGED_EVENT"
    static let livestreamClosedCaption = "LIVESTREAM_CLOSED_CAPTION_EVENT"
    static let livestreamError = "LIVESTREAM_ERROR_EVENT"
  }

  enum CallingState {
    static let idle = "idle"
    static let joining = "joining"
    static let joined = "joined"
    static let left = "left"  // Broadcast has ended
    static let exited = "exited"  // User left, broadcast still ongoing
    static let reconnecting = "reconnecting"
    static let reconnectingFailed = "reconnecting-failed"
  }
}
