///
/// HybridVideoPlayerSourceSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#pragma once

#include <NitroModules/JHybridObject.hpp>
#include <fbjni/fbjni.h>
#include "HybridVideoPlayerSourceSpec.hpp"




namespace margelo::nitro::video {

  using namespace facebook;

  class JHybridVideoPlayerSourceSpec: public jni::HybridClass<JHybridVideoPlayerSourceSpec, JHybridObject>,
                                      public virtual HybridVideoPlayerSourceSpec {
  public:
    static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/HybridVideoPlayerSourceSpec;";
    static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
    static void registerNatives();

  protected:
    // C++ constructor (called from Java via `initHybrid()`)
    explicit JHybridVideoPlayerSourceSpec(jni::alias_ref<jhybridobject> jThis) :
      HybridObject(HybridVideoPlayerSourceSpec::TAG),
      HybridBase(jThis),
      _javaPart(jni::make_global(jThis)) {}

  public:
    ~JHybridVideoPlayerSourceSpec() override {
      // Hermes GC can destroy JS objects on a non-JNI Thread.
      jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
    }

  public:
    size_t getExternalMemorySize() noexcept override;
    void dispose() noexcept override;

  public:
    inline const jni::global_ref<JHybridVideoPlayerSourceSpec::javaobject>& getJavaPart() const noexcept {
      return _javaPart;
    }

  public:
    // Properties
    std::string getUri() override;
    NativeVideoConfig getConfig() override;

  public:
    // Methods
    std::shared_ptr<Promise<VideoInformation>> getAssetInformationAsync() override;

  private:
    friend HybridBase;
    using HybridBase::HybridBase;
    jni::global_ref<JHybridVideoPlayerSourceSpec::javaobject> _javaPart;
  };

} // namespace margelo::nitro::video
